i2c.deinit() and machine.deepsleep() on L01
-
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()?
-
Guys, thanks for the valuable input. We will create the "best practices for deepsleep" section in the docs and also improve the behaviour of the deinit() methods.
Cheers,
Daniel
-
@robert-hh
That's true and would be good to work out some "best practices" guide for the real deep sleep mode (not the deepsleep shield stuff).In any case I feel the internal pull-ups should be turned off after I2C.deinit() and they are not at the moment, the pins remain pulled up which may cause confusion - and perhaps higher current draw.
-
@jmarcelino
I created new issue on GitHub:
https://github.com/pycom/pycom-micropython-sigfox/issues/87
-
@jmarcelino @danielm Setting the pins to input (high impedance) is a good low power state. If the pin set to output mode, it depends on the connected device how much current is drawn.
-
@danielm
Good find.I suspect it's because the pullups aren't being disabled by I2C.deinit() - a more serious problem in itself.
Can you open a new issue at https://github.com/pycom/pycom-micropython-sigfox/issues and refer to this thread please so it gets tracked properly ? If you prefer I can open it for you.
Thanks