machine.idle()



  • I am trying to get a LoPy into a low power mode using machine.idle() but not getting any results.

    The Lopy is on a breadboard. It is powered from a bench supply at 5V via a multimeter measuring current, and the only thing connected to it is a FTDI cable for comms. Both boot.py and main.py are blank so it is a minimal system.

    Once at the repl prompt I am drawing about 95mA.
    If I try machine.idle() I see no difference, still 95mA.

    The documentation for machine.idle() suggests there may be a system timer interrupt every millisecond. I assume this is true, so try:
    while True:
    machine.idle()
    but my current draw rises to 106mA.

    Am I doing something wrong?
    Is there any example code of how to use machine.idle() so I can actually see a decrease in current draw?
    What figures should I expect?
    I have also tried disabling the wifi radio with no effect.

    uos.uname gives:
    (sysname='LoPy', nodename='LoPy', release='1.11.0.b1', version='2ac6da2 on 2017-12-18', machine='LoPy with ESP32', lorawan='1.0.0')



  • OK. Thanks for your help.



  • @theozed
    All current Pycom devices



  • Thanks. I must have made a mistake when originally trying to turn off the wifi radio. No I draw about 37mA with the wifi off.

    When you say machine.idle() doesn't reduce power on this platform, what do mean by platform? All Pycom devices, or just LoPy devices?



  • @theozed
    machine.idle() doesn’t currently reduce power draw on this platform.

    However disabling WLAN will make a big difference, make sure you’re using the WLAN.deinit() function:

    from network import WLAN
    wlan = WLAN()
    wlan.denit()


Log in to reply
 

Pycom on Twitter

Looks like your connection to Pycom Forum was lost, please wait while we try to reconnect.