AT+CFUN=1 Retry Algorithm

If AT+CFUN=1 will not get modem connected/registered to a network, what retry algorithm does the nRF9160 implement? Is it something like exponential back-off algorithm?

  • Hello, 

    Can you provide more details? Are you not connecting when issuing the AT+CFUN=1 command? What happens when you do? Please provide a log output and modem trace of the issue. 

    There is most likely a back-off algorithm running, both on modem and network. What network are you on? 

    Kind regards,
    Øyvind

  • My team is actually planning to implement a back off algorithm in the application layer whenever we don't get our devices registered or connected. We are planning to use the AT commands CFUN and CREG?.

    For instance, we send AT+CFUN=1, and after 15 seconds, CREG? indicates the device is still not registered. This would trigger the application to send AT+CFUN=0, sleep for 2 seconds, then try again. If the same sequence (CFUN=1, wait 15 seconds, check CREG?) fails again, device sends AT+CFUN=0 again but this time, sleeps for 4 seconds. Next sequence failure will cause the device to sleep 8 seconds, then 16 seconds, then 32 seconds ...

    Is something already implemented in the modem/radio layer so the application layer can just send AT+CFUN=1 once and keeps on checking CREG? until it connects? 

    Our network is LTE.

  • Hello, sorry I misread your initial question. Didn't catch the "if" in the start. 

    The LTE Link Control driver should handle this for you. This will handle the connection for you in the background. Have a look at the API here nrf\include\modem\lte_lc.h, where it will send AT+CFUN=1 and keeps trying until timer expires and retry with e.g. a fallback network. I.e. it will try to connect LTE-M for 10 minutes if it does not get connection it will use fallback network NB-IoT and retry connection for 10 min. 

    Note that the modem will handle the back-off time which is implemented in the modem FW as per 3GPP.




     
Related