HELP: UART Not Working & Clock Not Accurate after deep-sleep

yangtao
Posts: 19
Joined: Tue Feb 02, 2016 3:03 pm

HELP: UART Not Working & Clock Not Accurate after deep-sleep

Postby yangtao » Sat May 07, 2016 11:16 am

I studied "ESP8266 Sleep Mode & Low-Power Solutions" and followed the instructions to set ESP8266 to deep-sleep mode "system_deep_sleep_set_option(4)".
However, the device's UART does not work properly after sleep via command "system_deep_sleep(200)".

1) How to fix the UART issue after deep-sleep?
(In the user_init, it has uart configuration. Is it the same issue as question 2 (System clock changes?) ? )

Also, after deep-sleep, the clock looks not accurate.
For example, I use I2S to generate IR clocks, however, sometimes the clock is not 38KHz, which is much lower.
2) Does ESP8266's non-os sdk (1.5.2) change AHB clock/timer-clock in order to save power?
(If yes, is there any register that I can access to re-configure clocks?)

Other questions related to Wi-Fi ON/OFF:
My objective is to switch on Wi-Fi as station mode only few seconds per hour. Most of the time, the device is in light-sleep / deep-sleep mode. In other words, I use ESP8266 as normal microcontroller except when reporting status hourly.
3) How could I disable/enable Wi-Fi from user level application? (except "system_deep_sleep_set_option" function, which needs to reboot to take effect)
4) Is it possible to disable Wi-Fi in light-sleep mode? (CPU is pending, but can be waken up by GPIO. Since no DTIM processing, the average current should be much lower than 0.4mA)


One issue probably caused by my code:
After executing "wifi_set_sleep_type(MODEM_SLEEP_T) ", I could not see current consumption drops.
For example: before executing "wifi_set_sleep_type(MODEM_SLEEP_T)", ESP module consumes 72mA. After executing this function (manually triggered via UART), the current consumption is still 72mA. It should be 15mA according to the document.
5) Is it sufficient to just call "wifi_set_sleep_type(MODEM_SLEEP_T)" to let ESP module draw current to 15mA (rather than 72mA)?

Thanks

ESP_Alfred
Posts: 56
Joined: Mon Nov 10, 2014 7:31 pm

Re: HELP: UART Not Working & Clock Not Accurate after deep-sleep

Postby ESP_Alfred » Mon May 09, 2016 12:07 pm

hi,yangtao
1) How to fix the UART issue after deep-sleep?
> if you use add_low-power_deepsleep_cmd.py file to change your bin file, the UART couldn't print chip init logs. because UART FIFO is be cleaned in init process.

2) Does ESP8266's non-os sdk (1.5.2) change AHB clock/timer-clock in order to save power?
> In light sleep / deep sleep ,CPU doesn't work. Couldn't change AHB clock, but you could change CPU freq by call "system_update_cpu_freq" . But we not recommended to modify the frequency.
for your example, we will test.

3) How could I disable/enable Wi-Fi from user level application?
> You could call force sleep API to disable/enable Wi-Fi .

4) Is it possible to disable Wi-Fi in light-sleep mode?
> in light sleep the WI-FI have been closed.

5) Is it sufficient to just call "wifi_set_sleep_type(MODEM_SLEEP_T)" to let ESP module draw current to 15mA (rather than 72mA)?
> if you call auto sleep function , it is automatic that chip enter the sleep mode. notice, make sure in station mode and connect AP.

yangtao
Posts: 19
Joined: Tue Feb 02, 2016 3:03 pm

Re: HELP: UART Not Working & Clock Not Accurate after deep-sleep

Postby yangtao » Mon May 09, 2016 4:57 pm

Hi Alfred,

Thanks.

1) How to fix the UART issue after deep-sleep?
> if you use add_low-power_deepsleep_cmd.py file to change your bin file, the UART couldn't print chip init logs. because UART FIFO is be cleaned in init process.
[YT]: Yes. I am using "add_low-power_deepsleep_cmd.py" and generated low power configuration.

2) Does ESP8266's non-os sdk (1.5.2) change AHB clock/timer-clock in order to save power?
> In light sleep / deep sleep ,CPU doesn't work. Couldn't change AHB clock, but you could change CPU freq by call "system_update_cpu_freq" . But we not recommended to modify the frequency.
for your example, we will test.
[YT]: It doesn't work to change to other frequencies (example, 2MHz, 20MHz).

3) How could I disable/enable Wi-Fi from user level application?
> You could call force sleep API to disable/enable Wi-Fi .
[YT]: Looks already disabled, the current consumption is 17mA, which is still high.

4) Is it possible to disable Wi-Fi in light-sleep mode?
> in light sleep the WI-FI have been closed.
[YT]: OK

5) Is it sufficient to just call "wifi_set_sleep_type(MODEM_SLEEP_T)" to let ESP module draw current to 15mA (rather than 72mA)?
> if you call auto sleep function , it is automatic that chip enter the sleep mode. notice, make sure in station mode and connect AP.
[YT]: OK. BTW, my device is not connecting to any AP in normal operation mode. Looks this mode is not suitable to my device.


BTW, after configuring to Light-sleep mode, the device consumes 13mA, which should be <1mA.
I extracted those low-power control code as attached, could anybody help me to analyze it.
(Pressing "5" via uart to enable light-sleep mode -- uart baudrate: 74880)
Attachments
app_test_lowpower.zip
Issue on Light-sleep mode. Current consumption still high (13mA, rather than <1mA)
(348.99 KiB) Downloaded 185 times

Who is online

Users browsing this forum: No registered users and 9 guests