M5StickCPlus MicrPython power saving
-
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
-
@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.
-
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 -
Hi @felmue,
Unfortunately on myM5StickPlus axp.setLcdBrightness(50)
gives an error.Maybe it has different MicroPython hardware APIs than your device?
-
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 thePython
tab.Thanks
Felix