Sleep with modem connected

Hi,

Context: latest release of the firmware (develop) branch and with DeviceOS 2.0-rc4.

I want my tracker to use the new sleep feature but I would like the tracker to remain responsive to incoming function calls so that I can remotely wake it up to take a measurement.

The documentation seems to indicate this is possible:

wakeFor(networkInterface)
Sets wake-on-network mode. This will allow incoming data on the cellular interface such as a function call, variable request, subscribed event, or OTA request to wake the device from sleep. This requires keeping the cellular modem active, which will increase power usage, however it will speed up reconnection and eliminates issues with aggressive reconnection.

So in tracker.cpp, I do:

    // Already there:
    sleep.init([this](bool enable){ this->enableWatchdog(enable); });

    //sleep.register...

    // Added by me:
    TrackerSleep::instance().wakeFor(NETWORK_INTERFACE_CELLULAR);

But this does not seem to change the behavior of the tracker at all.

And in tracker_sleep.cpp I see:

  // This is the flag set when I call wakeFor(NETWORK_INTERFACE_CELLULAR)
  if (_onNetwork) {
    config.network(NETWORK_INTERFACE_CELLULAR);
  }

   // ...

  stopModem();

So it looks like no matter what the flag is, the sleep will always kill the modem anyway.

Is this API fully implemented and supposed to work? What am I missing?

thanks,
thomas

Tracker will currently shut off the modem prior to sleep which is counter to the purpose of this call. The API is there to reflect sleep abilities in the device OS and allow this in the future when we can operate the modem at lower power modes. As a result the power savings of operating in sleep with the modem powered and non-sleep operation isn’t very significant at all. Low power modem development has been kicked around but not planned yet.