In this article the code from here gets described in great detail. But the deep sleep sample is not really practical since most of the time i want the device to wake up without manual intervention (i.e the press of a button). The on board RTC has a interrupt functionality according to their docs. I tried to combine the deep sleep code with the external rtc code. But when i replace k_sleep() with k_cpu_idle() it doesn’t work anymore. Do i need to adjust the devicetree maybe that it accepts interrupts from there? How would this be possible?

In many cases, it’s much easier to only “k_sleep”, and of course, PSM or eDRX. Using the RTC will not save too much energy, so you will not need it.

The RTC in the latest versions does not wake the device from “deep sleep” sleep any longer. The active sleep is about 10uA. While not ideal, it’s much better where earlier versions started!

I have written a code where i init and deinit the lte modem so it should always be powered off, right? But i still get spikes of 70mA about every second which reduces the battery life drastically. This function i use for the shutdown:

static int shutdownModem()
{
    int err;

    /* Uninit lte_lc */
    err = lte_lc_deinit();

    /* Uninit modem lib */
    err = nrf_modem_lib_shutdown();

    return err;
}

So I thought if I use k_cpu_idle() it might would remove those spikes. Why is there even a RTC if it can’t be used to wake the device up? For timekeeping i can just query the network time.

Try Getting started with current measurements on the nRF9160 or

main.c:

#include <modem/lte_lc.h>
#include <modem/nrf_modem_lib.h>

int main(void)
{
 nrf_modem_lib_init();
 lte_lc_power_off();
 k_sleep(K_MSEC(1000));
 NRF_REGULATORS->SYSTEMOFF = 1;
 return 0;
}

prj.conf:

CONFIG_LTE_LINK_CONTROL=y
CONFIG_NRF_MODEM_LIB=y
CONFIG_LOG=n

If you just “shutdown” the library in the app mcu, that may not affect the modem.

And again:
Shutdown the modem is not required. Using PSM this is done automatically on demand. If you switch it on/off be careful, you may get limited by your network provider.

when PSM is not available on a network.

The big caveat, when the network doesn’t support PSM is, that your devices are in danger of being disconnected at all!

In my experience, no PSM happens mainly on LTE-M, but with that you need to be very careful. LTE-M without PSM may be LTE at an old base-station, and once the base-station gets updated, then you may get painfully aware that, the SIM comes only with a LTE-subscription at that provider but not with LTE-M. Sounds crazy, but

https://devzone.nordicsemi.com/f/nordic-q-a/105131/esm-error-code-50-type-ipv4-only-allowed-nrf91-asset-tracker/453819

The firmware (2.0.0) for the new nRF9161 offers also a new feature %FEACONF - 0 – Proprietary Power Saving Mode (PSM), lets see, if that helps or causes in the end more trouble.

Terms and Conditions | Privacy Policy