M5paper touchscreen wakeup from sleep



  • I'm looking to find out how to wakeup M5Paper from sleep(light or deep sleep) with the touchscreen. Some people say its possible and some say not. I have not find any solutions for this. I tried quite many things but nothing is working. Could someone help me on this?

    Currently i'm running a program that shows weather on the screen when deep sleeping and refreshes it every 30mins. If i push the side button down (GPIO 39) device wakeup from deep sleep and shows my touch screen home app that i can turn lights on and off. So i'm trying to replace the side button wakeup with touchscreen. A) Because Its quite hard to push the side button correctly B) it takes 5-7 secs to wakeup with this solutions. Also if someone is interested I get about 80 hours of battery on time with this solution.



  • Hello @Joonas

    Here is how I put my M5Paper into deep sleep with touch wake up:

    esp_sleep_enable_ext0_wakeup(GPIO_NUM_36, LOW); // TOUCH_INT
    gpio_hold_en(GPIO_NUM_2); // M5EPD_MAIN_PWR_PIN
    gpio_deep_sleep_hold_en();
    esp_deep_sleep_start();
    

    or light sleep with touch wake up:

    esp_sleep_enable_ext0_wakeup(GPIO_NUM_36, LOW); // TOUCH_INT
    esp_light_sleep_start();
    

    Thanks
    Felix



  • @felmue
    Big thanks. Now it works.
    I was missing the two lines "gpio_hold_en(GPIO_NUM_2);" & "gpio_deep_sleep_hold_en();" The other lines I already tried.

    Now i will keep testing to make the battery life and wakeup times better.



  • Hello @Joonas

    you are welcome. I am happy to hear you got it working to your liking.

    Cheers
    Felix



  • Hello @felmue
    With an M5Paper V1.1 and your code sample, I can't put the device in deep (instant reboot with RTC_IO wakeup cause) or light sleep. This works well with BTN_UP.
    Is there a difference with V1.0 that can explain this behavior or something I missed ?
    Thanks
    JC



  • Hello @jcl

    this issue happens with Arduino framework 1.0.5 and when WiFi is enabled before going to sleep. See here for possible work-a-round.

    Thanks
    Felix



  • @felmue - is latency between waking up from deep sleep is low enough to capture the same touch in main code (after wake up)?



  • Hello @kelcon

    yes, the main code can read the same touch which has caused the waking up since the touch IC stores the last touch coordinates for the main code to fetch it.

    Thanks
    Felix