High current consumption in deep sleep: 80 mA



  • Hi, I'm testing GPy on deep sleep mode, and the current consumption is around 80 mA. I was expecting something in the uA range, do you know what's wrong?

    I'm invoking the deep sleep with:

    import machine
    
    machine.deepsleep(10000)
    

    I have a boot.py file with WiFi configuration. I'm using GPy v1.0.



  • @averri said in High current consumption in deep sleep: 80 mA:

    OSError: the requested operation failed
    

    We just mitigated this through [1] by invoking lte.deinit() with the "reset" operation like

    lte.deinit(detach=False, reset=True)
    

    [1] https://github.com/hiveeyes/hiveeyes-micropython-firmware/commit/ec7c80e1219fb119c2881a0019cecdfad220f29f



  • I'm having the same problem. When I arrive at home a will insert a SIM card and check if the current consumption decrease.

    Update:

    I have insert a SIM card. And make lte.deinit() and de current consumption in deepsleep drop to 0.022 mA.



  • @jcaron No, I don't have a SIM card. Is it possible to disable the LTE without the SIM card?



  • @averri Do you have a SIM card in the module? IIRC LTE.deinit() won't work without one.



  • @robert-hh The LTE deinit is not working, please see the message above.



  • It does not work. I'm using the following code:

    import pycom
    import time
    import json
    import machine
    from mqtt import MQTTClient
    from network import WLAN, LTE
    
    
    def sleep(millis):
        print('Going to sleep...')
        lte = LTE()
        lte.deinit()
        machine.deepsleep(millis)
    
    
    def handler(topic, data):
        print(topic, data)
        payload = json.loads(data.decode('utf-8'))
        msg = payload['msg'] if 'msg' in payload else None
        if msg == 'deepSleep':  # Here we enter deep sleep.
            sleep(10000)
    
    
    def connect_mqtt():
        """Connects to the MQTT queue."""
        print('Connecting to the MQTT server...')
        c = MQTTClient('alex-device', 'xxx', port=1883, user='xxx', password='xxx')
    
        c.set_callback(handler)
        c.connect()
    
        c.publish('inTest', 'Device connected!')
        c.subscribe('outTest')
    
        return c
    
    
    def wait_for_wlan():
        while True:
            if WLAN().mode() == WLAN.STA:
                break
            else:
                time.sleep(0.5)
    
    
    def main():
    
        wait_for_wlan()
    
        c = connect_mqtt()
    
        while True:
            time.sleep(0.5)
    
            # Check MQTT message.
            c.check_msg()
    
    
    if __name__ == '__main__':
        main()
    
    

    The result:

    Going to sleep...
    Traceback (most recent call last):
      File "main.py", line 112, in <module>
      File "main.py", line 95, in main
      File "mqtt.py", line 206, in check_msg
      File "mqtt.py", line 193, in wait_msg
      File "main.py", line 34, in handler
      File "main.py", line 15, in sleep
    OSError: the requested operation failed
    Pycom MicroPython 1.18.0.r1 [v1.8.6-849-9569a73] on 2018-07-20; GPy with ESP32
    Type "help()" for more information.
    


  • @averri You have to de-init the LTE modem.


Log in to reply
 

Pycom on Twitter