Some power saving questions
-
- Posts: 26
- Joined: Fri Oct 24, 2014 7:58 pm
Some power saving questions
Postby ESP_Sprite » Fri Dec 05, 2014 6:45 pm
About system_rtc_mem_read and system_rtc_mem_write: I presume this is meant to store data over a reset cycle, so you can save stuff when going to deep sleep without having to put it in flash? If so, how much memory is available? I also assume the main memory isn't kept over a deep sleep cycle?
I see there's a wifi_station_disconnect there. Does this disable the WiFi hardware when the module is in STA mode?
I'm asking this because I'm thinking about a sensor that runs on batteries. What I'd like to do is to have it wake up say every 30 seconds or so, take a sample, store it in RTC memory, then go to sleep again. Every 5 minutes, it will enable the WiFi stack and send the collected data. I would not want the sensor to have to start the WiFi electronics every 30 seconds, because that'd mean a fairly big drain on the batteries. Is such an use case possible?
-
- Posts: 26
- Joined: Fri Oct 24, 2014 7:58 pm
Re: Some power saving questions
Postby ESP_Sprite » Mon Dec 08, 2014 7:27 pm
-
- Posts: 26
- Joined: Fri Oct 24, 2014 7:58 pm
Re: Some power saving questions
Postby ESP_Sprite » Sat Dec 13, 2014 5:11 am
- 0.3 seem to be general chip read and init stuff.
- 1.8 are used to scan for the access point. After scanning, connecting with it happens instantaneous
- 1.0 is used to get a DHCP lease
- 1.5-1.9 is used to send the actual HTTP request and receive data.
In general, all operations seem to average about 70mA of power, but the scan and DHCP lease bit seem to pull more than the HTTP thing. See the attached scope image.
My idea is, if there's a way we can read and set the specific access point settings and DHCP lease info to RTC ram and restore them when the chip wakes up again, we can save more than half the time the thing is awake. Because it pulls way less power when doing the HTTP request, I think devices running on battery will get about 3 times as much lifetime than when just rebooting.
My question is: Espressif guys/gals, is there a plan to implement this kind of sleep/wakeup behaviour? If there isn't, can you implement an API to get/set the access point details, so scanning for them on wakeup becomes superfluous? We can implement the DHCP and save/load-from-RTC-ram bit ourselves if needed. (As a final alternative: any chance the phy etc libraries can be open-sourced?)
- Attachments
-
- DS1Z_QuickPrint2.png (66 KiB) Viewed 26471 times
Re: Some power saving questions
Postby Lars R. » Sun Dec 14, 2014 4:11 pm
. If a full reset is involved, I would prefer storing in Flash rather than RTC ram.
. Success of speeding up connecting and DHCP lease might depend on access point behavior/settings.
. Power consumption might be optimized with
.. TX power. Already asked for API.
.. ESP8266 system clock frequency.
.. Flash clock frequency.
.. GPIO pullup (UART).
Re: Some power saving questions
Postby frob » Tue Dec 16, 2014 7:48 am
It there was an easy way to "turn this on" it would probably allow for the lowest possible power consumption in this kind of use scenario.
Re: Some power saving questions
Postby ESP_Faye » Fri Dec 19, 2014 1:34 pm
|_ _ _ _ _system data _ _ _ _ _|_ _ _ _ _ _ _ _ _ user data _ _ _ _ _ _ _ _ _|
| 256 bytes | 512 bytes |
Note: RTC memory is 4 bytes aligned for read and write operations. Parameter “des_addr” means block number(4 bytes per block). So, if we want to save some data at the beginning of user data area, “des_addr” will be 256/4 = 64, “save_size” will be data length.
Prototype:
bool system_rtc_mem_write (uint32 des_addr, void * src_addr, uint32 save_size)
Parameter:
uint32 des_addr —— destination address (block number) in RTC memory,
des_addr >=64
void * src_addr —— data pointer.
uint32 save_size —— data length ( byte)
Return:
True, succeed;False,fail.
Re: Some power saving questions
Postby Lars R. » Fri Dec 19, 2014 10:41 pm
Deep sleep is a great feature that enables battery applications. This is particularly helpful when sensor data is transferred with long time interval like 10 minutes.
But how can we reduce regular power consumption when NOT in deep sleep? For applications that need to check switches or short-interval sensors, a low power mode could prove useful. Can we achieve that by reducing wake-up time and reconnecting time, by reducing clock frequencies (system and flash) and by reducing/modifying transmission power?
Best regards
Lars
Re: Some power saving questions
Postby jackon » Fri Dec 19, 2014 11:00 pm
Lars R. wrote:@Espressif_Faye:
Deep sleep is a great feature that enables battery applications. This is particularly helpful when sensor data is transferred with long time interval like 10 minutes.
But how can we reduce regular power consumption when NOT in deep sleep? For applications that need to check switches or short-interval sensors, a low power mode could prove useful. Can we achieve that by reducing wake-up time and reconnecting time, by reducing clock frequencies (system and flash) and by reducing/modifying transmission power?
Best regards
Lars
ESP8266 have three low power modes:
1. Modem sleep, average current is 15mA;
2. Light sleep, average current is 0.9mA;
3. Deep sleep, average current is 10uA.
Modem sleep & light sleep are just effective in station only mode.
-
- Posts: 26
- Joined: Fri Oct 24, 2014 7:58 pm
Re: Some power saving questions
Postby ESP_Sprite » Sun Dec 21, 2014 7:53 pm
Jackon: How do you use those sleep modes? I've seen the new wifi_set_sleep_type call in the 0.9.4 SDK but I don't really see any difference in behaviour after I call them: system_deep_sleep still takes as long as it did, and when I leave the system running I still get an average power use of 50mA. Is there a wifi_sleep() call or something I'm missing?
Re: Some power saving questions
Postby ESP_Faye » Tue Dec 23, 2014 8:10 pm
interface to load and save the WiFi parameters: wifi_softap_get_config and wifi_softap_set_config
wifi_set_sleep_type to set sleep type for power saving. Set NONE_SLEEP_T to disable power saving. Default to be Modem sleep. Power saving is only enabled in station mode,because softap can not sleep.
Thanks for your interest in ESP8266 !
Who is online
Users browsing this forum: Google [Bot] and 19 guests
Login
Newbies Start Here
Are you new to ESP8266?
Unsure what to do?
Dunno where to start?
Start right here!
Latest SDK
Documentation
Complete listing of the official ESP8266 related documentation release by ESPRESSIF!
Must read here!
- All times are UTC+08:00
- Top
- Delete all board cookies
About Us
Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. We are the manufacturer of ESP8266EX.