This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Init & deinit modem.

Hi, 

Firmware v1.31


I have a question about using those call functions https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/include/modem/lte_lc.html#c.lte_lc_deinit . Is OK to constantly turn off and on the modem like that. Also in the https://github.com/nrfconnect/sdk-nrf/blob/26499cc18ec0ad915f717cfb05409c6f0a738a76/lib/lte_link_control/lte_lc.c#L489  init function I had to remove the if  condition https://github.com/nrfconnect/sdk-nrf/blob/26499cc18ec0ad915f717cfb05409c6f0a738a76/lib/lte_link_control/lte_lc.c#L493 to make it work. V1.2.0 also don't have the condition.  Will this have an side effects.? .

lte_lc_deinit(void)
lte_lc_offline(void)
lte_lc_power_off(void)
     
if (is_initialized) {
		return -EALREADY;
	}

Parents
  • Hi!

    No, it's not a good idea to constantly turn the modem off and on (AT+CFUN=0). Turning the modem off automatically writes a lot of the modem configurations to flash. Since there are a limited number of write operations to flash, you can risk exceeding this limit.

    Instead, we recommend putting the modem in offline mode (AT+CFUN=4), which has the same functionality without writing anything to flash. 

    Why did you need to remove the if-statement to make this work? We really don't recommend modifying the libraries in NCS. 

    Best regards,

    Heidi

  • Hi,

    I am using de-init and init the modem since I am using CoAP and GPS and both require modem connection. After using the call functions  (offline or turn_off ) the modem will be de-initialized so I had to change ncs to remove the if condition which will lead to an error and  return.

    Just to make sure using  offline() call and then  lte_lc_init(); , again and again shouldn't pose any problems.



Reply
  • Hi,

    I am using de-init and init the modem since I am using CoAP and GPS and both require modem connection. After using the call functions  (offline or turn_off ) the modem will be de-initialized so I had to change ncs to remove the if condition which will lead to an error and  return.

    Just to make sure using  offline() call and then  lte_lc_init(); , again and again shouldn't pose any problems.



Children
Related