Different power consumption in sleep-modes !?
Moderators: grovkillen, Stuntteam, TD-er
Different power consumption in sleep-modes !?
Hardware: ESP-01 without power-led for my battery-powered window-contact. Wakeup only via RST.
Software: ESP_Easy_mega-20191208_normal_ESP8266_1M_VCC.bin (same with older versions)
If I configure the DeepSleep via 'Config/Sleep Awake Time', the ESP-01 goes into DeepSleep and need less than 20µA. All Ok.
Now I'll use the rules to publish some values and then go to DeepSleep with the Command 'DeepSleep,1' (zero doesn't work). The parameter 'Config/Sleep Awake Time' is reset to 0 and the rule put the ESP-01 to DeepSleep after some seconds. But the power consumption is ~13mA ! That's factor 650 more...
Is there a problem with the DeepSleep-command ???
Software: ESP_Easy_mega-20191208_normal_ESP8266_1M_VCC.bin (same with older versions)
If I configure the DeepSleep via 'Config/Sleep Awake Time', the ESP-01 goes into DeepSleep and need less than 20µA. All Ok.
Now I'll use the rules to publish some values and then go to DeepSleep with the Command 'DeepSleep,1' (zero doesn't work). The parameter 'Config/Sleep Awake Time' is reset to 0 and the rule put the ESP-01 to DeepSleep after some seconds. But the power consumption is ~13mA ! That's factor 650 more...
Is there a problem with the DeepSleep-command ???
Re: Different power consumption in sleep-modes !?
Sébastien - espRFLinkMQTT gateway RFLink MQTT on esp
Re: Different power consumption in sleep-modes !?
If you want something really efficient for a door contact, you need to add an attiny13 or use another protocol (zigbee for example).
Sébastien - espRFLinkMQTT gateway RFLink MQTT on esp
Re: Different power consumption in sleep-modes !?
Yes, I know that. But the GPIO-16 is NOT connected to RST ! So it doesn't matter, if it sleep 1s or more... The ESP didn't wake up, that's sure.
And with the DeepSleep from the config-page, my two AA-batteries reach ~ 1 year, before I must change it. Without ATtiny13.
I assumed the command would do an identical DeepSleep, like the DeepSleep-configuration from the config-page.
And with the DeepSleep from the config-page, my two AA-batteries reach ~ 1 year, before I must change it. Without ATtiny13.
I assumed the command would do an identical DeepSleep, like the DeepSleep-configuration from the config-page.
Re: Different power consumption in sleep-modes !?
Maybe the ESP doesn't wake up, but the timer will trigger an alarm to wake up and I am not sure if that pulse will trigger every second, or maybe remains triggered.
What you can do is use an FET to power the ESP.
Connect the switch to trigger it over the FET and set a pin that's pulled up (e.g. GPIO2) to the gate.
Then the ESP will draw almost nothing when off (as little as the leaking current of the FET) and to let the ESP switch itself off, draw the GPIO pin low.
See for example: https://electronics.stackexchange.com/q ... th-esp8266
And a very nice tutorial on transistors: https://www.youtube.com/watch?v=Kvl-mR5gldw
N.B. by switching off like this, you will loose RTC information, so connecting to wifi may take a bit more time and you cannot refer to sensor values from before switching off.
What you can do is use an FET to power the ESP.
Connect the switch to trigger it over the FET and set a pin that's pulled up (e.g. GPIO2) to the gate.
Then the ESP will draw almost nothing when off (as little as the leaking current of the FET) and to let the ESP switch itself off, draw the GPIO pin low.
See for example: https://electronics.stackexchange.com/q ... th-esp8266
And a very nice tutorial on transistors: https://www.youtube.com/watch?v=Kvl-mR5gldw
N.B. by switching off like this, you will loose RTC information, so connecting to wifi may take a bit more time and you cannot refer to sensor values from before switching off.
Re: Different power consumption in sleep-modes !?
Nice idea with the FET-schematic....
But back to the real problem:
There is no difference between the comands "DeepSleep,1" and "DeepSleep,300" ! All over the (sleep-) time, the ESP needs 10-13mA. If you were right, it should be less in the second case, until the timer ends.
It appears, the ESP goes into a different sleep mode with the rule commands. Either because a timer is running or some other components (CPU, RTC, WIFI) are not disabled.
But back to the real problem:
There is no difference between the comands "DeepSleep,1" and "DeepSleep,300" ! All over the (sleep-) time, the ESP needs 10-13mA. If you were right, it should be less in the second case, until the timer ends.
It appears, the ESP goes into a different sleep mode with the rule commands. Either because a timer is running or some other components (CPU, RTC, WIFI) are not disabled.
Re: Different power consumption in sleep-modes !?
I was thinking about this.
What if the sensors are indeed not put into some sleep mode, so not the ESP is to blame, but some of the sensors.
Can you test it with a unit without any external sensor connected?
What if the sensors are indeed not put into some sleep mode, so not the ESP is to blame, but some of the sensors.
Can you test it with a unit without any external sensor connected?
Re: Different power consumption in sleep-modes !?
The ESP has no other sensors. Only two reed-contacts, one for the RST and one for close position.
And between the current-measuring-tests, I've nothing changed on the wiring. Here's the schematic:
And between the current-measuring-tests, I've nothing changed on the wiring. Here's the schematic:
Re: Different power consumption in sleep-modes !?
Sorry, my mistake (The second test-esp01 has a additional resistor at GPIO16). You're right!
While the sleeptime from the deepsleep-command, the ESP needs only ~20µA. But when the sleeptime is over, he needs ~13mA, forever... !
Then I'll have to wait, until the command 'DeepSleep,0' works.
Re: Different power consumption in sleep-modes !?
Can you measure what happens on GPIO16 after the sleep time is over?
I will have a look at the code to see what is the difference between going to sleep using the command and when it goes into deep sleep as interval.
What version are you running?
I thought I had changed something like this a few months ago, but apparently not enough?
I will have a look at the code to see what is the difference between going to sleep using the command and when it goes into deep sleep as interval.
What version are you running?
I thought I had changed something like this a few months ago, but apparently not enough?
Re: Different power consumption in sleep-modes !?
Perhaps the serial log's Info Level will provide some useful information. That is to say, compare the sleep messages that appear during Config/Sleep Awake Time versus those you see in the Command DeepSleep. If they are different then post the logs for review.
- Thomas
Good idea. FWIW, the logs will also report if GPIO16 has canceled/disabled the sleep operation. It is reported as:Can you measure what happens on GPIO16 after the sleep time is over?
Code: Select all
SLEEP: Deep sleep cancelled (GPIO16 connected to GND)
Re: Different power consumption in sleep-modes !?
I have noticed 2 differences in deep sleep behavior between normal deep sleep and when called from a command:
- Deep sleep from a command directly calls
- Deep sleep via the regular interval does only call deep sleep at the end of and it also does a check whether deep sleep is enabled.
The check for enabled deep sleep does:
- return false when deep sleep awake time is set to 0
- return false if GPIO-16 is low (by enabling pull up resistor on GPIO-16)
- else return true.
So maybe we should just keep track of a flag in memory which can be set from the rules command.
In this check for enabled deep sleep, we then need to have a look at this flag, which only will be set via this command.
Then the execution of going to sleep is exactly the same as when doing the regular sleep.
- Deep sleep from a command directly calls
Code: Select all
void deepSleepStart(int dsdelay)
Code: Select all
loop()
The check for enabled deep sleep does:
- return false when deep sleep awake time is set to 0
- return false if GPIO-16 is low (by enabling pull up resistor on GPIO-16)
- else return true.
So maybe we should just keep track of a flag in memory which can be set from the rules command.
In this check for enabled deep sleep, we then need to have a look at this flag, which only will be set via this command.
Then the execution of going to sleep is exactly the same as when doing the regular sleep.
Re: Different power consumption in sleep-modes !?
When sleep-time (from command deepsleep,xxx) is over, the voltage level goes from ~Vcc to GND and stay there. That seems ok, because it should normally reset via RST (not wired in my circuit). But in this state, the ESP needs to much energy
Re: Different power consumption in sleep-modes !?
So during sleep it does consume the expected low current (roughly 60 uA) and after this the energy consumption rises even when the node does not boot?
This means we need to make the deep sleep command act the same as the regular deep sleep.
This means we need to make the deep sleep command act the same as the regular deep sleep.
Re: Different power consumption in sleep-modes !?
I'll bring the thread up again.
The problem, that the deepsleep of my ESP-01 uses ~12mA instead of correctly ~20µA, is now (tested firmware ESP_Easy_mega_20210223 and the current sourcecode from GIT) always present, DeepSleep via Config-page and via 'DeepSleep,0'-command.
A test with a firmware 'ESP_Easy_mega_20191104_normal_ESP8266_1M_VCC.bin' (on the same ESP-01, with the identical wiring), shows that it works fine there (a 'DeepSleep,0'-command was still missing in this version).
I'm just looking for the reason and which is the last working version.... More later.
The problem, that the deepsleep of my ESP-01 uses ~12mA instead of correctly ~20µA, is now (tested firmware ESP_Easy_mega_20210223 and the current sourcecode from GIT) always present, DeepSleep via Config-page and via 'DeepSleep,0'-command.
A test with a firmware 'ESP_Easy_mega_20191104_normal_ESP8266_1M_VCC.bin' (on the same ESP-01, with the identical wiring), shows that it works fine there (a 'DeepSleep,0'-command was still missing in this version).
I'm just looking for the reason and which is the last working version.... More later.
Re: Different power consumption in sleep-modes !?
The current code used to enter deep sleep is based on this (lengthy) discussion: https://github.com/esp8266/Arduino/issu ... -711389479
Maybe this fix does only work on ESP12E/F/S boards and not on your ESP-01?
See: https://github.com/letscontrolit/ESPEas ... #L126-L172
Maybe you can test with inverting the check for
into:
This way you are using the "old" way again. (also limiting the max. deepsleep to 71 minutes)
Maybe this fix does only work on ESP12E/F/S boards and not on your ESP-01?
See: https://github.com/letscontrolit/ESPEas ... #L126-L172
Maybe you can test with inverting the check for
Code: Select all
# if defined(CORE_POST_2_5_0)
Code: Select all
# if !defined(CORE_POST_2_5_0)
This way you are using the "old" way again. (also limiting the max. deepsleep to 71 minutes)
Re: Different power consumption in sleep-modes !?
Info: In the firmware 'ESP_Easy_mega_20200608_normal_ESP8266_1M_VCC' works both, 'Sleep awake time' on config page and 'DeepSleep,0'-command.
I'll test your hint with the inverted check later today and report the results here.
I'll test your hint with the inverted check later today and report the results here.
Re: Different power consumption in sleep-modes !?
With the inverted check
the firmware works as expected. Both ('Sleep awake time' on config page and 'DeepSleep,0'-command) results in a power consumption of ~20µA
Can we modify the firmware, so that DeepSleep works properly on all ESP's ?
I'll test and measure some other ESP-models (Wroom-02, ESP12F) tomorrow.
Code: Select all
# if !defined(CORE_POST_2_5_0)
Can we modify the firmware, so that DeepSleep works properly on all ESP's ?
I'll test and measure some other ESP-models (Wroom-02, ESP12F) tomorrow.
Re: Different power consumption in sleep-modes !?
If you can test units with an ESP12E/F/S then please let me know the standby currents.
I can make a define to use it and set it in the platformio.ini file for those platforms that need it.
I can make a define to use it and set it in the platformio.ini file for those platforms that need it.
Re: Different power consumption in sleep-modes !?
All tested units show the same behavior!
With the current GIT-source and the firmware release 20210223 I've measure the following DeepSleep-current:
ESP12F: 9,6mA
Wroom02: 10,8mA
With the modified (negated if-clause) DeepSleep.cpp, the DeepSleep-current sink to the following values:
ESP12F: 18µA
Wroom02: 15µA
All tests are with: 'Sleep awake time'=60, 'Sleep time'=0 and Vcc=3,3V.
With the current GIT-source and the firmware release 20210223 I've measure the following DeepSleep-current:
ESP12F: 9,6mA
Wroom02: 10,8mA
With the modified (negated if-clause) DeepSleep.cpp, the DeepSleep-current sink to the following values:
ESP12F: 18µA
Wroom02: 15µA
All tests are with: 'Sleep awake time'=60, 'Sleep time'=0 and Vcc=3,3V.
Re: Different power consumption in sleep-modes !?
OK, that does sound like I need to revert it.
Do you happen to have any units with "DOIOT" on the metallic cap?
Or maybe a Wemos D1 mini clone with the ESP soldered on the PCB without any metallic cap?
Do you happen to have any units with "DOIOT" on the metallic cap?
Or maybe a Wemos D1 mini clone with the ESP soldered on the PCB without any metallic cap?
Re: Different power consumption in sleep-modes !?
No, I don't have any of these ESP's.
Edit: I've created a issue on GitHub: https://github.com/letscontrolit/ESPEasy/issues/3556
Edit: I've created a issue on GitHub: https://github.com/letscontrolit/ESPEasy/issues/3556
Re: Different power consumption in sleep-modes !?
Hi, I don't know if it is the right place to ask the following question: When using DeepSleep (ESPEasy_ESP82xx_mega-20210503.zip) with Sleep awake time=20 and Sleep time= 7200, the real sleep time is less than one hour.
I tried to change sleep time to 9000 or 12000. No change. The max sleep time stays shorter than expected.
Any idea?
This behaviour is also true when I call DeepSleep from a rule (command).
When in deep sleep, power is 18 µA (normal).
Many thanks
I tried to change sleep time to 9000 or 12000. No change. The max sleep time stays shorter than expected.
Any idea?
This behaviour is also true when I call DeepSleep from a rule (command).
When in deep sleep, power is 18 µA (normal).
Many thanks
Re: Different power consumption in sleep-modes !?
I did revert the code that was added a few months ago to put the ESP in deep sleep.
It is not yet included in a nightly build yet, but I did create a build for another PR yesterday which does have this code present:
https://www.dropbox.com/s/c6rdpo58spjna ... M.bin?dl=0
Maybe you can test to see if this also affects the deep sleep duration?
Make sure the "Deep Sleep Alternative" checkbox on the tools->Advanced page is unchecked.
See: https://espeasy.readthedocs.io/en/lates ... lternative
It is not yet included in a nightly build yet, but I did create a build for another PR yesterday which does have this code present:
https://www.dropbox.com/s/c6rdpo58spjna ... M.bin?dl=0
Maybe you can test to see if this also affects the deep sleep duration?
Make sure the "Deep Sleep Alternative" checkbox on the tools->Advanced page is unchecked.
See: https://espeasy.readthedocs.io/en/lates ... lternative
Who is online
Users browsing this forum: No registered users and 45 guests