This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to recover a nRF9160 from sporadic ENETDOWN

Using a Thingy!91 (v1.0.0 and v1.4.0, firmware 1.2.3, 1.2.7) I get sometimes (every couple of days) a ENETDOWN when sending data out. Before that ENETDOWN, the device was usually able to exchange 100 and more UDP messages.

Currently I do a "sys_reboot(SYS_REBOOT_COLD)", but I'm wondering, if there are less massive ways to recover.   

I found other questions, but I'm still struggling to see an "useful" answer. e.g.

https://devzone.nordicsemi.com/f/nordic-q-a/57642/nrf9160-lte-modem-documentation

but the link at the end, ends in "NOT FOUND".

So, what is the recommended way to recover from ENETDOWN?

Parents
  • Though this case is rare in reality, I'm still not that sure. Anyway, that are my results so far:

    On reboot, I use

       lte_lc_init();

       lte_lc_connect_async(lte_handler)

    and

       socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)

    With that, the device is able to exchange UDP messages. In rare cases, sendto returns an error, and errno is ENETDOWN.

    In that case, I wait now, until the registered lte_handler (see above) reports, that the device is connected again. After that, I close the old socket and open a new one with    

       socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)

    again.

    So far, that works. Lets see, if it still works in 2-3 weeks :-).

Reply
  • Though this case is rare in reality, I'm still not that sure. Anyway, that are my results so far:

    On reboot, I use

       lte_lc_init();

       lte_lc_connect_async(lte_handler)

    and

       socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)

    With that, the device is able to exchange UDP messages. In rare cases, sendto returns an error, and errno is ENETDOWN.

    In that case, I wait now, until the registered lte_handler (see above) reports, that the device is connected again. After that, I close the old socket and open a new one with    

       socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)

    again.

    So far, that works. Lets see, if it still works in 2-3 weeks :-).

Children
No Data
Related