LWM2M Errors when first connecting to server - Normal behavior?

Hi, 

I'm using the asset tracker example code with the LWM2M overlay to connect to the Coiote server.

This seems to work fine, and messages do get through. But when booting the device I always get several errors as shown below. Is this normal behavior for a first time connection process?

*** Booting nRF Connect SDK 3758bcbfa5cd ***
[00:00:00.271,270] <inf> at_host: UART check failed: 12. Dropping buffer and retrying.
[00:00:00.282,135] <inf> app_event_manager: APP_EVT_START
[00:00:00.511,749] <inf> app_event_manager: MODEM_EVT_INITIALIZED
[00:00:00.647,613] <inf> app_event_manager: MODEM_EVT_LTE_CONNECTING
[00:00:00.710,296] <inf> lwm2m_firmware: Image is confirmed OK
[00:00:01.324,432] <inf> app_event_manager: DATA_EVT_CONFIG_INIT
%CESQ: 60,3,14,2
+CEREG: 2,"56BD","019B5501",7
[00:00:02.229,003] <inf> app_event_manager: MODEM_EVT_LTE_CELL_UPDATE
+CSCON: 1
+CGEV: ME PDN ACT 0,0
[00:00:03.768,615] <inf> app_event_manager: MODEM_EVT_LTE_CONNECTED
[00:00:03.769,622] <inf> net_lwm2m_rd_client: Start LWM2M Client: urn:imei:xxxx
[00:00:03.770,141] <inf> net_lwm2m_rd_client: RD Client started with endpoint 'urn:imei:xxxx' with client lifetime 43200 using server object 0
+CNEC_ESM: 50,0
%MDMEV: SEARCH STATUS 2
+CEREG: 5,"56BD","019B5501",7,,,"00001111","11100000"
+CEDRXP: 4,"0000","0000","0000"
%XTIME: "80","42609121624280","01"
[00:00:03.983,581] <inf> app_event_manager: MODEM_EVT_LTE_PSM_UPDATE
[00:00:03.984,191] <inf> app_event_manager: MODEM_EVT_LTE_EDRX_UPDATE
[00:00:03.984,771] <inf> app_event_manager: DATA_EVT_DATE_TIME_OBTAINED
[00:00:04.068,054] <inf> lwm2m_security: Need to write credentials, requesting LTE and GNSS offline...
[00:00:04.068,572] <inf> app_event_manager: CLOUD_EVT_LTE_DISCONNECT
+CGEV: ME PDN DEACT 0
[00:00:04.163,146] <inf> app_event_manager: MODEM_EVT_LTE_DISCONNECTED
+CEREG: 0
[00:00:04.263,427] <inf> app_event_manager: MODEM_EVT_LTE_CELL_UPDATE
+CGEV: ME DETACH
%CESQ: 255,0,255,0
+CSCON: 0
[00:00:07.849,975] <inf> lwm2m_security: Requesting LTE and GNSS online
[00:00:07.850,494] <inf> app_event_manager: CLOUD_EVT_LTE_CONNECT
[00:00:07.892,150] <inf> app_event_manager: MODEM_EVT_LTE_CONNECTING
%CESQ: 61,3,18,2
+CEREG: 2,"56BD","019B5501",7
[00:00:09.451,354] <inf> app_event_manager: MODEM_EVT_LTE_CELL_UPDATE
+CSCON: 1
[00:00:09.852,111] <err> net_lwm2m_engine: Failed to enable TLS_DTLS_CID: -22
[00:00:09.852,569] <err> net_lwm2m_engine: Cannot connect UDP (-114)
[00:00:09.852,813] <err> net_lwm2m_rd_client: Cannot init LWM2M engine (-114)
[00:00:09.853,149] <err> net_lwm2m_rd_client: sm_do_network_error, retries 0
[00:00:09.853,393] <inf> net_lwm2m_rd_client: RD Client started with endpoint 'urn:imei:xxxx' with client lifetime 43200 using server object 0
[00:00:09.853,698] <err> net_lwm2m_message_handling: Unable to resolve address
[00:00:09.853,729] <err> net_lwm2m_rd_client: Cannot init LWM2M engine (-2)
[00:00:09.853,942] <err> net_lwm2m_rd_client: sm_do_network_error, retries 1
%CESQ: 56,2,16,2
%CESQ: 52,2,11,1
[00:00:10.854,827] <err> net_lwm2m_rd_client: sm_do_network_error, retries 1
[00:00:10.855,072] <inf> net_lwm2m_rd_client: RD Client started with endpoint 'urn:imei:xxxx' with client lifetime 43200 using server object 0
[00:00:10.855,407] <err> net_lwm2m_message_handling: Unable to resolve address
[00:00:10.855,407] <err> net_lwm2m_rd_client: Cannot init LWM2M engine (-2)
[00:00:10.855,743] <err> net_lwm2m_rd_client: sm_do_network_error, retries 2
+CGEV: ME PDN ACT 0,0
[00:00:11.447,906] <inf> app_event_manager: MODEM_EVT_LTE_CONNECTED
+CNEC_ESM: 50,0
%MDMEV: SEARCH STATUS 2
+CEREG: 5,"56BD","019B5501",7,,,"00001111","11100000"
%XTIME: "80","42609121621380","01"
%CESQ: 47,2,12,1
[00:00:11.759,948] <inf> app_event_manager: MODEM_EVT_LTE_PSM_UPDATE
%CESQ: 52,2,12,1
[00:00:12.855,682] <err> net_lwm2m_rd_client: sm_do_network_error, retries 2
[00:00:12.855,957] <inf> net_lwm2m_rd_client: RD Client started with endpoint 'urn:imei:xxxx' with client lifetime 43200 using server object 0
[00:00:12.938,385] <err> net_lwm2m_engine: Failed to enable TLS_DTLS_CID: -22
[00:00:13.376,739] <inf> net_lwm2m_engine: Connected, sock id 2
[00:00:13.853,363] <inf> net_lwm2m_rd_client: Registration Done (EP='urn:imei:xxxx')
[00:00:13.854,156] <inf> app_event_manager: CLOUD_EVT_CONNECTED

So the specific error that I'm talking about are:

[00:00:09.852,111] <err> net_lwm2m_engine: Failed to enable TLS_DTLS_CID: -22
[00:00:09.852,569] <err> net_lwm2m_engine: Cannot connect UDP (-114)
[00:00:09.852,813] <err> net_lwm2m_rd_client: Cannot init LWM2M engine (-114)
[00:00:09.853,149] <err> net_lwm2m_rd_client: sm_do_network_error, retries 0
[00:00:09.853,393] <inf> net_lwm2m_rd_client: RD Client started with endpoint 'urn:imei:xxxx' with client lifetime 43200 using server object 0
[00:00:09.853,698] <err> net_lwm2m_message_handling: Unable to resolve address
[00:00:09.853,729] <err> net_lwm2m_rd_client: Cannot init LWM2M engine (-2)
[00:00:09.853,942] <err> net_lwm2m_rd_client: sm_do_network_error, retries 1
%CESQ: 56,2,16,2
%CESQ: 52,2,11,1
[00:00:10.854,827] <err> net_lwm2m_rd_client: sm_do_network_error, retries 1
[00:00:10.855,072] <inf> net_lwm2m_rd_client: RD Client started with endpoint 'urn:imei:xxxx' with client lifetime 43200 using server object 0
[00:00:10.855,407] <err> net_lwm2m_message_handling: Unable to resolve address
[00:00:10.855,407] <err> net_lwm2m_rd_client: Cannot init LWM2M engine (-2)
[00:00:10.855,743] <err> net_lwm2m_rd_client: sm_do_network_error, retries 2



Appart from those error during the first connection I also get some errors during use after that, when it tries to connect again. Is this also normal or something that I should look into?

[00:05:13.858,337] <err> net_lwm2m_location_assist: Temporary error in location services retry scheduled
[00:05:13.858,337] <err> cloud_module: cloud_wrap_cloud_location_send, err: -120
+CSCON: 0
%XT3412: 46799999
%XT3412: 0
+CSCON: 1
%CESQ: 59,2,13,1
+CSCON: 0
%XT3412: 46799999
%XT3412: 0
+CSCON: 1
%CESQ: 53,2,11,1
%CESQ: 58,2,10,1
+CSCON: 0
%XT3412: 46799999
[00:06:14.030,426] <err> net_lwm2m_location_assist: No response error in location services
[00:06:14.030,487] <err> net_lwm2m_obj_gnss_assistance: Result code 2
%CESQ: 255,0,255,0
%CESQ: 61,3,14,2
%MDMEV: SEARCH STATUS 2
%XT3412: 0
+CSCON: 1
%CESQ: 56,2,12,1
+CSCON: 0
%XT3412: 46799999
%CESQ: 255,0,255,0
[00:07:46.751,037] <wrn> net_lwm2m_rd_client: Registration Update Timeout
[00:07:46.751,129] <inf> lwm2m_rai: RAI disabled
[00:07:46.751,159] <wrn> lwm2m_integration: LWM2M_RD_CLIENT_EVENT_REG_TIMEOUT
[00:07:46.751,800] <inf> app_event_manager: CLOUD_EVT_CONNECTING
[00:07:46.759,429] <inf> net_lwm2m_rd_client: RD Client started with endpoint 'urn:imei:350457794446409' with client lifetime 43200 using server object 0
%CESQ: 63,3,19,2
%MDMEV: SEARCH STATUS 2
%XT3412: 0
+CSCON: 1
%CESQ: 56,2,12,1
[00:07:47.666,717] <err> net_lwm2m_engine: Failed to enable TLS_DTLS_CID: -22
[00:07:47.779,113] <inf> net_lwm2m_engine: Connected, sock id 2
[00:07:47.942,321] <inf> net_lwm2m_rd_client: Registration Done (EP='urn:imei:350457794446409')
[00:07:47.945,068] <inf> lwm2m_rai: RAI enabled
[00:07:47.945,434] <inf> app_event_manager: CLOUD_EVT_CONNECTED
[00:07:48.178,253] <inf> net_lwm2m_rd_client: Update callback (code:2.4)
[00:07:48.178,375] <inf> net_lwm2m_rd_client: Update Done
[00:07:48.221,069] <inf> lwm2m_rai: Ongoing traffic, RAI disabled
+CSCON: 0
%XT3412: 46799999
%CESQ: 60,3,17,2
[00:08:11.398,925] <err> net_lwm2m_location_assist: No response error in location services
[00:08:11.398,956] <err> net_lwm2m_obj_ground_fix: Result code 2

Parents
  • Hi,

    Which board do you use?

    Which SIM card do you use? Which network does your device connect to?

    Can you provide a modem trace? You can follow the guide for capturing modem traces.

    Best regards,
    Dejan

  • Hi Dejan,

    I'm using a Thingy 91, version 1.6.0.

    Its using an iBASIS eSim, connecting to Vodafone NL.

    This is the modem trace:

    trace-2024-06-27T11-34-45.200Z.mtrace

    Thank you for your time!

  • Hi,

    It seems that you get "Invalid argument" and "Network is unreachable" errors from lwm2m engine as well as "Socket already connected" from the Cloud module. Which network do you connect to? 

    Do you see any difference if you disable Kconfigs shown below in your overlay-lwm2m.conf file?

    CONFIG_LWM2M_TLS_SESSION_CACHING=n
    CONFIG_LWM2M_DTLS_CID=n


    Can you provide more information about your server configuration? Have you followed Coiote Device Management server setup guide?

    Best regards,
    Dejan

  • Hi Dejan,

    After adding those Kconfigs is stil get errors unfortunately:

    *** Booting nRF Connect SDK 3758bcbfa5cd ***
    [00:00:00.271,118] <inf> at_host: UART check failed: 12. Dropping buffer and retrying.
    [00:00:00.281,982] <inf> app_event_manager: APP_EVT_START
    [00:00:00.511,810] <inf> app_event_manager: MODEM_EVT_INITIALIZED
    [00:00:00.638,854] <inf> app_event_manager: MODEM_EVT_LTE_CONNECTING
    [00:00:00.698,913] <inf> lwm2m_firmware: Image is confirmed OK
    [00:00:01.308,471] <inf> app_event_manager: DATA_EVT_CONFIG_INIT
    [00:00:01.641,387] <inf> app_event_manager: SENSOR_EVT_MOVEMENT_ACTIVITY_DETECTED
    %CESQ: 60,3,20,2
    +CEREG: 2,"7EF6","011ED70D",7
    +CSCON: 1
    [00:00:03.762,817] <inf> app_event_manager: MODEM_EVT_LTE_CELL_UPDATE
    +CGEV: ME PDN ACT 0,0
    [00:00:04.966,644] <inf> app_event_manager: MODEM_EVT_LTE_CONNECTED
    [00:00:04.967,742] <inf> net_lwm2m_rd_client: Start LWM2M Client: urn:imei:350457794446409
    [00:00:04.968,383] <inf> net_lwm2m_rd_client: RD Client started with endpoint 'urn:imei:350457794446409' with client lifetime 43200 using server object 0
    +CNEC_ESM: 50,0
    %MDMEV: SEARCH STATUS 2
    +CEREG: 1,"7EF6","011ED70D",7,,,"00001111","11100000"
    +CEDRXP: 4,"0000","0000","0000"
    %XTIME: "80","42704090010180","01"
    [00:00:05.272,552] <inf> app_event_manager: MODEM_EVT_LTE_PSM_UPDATE
    [00:00:05.273,254] <inf> app_event_manager: MODEM_EVT_LTE_EDRX_UPDATE
    [00:00:05.273,895] <inf> app_event_manager: DATA_EVT_DATE_TIME_OBTAINED
    [00:00:05.340,240] <inf> lwm2m_security: Need to write credentials, requesting LTE and GNSS offline...
    [00:00:05.340,728] <inf> app_event_manager: CLOUD_EVT_LTE_DISCONNECT
    +CGEV: ME PDN DEACT 0
    [00:00:05.512,084] <inf> app_event_manager: MODEM_EVT_LTE_DISCONNECTED
    +CEREG: 0
    +CGEV: ME DETACH
    [00:00:05.612,609] <inf> app_event_manager: MODEM_EVT_LTE_CELL_UPDATE
    %CESQ: 255,0,255,0
    +CSCON: 0
    [00:00:07.792,297] <inf> lwm2m_security: Requesting LTE and GNSS online
    [00:00:07.792,816] <inf> app_event_manager: CLOUD_EVT_LTE_CONNECT
    [00:00:07.847,259] <inf> app_event_manager: MODEM_EVT_LTE_CONNECTING
    %CESQ: 58,2,20,2
    +CEREG: 2,"7EF6","011ED70D",7
    [00:00:09.349,365] <inf> app_event_manager: MODEM_EVT_LTE_CELL_UPDATE
    +CSCON: 1
    [00:00:09.794,616] <err> net_lwm2m_engine: Cannot connect UDP (-114)
    [00:00:09.794,891] <err> net_lwm2m_rd_client: Cannot init LWM2M engine (-114)
    [00:00:09.795,227] <err> net_lwm2m_rd_client: sm_do_network_error, retries 0
    [00:00:09.795,440] <inf> net_lwm2m_rd_client: RD Client started with endpoint 'urn:imei:350457794446409' with client lifetime 43200 using server object 0
    [00:00:09.795,776] <err> net_lwm2m_message_handling: Unable to resolve address
    [00:00:09.795,776] <err> net_lwm2m_rd_client: Cannot init LWM2M engine (-2)
    [00:00:09.795,989] <err> net_lwm2m_rd_client: sm_do_network_error, retries 1
    +CGEV: ME PDN ACT 0,0
    [00:00:10.309,814] <inf> app_event_manager: MODEM_EVT_LTE_CONNECTED
    +CNEC_ESM: 50,0
    %MDMEV: SEARCH STATUS 2
    +CEREG: 1,"7EF6","011ED70D",7,,,"00001111","11100000"
    %XTIME: "80","42704090015180","01"
    [00:00:10.511,932] <inf> app_event_manager: MODEM_EVT_LTE_PSM_UPDATE
    [00:00:10.796,722] <err> net_lwm2m_rd_client: sm_do_network_error, retries 1
    [00:00:10.796,966] <inf> net_lwm2m_rd_client: RD Client started with endpoint 'urn:imei:350457794446409' with client lifetime 43200 using server object 0
    [00:00:11.176,452] <inf> net_lwm2m_engine: Connected, sock id 2
    [00:00:11.326,385] <inf> net_lwm2m_rd_client: Registration Done (EP='urn:imei:350457794446409')
    [00:00:11.327,209] <inf> app_event_manager: CLOUD_EVT_CONNECTED
    [00:00:11.328,155] <inf> app_event_manager: APP_EVT_DATA_GET - Requested data types (MOD_DYN, MOD_STAT, BAT, ENV, LOCATION)
    [00:00:11.328,948] <inf> app_event_manager: LOCATION_MODULE_EVT_ACTIVE
    [00:00:11.331,756] <inf> app_event_manager: LOCATION_MODULE_EVT_AGNSS_NEEDED
    [00:00:11.334,167] <inf> app_event_manager: SENSOR_EVT_ENVIRONMENTAL_DATA_READY
    [00:00:11.334,777] <inf> app_event_manager: SENSOR_EVT_FUEL_GAUGE_READY
    +CEREG: 1,"7EF6","011ED70D",7,,,"00001111","00101101"
    [00:00:11.380,737] <inf> app_event_manager: MODEM_EVT_LTE_PSM_UPDATE
    [00:00:11.411,346] <inf> app_event_manager: MODEM_EVT_MODEM_STATIC_DATA_READY
    [00:00:11.491,363] <inf> net_lwm2m_obj_gnss_assistance: Requesting A-GNSS data, mask 0x000001ff
    [00:00:11.491,485] <inf> net_lwm2m_location_assist: Send A-GNSS request
    [00:00:11.494,232] <inf> net_lwm2m_message_handling: Send op to server (/dp)
    [00:00:11.532,470] <inf> app_event_manager: MODEM_EVT_MODEM_DYNAMIC_DATA_READY
    [00:00:11.555,877] <inf> net_lwm2m_message_handling: Send done!
    +CSCON: 0
    %XT3412: 46799999
    %CESQ: 58,2,15,2
    %CESQ: 60,3,22,3
    %CESQ: 60,3,15,2
    [00:00:43.990,570] <inf> lwm2m_rai: RAI enabled
    %CESQ: 61,3,20,2
    %CESQ: 255,0,255,0
    [00:01:04.249,359] <inf> app_event_manager: SENSOR_EVT_MOVEMENT_INACTIVITY_DETECTED
    %CESQ: 59,2,9,1
    %MDMEV: SEARCH STATUS 2
    %CESQ: 60,3,18,2
    %XT3412: 0
    +CSCON: 1
    %CESQ: 59,2,23,3
    %CESQ: 59,2,17,2
    [00:01:17.033,905] <inf> app_event_manager: SENSOR_EVT_MOVEMENT_ACTIVITY_DETECTED
    %CESQ: 58,2,12,1
    %CESQ: 58,2,18,2
    %CESQ: 58,2,23,3
    %CESQ: 59,2,17,2
    %CESQ: 59,2,22,3
    %CESQ: 58,2,17,2
    %CESQ: 56,2,22,3
    %CESQ: 54,2,16,2
    %CESQ: 52,2,21,3
    %CESQ: 52,2,16,2
    %CESQ: 51,2,21,3
    +CSCON: 0
    %XT3412: 46799999


    The server is just the normal Coiote server, set up as per the link that you gave. So I added the device to the Coiote server fist (via the management server, no bootstrap), then programmed the asset tracker with the PSK and server address.

     What exact information on the server do you need?

  • Hi,

    hubert_11 said:
    What exact information on the server do you need?

    Apart from what you already provided, there is no need for additional information at this point. I will let you know if more information is needed.

    We will look into this issue internally. I will get back to you by the end of the next week. Please note that delayed replies can be expected due to reduced staffing during the holiday season.

    Best regards,
    Dejan

  • Thank you Dejan,

    I'll await your response then.

    Have a nice weekend!

  • Hi,

    Have a nice weekend too!

    Best regards,
    Dejan

Reply Children
  • Hi,

    CID error might happen if you use old modem firmware version. You could try to update modem firmware.
    Problem with location services might happen if you have not properly set up location services on the cloud side.

    Best regards,
    Dejan

  • Thank you for your response,

    I just updated my modem firmware to 1.3.6, but this didn't make a difference.
    It still gives me the same lwm2m module-related errors:

    [00:00:11.112,457] <err> net_lwm2m_engine: Cannot connect UDP (-114)
    [00:00:11.112,731] <err> net_lwm2m_rd_client: Cannot init LWM2M engine (-114)
    [00:00:11.113,128] <err> net_lwm2m_rd_client: sm_do_network_error, retries 0
    [00:00:11.113,372] <inf> net_lwm2m_rd_client: RD Client started with endpoint 'urn:imei:350457794446409' with client lifetime 43200 using server object 0
    [00:00:11.113,708] <err> net_lwm2m_message_handling: Unable to resolve address
    [00:00:11.113,739] <err> net_lwm2m_rd_client: Cannot init LWM2M engine (-2)
    [00:00:11.113,952] <err> net_lwm2m_rd_client: sm_do_network_error, retries 1
    +CGEV: ME PDN ACT 0,0
    [00:00:11.510,925] <inf> app_event_manager: MODEM_EVT_LTE_CONNECTED
    +CNEC_ESM: 50,0
    %MDMEV: SEARCH STATUS 2
    +CEREG: 1,"7EF6","011ED70D",7,,,"00001111","11100000"
    %XTIME: "80","42709001425080","01"
    [00:00:12.114,715] <err> net_lwm2m_rd_client: sm_do_network_error, retries 1



    I'm not sure what problems with the location services you are discussing. Could you elaborate on that?

    As far as I'm aware, I'm just having LWM2M connection error issues.


    Thank you!

  • Hi,

    hubert_11 said:
    I'm not sure what problems with the location services you are discussing. Could you elaborate on that?

    You had these 2 lines in your initial log
    [00:08:11.398,925] <err> net_lwm2m_location_assist: No response error in location services
    [00:08:11.398,956] <err> net_lwm2m_obj_ground_fix: Result code 2
    Result code resource provides information about the request handling on the server side. In your case result_code is 2 which means that you did not receive response from the server in LOCATION_ASSISTANT_RESULT_TIMEOUT seconds.  

    Can you check if you get the same error using nrf9160-dk board?

    Best regards,
    Dejan

  • Ah, yes, I had missed those lines. But I'm not going to use the location services in my application eventually, so I'm not too worried about those errors.

    I, unfortunately, do not have access to an nrf9160-dk board, only to several thingies 91's.
    Is there anything else I can try on the thingy?

  • Hi,

    For nrf9160 you should keep CONFIG_LWM2M_DTLS_CID=n.
    Your trace file indicates that DTLS succeeds, and data is sent. Most likely LWM2M stack is attempting to connect before device connects to LTE network causing errors. Eventually, device connects to the network, and everything seems to be fine. There seem to be no problem in communication, and you could probably just ignore the errors.

    Best regards,
    Dejan

Related