Excessive power draw in deepsleep under certain circumstances in esp32

Open
#5,418 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python

Research direction

Start by reproducing the reported interaction between network.WLAN.scan(), esp32.wake_on_ext0(), and machine.deepsleep() using the supplied ESP32 script and current-draw measurements. Trace the ESP32 deep-sleep, wake-source, and networking entry points, then confirm that the reported configuration reaches the expected low sleep current without regressing the wake behavior.

Written by the indexing model from the issue text.

Description

port-esp32 proposed-close

This one is pretty obscure, but I might as well report it after isolating it this far...

We have been running a bare ESP32 (no regulators or populated breakout board) from a power supply that measures current draw very accurately.

If you run the following, then the 3 seconds of deepsleep will be drawing a consistent 1.4mA:

import machine, network, esp32
w = network.WLAN()
w.active(1)
w.scan()
p = machine.Pin(2, machine.Pin.IN, machine.Pin.PULL_DOWN)
esp32.wake_on_ext0(p, esp32.WAKEUP_ANY_HIGH)
#w.active(0)
machine.deepsleep(3000)

However, if you comment line 4, or comment line 6, or uncomment line 7, then the current draw reverts to 0.006mA during the deepsleep duration, which is well within the parameters of the datasheet.

I don't know how these two factors could be interacting in this way, but they are.

(My application is an esp32 running from a battery and being woken by a change in a rocker switch, whereupon it connects to the wifi and reports the state. I can report that if the rocker switch is closed so that the condition is instead esp32.wake_on_ext0(p, esp32.WAKEUP_ALL_LOW) then the current draw is 0.086mA, which corresponds to internal pull-down resistors of about 40kOhms.)

Dominant language
C
Stars
22.1k
Forks
9k
Avg merge
6d 4h
Merged PRs (30d)
16

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from micropython/micropython

All issues in micropython/micropython

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.