Power management
💡 Note:
-
The information below mainly concerns TapNLink modules. The gateways (Tapioca/TapNPass) and the TapBUS acquisition modules all embed Duetware and benefit from the same control over the processor power modes. On the other hand, if a CPU can consume less than 1 µA, this will not be the case for a gateway or a TapBUS for which the external consumption due to the regulator (power supply) or the transceivers will be much higher.
-
The typical consumption of an STM32 in low power mode is less than 1µA. This is not the case for NFC+BLE+WiFi modules for which the consumption is at least 50 times higher (please refer to the datasheets of the components of the TapNLink modules or the processors they embed).
CPU speed
Setting the CPU clock frequency is generally a simple lever to act on the consumption of a microcontroller. A resource of the lwM2M thus allows to define the speed (slow/standard/fast). Most of the time, the choice of speed will not modify the general behavior of the lwM2M which responds to 'low frequency' requests. On the other hand, slowing down the internal clock may significantly slow down the execution of the Java code by the JVM.
'Low Power' mode
'Low Power' mode is a state in which the CPU is frozen (no programs are running). This mode is particularly relevant for autonomous power supplies (on battery). In this situation, the CPU can be woken up by one of the following two events:
Wakeup by NFC
Bringing a phone with active NFC near will wake up the CPU. A standard connection (possibly BLE or WiFi) will then be possible.
Wakeup by alarm (timer)
The CPU will wake up after a pre-programmed time (either at constant frequency or variable frequency). For example, such an event will allow the Java code to acquire and send to the Cloud data read from sensors.
Settings to configure in Iotize Studio
Below is a list of parameters found in the Tap section of the configuration tree in Iotize Studio:
Title | Definition |
---|---|
Host Inactivity Timeout | Delay before disconnecting idle client. Also triggers entering standby mode |
Standby level | Specify whether the low power modes will be triggered |
Standby Timeout | Specify how long the processor will be kept in Low Power mode |
CPU Frequency | Specify 3 speeds (high corresponds to the highest acceptables speed |
Adapt the Low Power mode from your Java code
There are two Java methods of TapNLinkSystem to modify the behavior specified in the configuration:
-
setSleepDelay( int delay ) to reduce the Standby Timeout. The smaller value of the delay parameter and the Standby Timeout will be taken into account.
-
pauseSleep( int delay ) to increase the Host Inactivity Timeout (and to postpone the trigger of the low power mode). The larger value between the delay parameter and the original Host Inactivity Timeout will be taken into account. Also, pauseSleep(0) will restore the initial value of the Host Inactivity Timeout and will immediately trigger the low power mode if this timeout has already been exceeded.
Note that these two methods will only have an impact on the next triggering of the low power mode. The standard configuration values ​​will then apply to subsequent triggers.