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

    M5StickCPlus MicrPython power saving

    Micropython
    3
    5
    6.8k
    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
      WonkoTheSane
      last edited by

      Hi,
      Which MicroPython APIs can help reduce power drain on M5StickCPlus?

      I was unable to get basics to work:

      • lcd.setBrightness(0-100) # didn't change LCD backlight brightnes
      • power.getBatteryLevel() # didn't seam to work
      • No API to turn off wifi mentioned at: https://github.com/m5stack/UIFlow-Code/wiki/Advanced - does this work: wifiCfg.wlan_sta.active(False)

      Are there other APIs to turn on/off parts of device , or to reduce power drain?

      Thanks

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

        @wonkothesane Hi, Usually what you can do is depends on your task to put your ESP32 device into deep sleep mode which will automatically turn off WiFi and other power consuming devices on top of the Stick-C.

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

          Hello @WonkoTheSane

          try the following commands:

          from m5stack import *
          import machine
          
          axp.setLcdBrightness(50) # set LCD backlight brightness
          axp.getBatVoltage() # get battery voltage
          
          machine.deepsleep(10000) # deep sleep for 10 seconds
          machine.lightsleep(10000) # light sleep for 10 seconds
          

          about WiFi: I don't know how to turn WiFi off with MircoPython, sorry. Somebody else might have an idea?

          Cheers
          Felix

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

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

            Hi @felmue,
            Unfortunately on my M5StickPlus axp.setLcdBrightness(50) gives an error.

            Maybe it has different MicroPython hardware APIs than your device?

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

              Hello @WonkoTheSane

              Hmm, did you include the line from m5stack import *?

              I have UIFlow 1.6.6 firmware installed on my M5StickC Plus and use Blockly's Set screen brightness block then switched to the Python tab.

              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