M5StickCPlus MicrPython power saving



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

    I was unable to get basics to work:

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

    Thanks


  • Global Moderator

    @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 my M5StickPlus 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 the Python tab.

    Thanks
    Felix