Display on during deep sleep?



  • Currently, going into deep sleep (or even light sleep) shuts down the display. I was wondering how we can get the M5stack to go in deep sleep without powering off the LCD.

    Say I want to display something and then keep it on for a minute, during which I don't need any CPU/WiFi/BT/etc. functionality, so those can be powered down. After a minute the CPU should boot the sketch again as if it was rebooted/awaken.

    This behavior was possible if I attach my own LCD to the ESP8266 and I believe it is possible with the ESP32, but why does M5stack switch off the display if I only want to make the ESP sleep? I believe the LCD should power down only if I call M5.powerOFF() and not when I call esp_deep_sleep_start().

    TL;DR: how to enter deep sleep while keeping the LCD on?


  • M5Stack

    @m5er
    You can change powerOFF() function

    0_1549942187652_TIM截图20190212112833.png



  • @watson, thanks for the screenshot. However, this solution doesn't work. As mentioned in my original post, the problem is that esp_deep_sleep_start() itself turns off the display. So changing the powerOFF() function won't solve the problem.

    In fact, try this minimal sketch and see how sleeping turns off the display.

    #include <M5Stack.h>
    
    void setup(){  
      M5.begin();
      M5.Lcd.println("Setup");
    }
    
    void loop() {
      if(M5.BtnA.wasPressed()) {    
        // wake up after 5 seconds
        esp_sleep_enable_timer_wakeup(5000000); 
        // start deep sleep. Display goes out!
        esp_deep_sleep_start();  
      }
      M5.update();
    }
    

    Can we have the display on during deep sleep at all?


  • M5Stack

    Hello, @m5er ESP32 can enter 5 kinds of power saving modes. esp_deep_sleep_start(); means deep sleep mode. You can try the light sleep mode by using esp_light_sleep_start()

    0_1550050538952_TIM截图20190213173521.png

    You can refer to this article.
    https://docs.espressif.com/projects/esp-idf/en/latest/api-reference/system/sleep_modes.html

    Looking forward to your good news~



  • Thanks @watson. As I mentioned, I also tried with light sleep, but the display again turns off. Do you know of any command to put the ESP in sleep mode without turning off the display?



  • Is there a solution to this problem? I find it really strange that we can't have the display on during light/deep sleep. This harms all kinds of low-power applications that rely on a screen.


Log in to reply
 

Looks like your connection to M5Stack Community was lost, please wait while we try to reconnect.