pycom / pycom-micropython-sigfox

A fork of MicroPython with the ESP32 port customized to run on Pycom's IoT multi-network modules.
MIT License
196 stars 167 forks source link

i2c.deinit() and increased deep-sleep current #87

Open dmartauz opened 6 years ago

dmartauz commented 6 years ago

While typical deep-sleep current of L01 is around 5uA, if machine.deepsleep() is called after i2c.init() followed by i2c.deinit(), the deep-sleep current is much higher - more that 30uA.

I found a workaround - to set SDA and SCL pins to Pin.IN before calling machine.deepsleep().

I guess this Pin re-initialization (or something similar) should be done within i2c.deinit()?

Issue is described in the Pycom forum as well: https://forum.pycom.io/topic/2008/i2c-deinit-and-machine-deepsleep-on-l01

jmarcelino commented 6 years ago

I noticed that the pull-ups don't get turned off on I2C.deinit(), the pins remain pulled-up.

May be related?