In this day and age, all the devices around us are becoming increasingly connected, while also being increasingly wireless. It is more and more obvious in many industries, that battery technology is the most limiting factor for modern technology. However, while we got used to plugging our smartphones to the wall every night and charging electric cars whenever we have the chance, there are many applications in which access to the power grid is even more limited.
Examples of devices that are required to be ready for operation for several years without replacing or recharging the batteries, would include various smart meters (for usage of water, electricity etc.) which are often designed to be simple to install with minimal changes to existing systems, so connecting them to the grid might not always be feasible. Similar arguments can be made for agricultural devices such as soil sensors, often installed in remote locations, quite far from power lines; cables running through fields could also be prone to breaking during field works. There are even some novel usages, such as location-enabled pet collars – it is preferable to take the collar off as rarely as possible, so that the risk of pet getting lost without it on can be minimized.
Radio transmission is power-hungry by its very nature. Power consumption of modern CPUs and microcontrollers, while getting lower with every generation, is also still much too high to allow continuous operation for months or even years on a single battery charge. For this reason, the primary way of extending battery life in IoT devices is to limit the time during which these power-hungry electronics are active, that is by keeping them in sleep mode for as long as possible.
This basic technique can be applied with any type of connectivity, but modern radio technologies dedicated for IoT applications such as LTE Cat-M1, NB-IoT or LoRaWAN, all falling under the LPWAN (low-power wide-area network) umbrella term, include additional extensions to the signaling protocol that make this even more effective. For LTE-based technologies including Cat-M1 and NB-IoT, these are Power Saving Mode (PSM) and extended Discontinuous Reception (eDRX).
PSM is a feature of the 3GPP standards such as Cat-M1 and NB-IoT that allows the cellular module to shut down most of its functions in a way that does not terminate its registration to the network. Whenever the device wakes up later, it can reattach to the network much faster while exchanging much less data than if a full registration were necessary.
If there is no need to handle incoming traffic, the device can then go back into sleep mode within milliseconds. The registration can then be maintained by the network for up to 413 days, depending on the timer value negotiated between the device and the network.
eDRX is another feature of 3GPP standards that facilitates even more aggressive power-saving scenarios. While in PSM, each wakeup from a deep sleep state must start with some device-originated transmission, eDRX allows the device to turn off its radio interface for an extended period of time (up to 43 minutes for LTE-M and even up to 3 hours for NB-IoT), and wake up only to listen in for possible incoming packets. The eDRX cycle length can be autonomously set by the device, and it is the network’s responsibility to queue device-terminated packets for appropriate time slots when the device is scheduled to wake up. The cellular module will only fully wake up if some data is actually received.
Furthermore, eDRX can even be used together with PSM. For example, the device may, after performing an outgoing transmission, function in eDRX mode for half an hour, checking for incoming messages every minute, and then switch into a deep sleep state permitted by PSM, ceasing all communication for several more hours.
The OMA LwM2M protocol contains several features that make it practical to employ the low-level power-saving mechanisms described above. These include:
While handling power-saving modes is outside the scope of Anjay, as it is a library that focuses on implementing the LwM2M protocol itself and does not perform such low-level hardware operations, it contains various APIs that make it feasible to implement all the mechanisms described above:
anjay_set_queue_mode_preference()API, which gives more control to the client application, in line with how queue mode is defined in LwM2M TS 1.1 and up.
anjay_transport_enter_offline()can be called to inform the library about the connectivity state – either if the signal is lost or if the device deliberately went offline to conserve power.
anjay_delete_with_core_persistence()) and restore it during subsequent initialization (
anjay_new_from_core_persistence()). This allows LwM2M registrations to be retained while the client device is in a deep sleep state.
The commercial version also includes APIs to query the time at which automatically handled outgoing messages (such as Register, Update or Notify) are scheduled for sending. This allows the client application to precisely control timer-controlled sleep states so that the device can wake itself or its radio module up just in time to satisfy all the requirements of the LwM2M protocol.
If you want to know more and try these features yourself, don’t hesitate to contact us and ask for an evaluation of the commercial version of Anjay.