When using CFUN=0, the modem stores settings (such as system mode and successful network connection information) to the flash from what I can gather, but it then needs to be power cycled to function again. How do you go about doing that in the application firmware? Is there a way to manually power the modem off and on?
On the same vein, if the modem becomes unresponsive to AT commands or enters an unknown state, how would you power cycle it to reset it using the application firmware?
From some experimentation, I found that resetting the application in the firmware resets the modem as well.
Could anyone at Nordic comment if the modem can be reset separately to the application?
If you are using the lte_link_control driver you can just call the lte_lc_offline() function in the application to turn off the modem and then lte_lc_init_and_connect() re-initialize the modem.
lte_lc_offline only does "AT+CFUN=4". I didn't think that would save modem configuration to NVM like "AT+CFUN=0". Was I wrong?
You are right, CFUN=4 does not save it to the NVM and from what I've gathered only CFUN=0 does so. So Martin Lesund, do you know if there is a way to reset the modem without resetting the application as well?
If you turn off the modem (CFUN=0) there is no other way to turn it on other than to do a power cycle.You can do this from the application by enabling it from the prj.conf file (or menuconfig ):
and add #include <misc/reboot.h> in your application where you can call the function:
note: Add a delay after the AT+CFUN=0 so the modem can do a graceful shutdown from the network and store data in the modem flash.