M5paper battery or deep sleep issue



  • I've created a piece of code receiving some sensors states with mqtt and publish m5paper temperature and battery voltage via mqtt to home assistant. To keep the m5 awake I run a simple loop:

    hile True:
    wait(30)
    m5mqtt.publish(str('temp_nebeneingang'),str((sht30.temperature)))
    m5mqtt.publish(str('battery_m5paper'),str((bat.voltage())))

    So far so good, but in case I run this on battery after about 2h the m5 stops working showing the last display. During this timeframe battery voltage reported went down from 4900 to 3200 within 2,5 hours.
    What I'm unsure about: Is the m5 going to deepsleep and not responding anymore or is the battery really empty after this short timeframe?
    Even pressing the reset button doesn't evoke anything, only connecting usb power again.



  • Hello @Jack-Drake

    M5Paper, or any other device using an ESP32 for that matter, is not automatically going to deep sleep. Your program needs to tell the ESP32 to go into deep sleep. Use a command like this:

    machine.deepsleep(20000)
    

    this puts the ESP32 into deep sleep for 20 seconds.

    Thanks
    Felix



  • Hi, thanks for you fast reply. Sounds like I need to play a little bit around with deep sleep to avoid fast battery drain.



  • Hello @Jack-Drake

    a while ago I made some measurements for the M5Paper regarding light and deep sleep. You can find them here.

    Thanks
    Felix