Help with LTE connection after loss of connection

We have noticed that several of our nRF9160 in production have problem with reconnecting to the LTE-M network after temporarily losing connection. We have tried reproducing this issue by deactivating the sim for about 10 seconds and then activating it again. After the default six retries it gives up and stop trying to reconnect to the network. the only way we can achieve a connection is if we do a sys_reboot() or a hard reboot with watchdog. Why is the reconnect attempts not enough? Why do we have to force a reboot? Attached are relevant logs.

  • Colleague here. Some additional information:

    Our code is based on this sample, although we do not have the changes that have been made in the last couple of months in this repo:

    github.com/.../main.c

  • More info: 

    • We are using NSC version 2.6.0 and mfw 1.3.6.
    • The sims are global (EU, Nordics, Baltics), see image of subscription details.We have mainly worked with Telia sims but some of our clients have tried using other with no improvement. 

  • Some more logs:

    At 25:13:28.422, the device starts another registration update. However, almost 4 minutes later, the next log says Registration update failure!.

    What can we do about the fact that a registration update is being made and failing after 4 minutes without returning an error earlier or trying to send another registration update?

    [1;32muart:~$ [m[8D[J[1;32muart:~$ [m[8D[J[25:12:49.299,560] [0m<dbg> app_lwm2m_client: rd_client_event: Registration update started[0m
    [1;32muart:~$ [m[8D[J[25:12:49.820,068] [0m<inf> net_lwm2m_rd_client: Update callback (code:2.4)[0m
    [1;32muart:~$ [m[8D[J[25:12:49.820,098] [0m<dbg> app_lwm2m_client: rd_client_event: Registration update complete[0m
    [1;32muart:~$ [m[8D[J[25:12:49.820,129] [0m<dbg> app_lwm2m_client: watchdog_Kick: Watchdog feed ok![0m
    [1;32muart:~$ [m[8D[J[25:12:49.820,220] [0m<inf> net_lwm2m_rd_client: Update Done[0m
    [1;32muart:~$ [m[8D[J[25:13:08.821,136] [0m<dbg> app_lwm2m_client: rd_client_event: Registration update started[0m
    [1;32muart:~$ [m[8D[J[25:13:09.422,882] [0m<inf> net_lwm2m_rd_client: Update callback (code:2.4)[0m
    [1;32muart:~$ [m[8D[J[25:13:09.422,912] [0m<dbg> app_lwm2m_client: rd_client_event: Registration update complete[0m
    [1;32muart:~$ [m[8D[J[25:13:09.422,943] [0m<dbg> app_lwm2m_client: watchdog_Kick: Watchdog feed ok![0m
    [1;32muart:~$ [m[8D[J[25:13:09.423,034] [0m<inf> net_lwm2m_rd_client: Update Done[0m
    [1;32muart:~$ [m[8D[J[1;32muart:~$ [m[8D[J[25:13:28.422,973] [0m<dbg> app_lwm2m_client: rd_client_event: Registration update started[0m
    [1;32muart:~$ [m[8D[J[1;32muart:~$ [m[8D[J[25:17:35.525,115] [0m<dbg> app_lwm2m_client: rd_client_event: Registration update failure![0m
    [1;32muart:~$ [m[8D[J[25:17:35.533,111] [0m<inf> net_lwm2m_rd_client: RD Client started with endpoint 'Q3IoT-350457792623710' with client lifetime 86400 using server object 0[0m
    [1;32muart:~$ [m[8D[J[25:17:36.104,187] [0m<inf> net_lwm2m_engine: Connected, sock id 2[0m
    [1;32muart:~$ [m[8D[J[25:17:36.107,330] [0m<dbg> app_lwm2m_client: rd_client_event: Disconnected[0m
    [1;32muart:~$ [m[8D[J[25:17:36.107,452] [0m<inf> net_lwm2m_rd_client: Stop LWM2M Client: Q3IoT-350457792623710[0m
    [1;32muart:~$ [m[8D[J[25:17:36.193,908] [0m<inf> app_lwm2m_client: Client connect to server[0m
    [1;32muart:~$ [m[8D[J[25:17:36.193,969] [0m<inf> net_lwm2m_rd_client: Start LWM2M Client: Q3IoT-350457792623710[0m
    [1;32muart:~$ [m[8D[J[25:17:36.194,610] [0m<inf> net_lwm2m_rd_client: RD Client started with endpoint 'Q3IoT-350457792623710' with client lifetime 86400 using server object 0[0m
    [1;32muart:~$ [m[8D[J[25:17:36.320,770] [0m<inf> app_lwm2m_client: LwM2M is connecting to server[0m
    [1;32muart:~$ [m[8D[J[25:17:36.506,072] [0m<inf> net_lwm2m_engine: Connected, sock id 2[0m
    [1;32muart:~$ [m[8D[J[1;32muart:~$ [m[8D[J[25:17:36.658,264] [0m<dbg> app_lwm2m_client: rd_client_event: Registration complete[0m
    [1;32muart:~$ [m[8D[J[25:17:36.658,416] [0m<inf> net_lwm2m_rd_client: Registration Done (EP='Dgr4KNM8sV')[0m
    [1;32muart:~$ [m[8D[J[25:17:36.741,363] [0m<inf> app_lwm2m_client: LwM2M is connected to server[0m
    [1;32muart:~$ [m[8D[J[25:17:36.742,248] [0m<inf> app_lwm2m_client: Obtained date-time from modem[0m
    [1;32muart:~$ [m[8D[J[1;32muart:~$ [m*** Booting nRF Connect SDK v3.5.99-ncs1 ***
    I: Starting bootloader
    I: Primary image: magic=good, swap_type=0x2, copy_done=0x1, image_ok=0x1
    I: Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
    I: Boot source: none
    I: Image index: 0, Swap type: none
    I: Bootloader chainload address offset: 0x10000
    I: Jumping to the first image slot ä[m

  • https://github.com/nrfconnect/sdk-zephyr/blob/main/subsys/net/lib/lwm2m/lwm2m_rd_client.c#L73

    It looks like the EXCHANGE_LIFETIME is set to 247s (4 minutes 7s) in the code here. Is there any way we can modify this value? Or is there another way to "give up" the exchange earlier?

  • Hi,

    Could you  and  please confirm that all your questions and logs are related to the same application (based on lwm2m_client in NCS v2.6.1)?

    Could you please provide more information about your application? What exactly do you try to achieve? What does your application do?

    We have noticed that several of our nRF9160 in production have problem with reconnecting to the LTE-M network after temporarily losing connection.

    Can you provide more information on how devices lose connection? Do they work normally and suddenly lose connection? How often does this happen and on how many devices? Where are your failing devices located?

    We have tried reproducing this issue by deactivating the sim for about 10 seconds and then activating it again. After the default six retries it gives up and stop trying to reconnect to the network.

    Why do you think that the issue might be related to SIM? How do you do deactivation/activation of the SIM?

    Matias Marti said:
    It looks like the EXCHANGE_LIFETIME is set to 247s (4 minutes 7s) in the code here. Is there any way we can modify this value? Or is there another way to "give up" the exchange earlier?

    Have you tried changing the value directly in the code?

    Best regards,
    Dejan

Related