ESP8266: Allow auto modem sleep if power off and sleep permitted #1184
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #1144.
Adds a 1ms delay only when main power is off and the
noWifiSleep
option is not active, and only for the ESP8266. This is needed for the automatic modem sleep to operate on the ESP8266 between DTIM beacons. The ESP32 appears to have a different mechanism, via theesp_wifi_set_ps()
API call, but that a problem for another issue/PR.I'm leaving this as a draft for now, until I've been able to test it for a few days for unforeseen side effects. ;)
To show the effect of this on my Wemos D1 Mini, I powered it via USB and put a calibrated power meter on it. The LED Strip and relay is still being powered via the main PSU.
Pre PR video - ~150ma continous
Post PR - rolling 90-120ma
Post PR - rolling 80-140ma - second meter