Skip to content

ESP32-S3 simulated deep sleep does not activate when USB re-connected after running on battery #9898

Open
@samblenny

Description

@samblenny

CircuitPython version

Adafruit CircuitPython 9.2.1 on 2024-11-20; Adafruit Metro ESP32S3 with ESP32S3

Code/REPL

from alarm import exit_and_deep_sleep_until_alarms
from alarm.time import TimeAlarm
from time import monotonic

def main():
    # This will run each time the board wakes from deep sleep.
    print("I woke up")
    seconds = 8
    ta = TimeAlarm(monotonic_time=monotonic() + seconds)
    exit_and_deep_sleep_until_alarms(ta)

main()

Behavior

Steps to reproduce the problem:

  1. Run the code above as code.py on a Metro ESP32-S3 with charged battery pack connected (I suspect this might act the same for any S2 or S3 board with battery power, but I haven't tried it)
  2. In macOS, eject the CIRCUITPY drive (unmount for linux, etc)
  3. Unplug the USB cable, leaving the board powered by its battery
  4. Plug the USB port back in

After re-connecting the USB cable, the CIRCUITPY never shows up, and the USB serial device never shows up.

Description

If I reset the board, everything goes back to normal with CIRCUITPY and USB serial. But, I really don't want to reset the board because I'm trying to make a low cost data logger that uses alarm.sleep_memory instead of an SD card. A reset will clear the sleep memory, erasing the measurements.

Assuming I can get it working, my intended use case is:

  1. Plug in the board to charge the battery, set the clock, and start recording measurements
  2. Unplug the board, seal it up in a case, and move it to the location I want to monitor
  3. Wait a while
  4. Get the board, open the case, plug it back in, and dump the data over the serial port

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions