Hello DevZone,
I am currently trying to fix an issue I have on deployed devices, using nRF9160 with nRFCloud. Code is based on SDK 2.8.0.
In most cases, my code works fine and there is no issue. However, I sometimes have the following issue.
When trying to connect to nRFCloud using nrf_cloud_coap_connect(), the connection can take some time ... so long that it trigger my watchdog, which is setup to 75 seconds !
In the field, I identified two cases when this occurs:
- When the device has bad network coverage. In that case, my theory is that some data packages get lost during the process, and some retry mecanism takes a long time.
- When nRFCloud is down. This occured for example on October 20th 2025, leading thousands of my devices to reboot every 75 seconds (due to watchdog), for several hours. That was not good for batteries ...
The first approach to solve this is to simply increase the watchdog timing. However:
1 - It's already using a rather large duration, due to other specific actions. My overall goal is actually to try to reduce this value.
2 - I can't find any info regarding the maximum execution duration of nrf_cloud_coap_connect(). Is it possible to get this info ?
The second way to solve this issue, is to be able to abort a connection attempt.
I already tried to setup a timer and start it just before nrf_cloud_coap_connect().
When the timer fires (ex, after 60 sec)or example), it call nrf_cloud_coap_disconnect() an/or (tried both) nrf_cloud_coap_init(). But this doesn't abort the connection.
Is there a way to abort a connection attempt ? If so, how can I do it ?
Thanks.