Power consumption / wifi-information storage machine.deepsleep()
-
Hi @andy_n
I think the LTE modem isn't correctly going into deepsleep after the first time, we're investigating it. As a "debug" step you can try to add
lte = LTE() lte.deinit()to the end of your cycle. But note this is only for debug purposes, you shouldn't do it in production, instead it's better to let the modem handle it automatically.
Regarding storing WiFi information the easiest place is to have it on a file in /flash. You can use regular Python file operations to write and read data from it.
-
@jmarcelino How many write cycles can the pycom family internal flash handle?
I want to keep state on an SD card (pytrack), but that is not possible as the SD consumes too much power ... (on the next version can we power the SDCard off the 3v3_sensor rail that I understand powers down on sleep).
I would assume I write every minute. Which is 500K writes a year or so...
-
@gregcope With that volume of writes per year, and being powered by a battery, it is probably better to use a FRAM external memory (I2C or SPI).
FRAM read/write cycles are about 10^12 - 10^15 depending manufacturer and technology used. -
@gregcope
Pycom will support LittleFS for the internal filesystem soon (already in testing) which does wear levelling -
@marcobenini thanks
-
@jmarcelino will pycom support rtc memory soon, which i understand the ESPs have?
-
@gregcope
I think RTC RAM on the ESP32 gets cleared unless waking from deepsleep so it's less useful that one might think. -
@jmarcelino if the rtc memory is retained on deepsleep this is ideal for transient, but useful state.
If you want to keep persistence between resets i agree that internal flash is better.
If you want to keep data between deepsleeps, that may change allot (think temp readings like 21.9 - the decimal may change) rtc could be better.
Is supporting rtc memory on the roadmap?
-
@jmarcelino today i was able to add the code:
import time import machine from network import LTE i=True while i==True: print('nomal mode 15sec') time.sleep(15) i = False lte = LTE() lte.deinit() print('deepsleep mode 15sec') machine.deepsleep(15000)but it just runs the error:
>>> Running o:\Benutzerablagen\Nellis\Pycom GPY\ProjektTest\main.py >>> >>> >>> >>> nomal mode 15sec ╝Traceback (most recent call last): File "<stdin>", line 16, in <module> OSError: the requested operation failed ╝> MicroPython v1.8.6-849-83e2f7f on 2018-03-19; GPy with ESP32 Type "help()" for more information.Is there an other solution i could try?
-
@Andy_N said in Power consumption / wifi-information storage machine.deepsleep():
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