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

    Power on via RTC timer example

    Core 2
    2
    5
    7.4k
    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.
    • felmueF
      felmue
      last edited by felmue

      Hi guys

      Recently, while looking at the M5Core2 schematic, I realised that the fine M5Stack engineers connected the RTC interrupt output to the power key input of the AXP192. This means the RTC IC can power on a fully shutdown M5Core2 by either using a timer or an alarm.

      I've put together an example showing how to setup an RTC timer to power on the system.

      Cheers
      Felix

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

      1 Reply Last reply Reply Quote 1
      • ZontexZ
        Zontex
        last edited by

        Hi @felmue, Tested your code on M5Core2 works perfectly fine - it can also work with deep sleep function not just the normal sleep mode, I merged it with our master repository, thank you for your contribution!

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

          Hello @Zontex

          cool, thanks.

          Regarding deep sleep: I don't think it works as expected. When I call M5.Axp.DeepSleep(1000 * 1000 * 2); I'd expect the system to restart from deep sleep after about 2 seconds, but instead the system shuts down completely and never wakes up again from deep sleep.

          The reason I think is that SetSleep() turns off power to the ESP32 IC and therefore line (time_in_us == 0) ? esp_deep_sleep_start() : esp_deep_sleep(time_in_us); is never executed and the system never goes into deep sleep but is shutdown completely.

          Note: If I comment out SetSleep() then deep sleep works as expected.

          I've submitted a issue for the deep sleep issue: https://github.com/m5stack/M5Core2/issues/17

          Thanks
          Felix

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

          ZontexZ 1 Reply Last reply Reply Quote 1
          • ZontexZ
            Zontex @felmue
            last edited by

            @felmue I'll have a look into this issue, I only tested the commented out version and it worked fine but if it's not commented out it does as you say, will look into it.

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

              Hi @Zontex

              thank you for looking into it, I appreciate it. Please let me know if there is anything I can help with or test.

              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