Some questions about power

  • I've nearly completed my project on M5Paper, with thanks to the people on this forum who've helped me over many hurdles. The crucial last aspect is to get it running as long as possible on battery.

    Basically my project loads about 5 days worth of data from an internet resource; and then should update a display based on this data every 10 minutes or so.

    My original intention (based on this line in the product description "battery life can be further preserved by using the RTC to set the device into deep sleep and wake it up again when needed") was that it could shut down completely, leaving the display intact; wake up every 10 minutes to update just a bit of the display; and every 4-5 days refresh the data feed.

    However, it now appears that using the shutdown function with a time delay actually reboots the device when the time expires, rather than just waking up.

    Q1: Is that correct, or have I missed an option that will to shut down everything except the RTC, but preserve state so that it doesn't reboot on wake up?

    The second issue is that I don't want the display flashing every 10 minutes; it's an essential aspect of this project that the display should be discreet. Hence I only want to make small updates to the display every 10 minutes; larger updates every six hours or so.

    From experiments, it's evident that the basic arduino 'delay' function makes little or no difference to power consumption.

    I understand from the data on @felmue's info page and from this forum post that it should be possible to use either "light sleep" or "deep sleep". But (a) I've not been able to figure out the code for this and (b) I'm not clear from these sources whether I need to make a hardware modification before it is safe (and effective?) to use these functions. (I'm using an M5Paper V1.1.)

    Q2: Is deep sleep my next best option to conserve power between updates, without causing massive screen blink?

    Q3: Do I need to make a hardware modification in order to access this?

    Finally, if I indeed I can get somewhere with the rest of this, I'm thinking that I'll do a completely shutdown for six hours or so in the middle of the night. That will probably mean reloading the data every 24 hours instead of every 4-5 days.

    Q4: If I shut down the wifi immediately after loading data; is the power required to start up the wifi, find the access point, load the data etc more often significant? Or is the power draw of the device as a whole remain fairly steady regardless of whether the wifi is on? If I do shutdown every night, is it worth writing the data to SPIFFS so that it can recover it locally after rebooting, rather than getting it from the internet each time?

    TIA for answers to any or all of these questions!

  • Hello @Hamnet

    A1: that is correct, after a shutdown, M5Paper always reboots

    A2: after deep sleep, M5Paper always reboots (only after light sleep the code continues to execute, e.g. no reboot)

    A3: no, the best option to conserve power is using the shutdown function

    A4: hard to tell, you probably have to try out different scenarios and observe for each how long a full battery charge lasts

    I found this Weather Station example which uses the shutdown mode, downloads data using WiFi from time to time with a full screen refresh and does a partly screen update with local data in a shorter interval.


  • Thank you Felix. Disappointing that all the substantial sleep modes cause a reboot!

    My remaining question then is about how to enter light sleep.

    I found your post here from two years ago. And this post. There was also this, which is not M5 specific.

    From these I think that I need to do something like this:

      // then this??
     // or this??
     esp_sleep_enable_timer_wakeup(5 * 1000 * 1000);

    Can you clear up my confusion? And (for light sleep) do I need to do anything special with GPIO settings, which I can see from some of your earlier notes?

    thanks again.

  • Hello @Hamnet

    the M5Paper doesn't have an AXP chip therefore we need to call the ESP sleep functions directly like this:

     esp_sleep_enable_timer_wakeup(5 * 1000 * 1000);

    And no, for light sleep no extra GPIO settings should be needed. AFAIK those are only required for deep sleep.


  • Hi, do you know the exact command in Micropython ?
    Seems that machine.lightspleep(60000) works only if battery is charging and doesn't when the M5paper is away from USB....

    Have you ever encountered this problem, and how did you solve it?

  • Hello @democrazia

    check out my solution here.


  • Hello felix,

    seems to work, thanks.
    Will see how long m5paper could work without charge.