For more than five years now, WiFi modules based on the SOC ESP8266 (ESP8285) have been successfully used in stand-alone devices for measuring various parameters of objects and the environment with the transmission of received data via WiFi.
In the article "How to reduce the consumption of wifi modules by ten or more times", he talked about some ways to reduce the WiFI session activity time of such modules, which can significantly reduce energy consumption during data transfer. In this case, the typical time of a short message transmission session can be reduced from 1-4 seconds to 0.12-0.3 seconds.
However, in devices with slow sensors or with a large number of them, the time for obtaining information from the sensors significantly increases. In this case, the energy consumption when polling sensors becomes commensurate with the energy consumption for data transmission via WiFi.
At the same time, if the parameters monitored by the sensors have not changed significantly, or the measurement results can be used autonomously, then there is no need to transfer data via WiFi. For example, if the measured temperature of the object remains the same, then it is not necessary to transmit its value, which saves energy on a WiFi session.
Moreover, the ESP8266-based temperature measuring module can periodically switch to deep sleep mode, at which the current consumption is less than 20 μA. Waking up, the module reads the sensor readings, compares these readings with the previous data. If the readings have changed insignificantly or are within the permissible operating temperature range, the module switches back to sleep mode without a communication session.
If the sensor readings noticeably change or go beyond the acceptable range, the module transmits data and / or an alarm via WiFi and switches to deep sleep mode.
, , WiFi . 70 . , WiFi .
: WiFi , 15, 5 .
, WiFi SDK , . 1 , 0.3 . , WiFi WiFi .
WiFi . , , , .
, void user_pre_init(void), NONOS SDK, 3.0, 0x60000704 . WiFi , 15 .
, WiFi.
, 0x60000704. , WiFi .
WiFi SDK wifi_get_opmode(), / . , , WiFi .
:
uint32 *RT= (uint32_t *)0x60000700;
void user_pre_init(void)
{
uint32 xRT=RT[4]; RT[4]=0;
//
…
// , :
RT[4]=xRT;
}
:
.
WiFi .
UDP.
...
In the next post, I will tell you how to organize the operation of ESP8266 modules with sensors in standby mode for interrupts from a timer or GPIO, but with a current consumption of 2 mA instead of 15 mA with the WiFi modem turned off (or instead of 70 mA when it is turned on). As a result, we reduce the consumption of ESP8266 when working with sensors by 10 times or more.