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 You have to de-init the LTE modem.
-
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. -
@robert-hh The LTE deinit is not working, please see the message above.
-
@averri Do you have a SIM card in the module? IIRC
LTE.deinit()won't work without one. -
@jcaron No, I don't have a SIM card. Is it possible to disable the LTE without the SIM card?
-
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.
-
@averri said in High current consumption in deep sleep: 80 mA:
OSError: the requested operation failedWe just mitigated this through [1] by invoking
lte.deinit()with the "reset" operation likelte.deinit(detach=False, reset=True)
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login