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

    Coreink power off not working?

    SOFTWARE
    2
    7
    5.2k
    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.
    • W
      wumfi
      last edited by wumfi

      Hi there,

      Just developed a neat little bit of code in UIFlow that performs various GETs on URLs, which in turn set off Alexa routines.

      It works perfectly, but I've run into a problem.

      After each URL is triggered, I want to power down the Coreink to save battery. The idea being, is that someone will power it on when they want to perform a function. However, using the Hardware --> Power --> Power off block doesn't seem to work. The function that it runs in works as expected, but the actual power off doesn't do anything. I'm still able to interact with the device.

      For now, what I've done is to change the "power off" block for an execute one, that runs machine.deepsleep().

      This does work, but it's obviously not powering down the device completely.

      Is there some magic that needs to be performed to get the "power off" block to work?

      This is how the function currently looks:

      0_1642025761927_FlowExample.png

      And the rendered MPython:

      def PowerDown():
        global ArrowPos
        txtTitle.setText(' Powered off')
        txtGreen.hide()
        txtOrange.hide()
        txtRed.hide()
        txtArrow.hide()
        txtPowerStatus.hide()
        coreInkSetHV(1)
        coreInkShow()
        wait(1)
        machine.deepsleep()
      

      If I change that machine.deepsleep() to power.off(), then the code keeps running!

      Any ideas?

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

        Hello @wumfi

        M5CoreInk power off only works when running from battery.

        Thanks
        Felix

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

        W 1 Reply Last reply Reply Quote 0
        • W
          wumfi @felmue
          last edited by

          @felmue Thanks, although that doesn't work either. Even when running from battery, the power off seems to be just ignored (the code carries on running).

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

            Hello @wumfi

            thank you for reporting back. I've just finished a project with my M5CoreInk (running from battery only) which shuts itself off at the end and that works fine. So I am not sure why it wouldn't work for you, sorry.

            Thanks
            Felix

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

            W 1 Reply Last reply Reply Quote 0
            • W
              wumfi @felmue
              last edited by

              @felmue Would you mind sharing your code? At least, the part that does the shutdown?

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

                Hello @wumfi

                sure. The example is a count down from 10 with a beep just before powering off. Hope it helps.

                Thanks
                Felix

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

                W 1 Reply Last reply Reply Quote 0
                • W
                  wumfi @felmue
                  last edited by

                  @felmue Well that's weird. Your code runs fine, and the unit powers off! I must have some screwy logic in mine somewhere. Thank you for your help.

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