🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    M5paper battery or deep sleep issue

    Units
    2
    4
    3.5k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J
      Jack Drake
      last edited by

      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.

      1 Reply Last reply Reply Quote 0
      • felmueF
        felmue
        last edited by

        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

        GPIO translation table M5Stack / M5Core2
        Information about various M5Stack products.
        Code examples

        1 Reply Last reply Reply Quote 0
        • J
          Jack Drake
          last edited by

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

          1 Reply Last reply Reply Quote 0
          • felmueF
            felmue
            last edited by felmue

            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

            GPIO translation table M5Stack / M5Core2
            Information about various M5Stack products.
            Code examples

            1 Reply Last reply Reply Quote 1
            • First post
              Last post