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

    M5.shutdown() not working on M5Paper

    Cores
    2
    2
    2.9k
    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.
    • S
      schedule display
      last edited by

      Re: M5Paper Shutdown() / Deep Sleep / Wakeup

      I am using M5Paper but M5.shutdown() is not working even the device is disconnected from the USB. The Loop still running and M5Paper still remains On.
      How to shutdown M5Paper and wake up again after specific time intervals?

      I am using the sample code from M5 Stack [https://docs.m5stack.com/en/api/m5paper/system_api](link url)

      #include <M5EPD.h>

      M5EPD_Canvas canvas(&M5.EPD);

      void setup()
      {
      M5.begin();
      M5.EPD.SetRotation(90);
      M5.TP.SetRotation(90);
      M5.EPD.Clear(true);
      M5.RTC.begin();
      canvas.createCanvas(540, 960);
      canvas.setTextSize(3);
      canvas.drawString("Press PWR Btn for sleep!", 45, 350);
      canvas.drawString("after 5 sec wakeup!", 70, 450);
      canvas.pushCanvas(0,0,UPDATE_MODE_DU4);
      }

      void loop()
      {
      if(M5.BtnP.wasPressed()){
      canvas.drawString("I'm going to sleep.zzzZZZ~", 45, 550);
      canvas.pushCanvas(0,0,UPDATE_MODE_DU4);
      delay(1000);
      gpio_hold_en((gpio_num_t) M5EPD_MAIN_PWR_PIN);
      gpio_deep_sleep_hold_en();
      M5.shutdown(5);
      }
      M5.update();
      delay(100);
      }

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

        Hello @schedule-display

        Have you tried the RTC example (w/o modifications)?

        In your code, why did you add the two gpio_xxx lines? I think they are the reason M5Paper cannot shutdown.

        Also this thread might be helpful.

        Thanks
        Felix

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

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