FiPy deepsleep methods
-
@Gijs You should probably also update the first example at https://docs.pycom.io/tutorials/networks/lte/power/ then.
Can you also clarify whether the
time.sleepstatements are required?Also, even though you instantiate
LTE, you don't do much with it before going back to sleep. Did you try a full init-attach-connect-send-sleep cycle?I'm pretty sure many will want to know if this works for both NB-IOT and Cat-M1.
I think it would be great for someone at Pycom to take each and everyone of the tutorials and examples (IIRC there are examples here and there in the reference part of the documentation) and check that they indeed work as they should with the current versions (and ideally list for each "tested with version XXX", including both module and modem firmware versions where appropriate, and all relevant details to be able to reproduce the test). For all examples involving deep sleep, stating the resulting deep sleep current would be great.
The next step would then be prior to any new release to check that all those still work. Many tutorials and examples have gone awry over time.
That would probably one the biggest steps Pycom could take towards better QA. Quite some work and probably a full time job (or maybe several), but it would save soooo much time for all the people trying to reproduce examples that just don't work...
-
@jcaron Not to mention what to do when the deinit attempt causes an line "66 OSError: the requested operation failed"!
-
I'll answer the questions I can answer now, for the other ones I'll have to get back to you
Can you also clarify whether the time.sleep statements are required?
This is for me to determine when something is happening in the code during my power measurement and should allow to CTRL+C out of the deepsleep loop. I dont think it provides any other 'functionality'
Also, even though you instantiate LTE, you don't do much with it before going back to sleep. Did you try a full init-attach-connect-send-sleep cycle?
I did not, mainly because I couldn't come by any simcard at the time of measuring. Though I believe it should make no difference in the end result per the workings of
lte.deinit(reset=True)I'm pretty sure many will want to know if this works for both NB-IOT and Cat-M1.
Yes, I understand. At the moment I cannot be conclusive about this, as there are some dissimilarities between the firmwares. We're working on gathering operational current measurements to publish in the docs that should be reproducable, but its taking some more time than expected.
I think it would be great for someone at Pycom to take each and everyone of the tutorials and examples (IIRC there are examples here and there in the reference part of the documentation) and check that they indeed work as they should with the current versions (and ideally list for each "tested with version XXX", including both module and modem firmware versions where appropriate, and all relevant details to be able to reproduce the test). For all examples involving deep sleep, stating the resulting deep sleep current would be great.
I totally agree. All examples should work with the latest (stable) firmware. At the moment we're thinking about syncing the examples in the docs to a github repository (just like how it used to be in the pycom-libraries repo), so that when the repo is updated, the examples automatically update in the docs. Though we were not able to find a system yet.
66 OSError: the requested operation failed
This is something I'll have to look into again, but things keep coming up :(
-
Hey @frederik-Leys, the LoPy does not have an LTE Modem so
lte = LTE()should be have no effect on LoPy but und FiPy it should start the modem.Change your code to:
import pycom import machine import time from network import LTE from network import WLAN wlan = WLAN() lte = LTE() time.sleep(5) lte.init() wlan.deinit() pycom.heartbeat(False) print(pycom.heartbeat_on_boot()) print(pycom.lte_modem_en_on_boot()) print(pycom.pybytes_on_boot()) print(pycom.smart_config_on_boot()) print(pycom.wdt_on_boot()) print(pycom.wifi_on_boot()) #colors in hexadecimal (0xRRGGBB) pycom.rgbled(0x00FF00) # Red time.sleep(1) lte.deinit() machine.deepsleep(40*1000)To get in uA range. Or let it run in powersave mode like:
import pycom import machine import time from network import LTE from network import WLAN wlan = WLAN() lte = LTE(psm_period_value=1, psm_period_unit=LTE.PSM_PERIOD_1H, psm_active_value=5, psm_active_unit=LTE.PSM_ACTIVE_2S ) print(lte.psm()) time.sleep(5) lte.init() wlan.deinit() pycom.heartbeat(False) print(pycom.heartbeat_on_boot()) print(pycom.lte_modem_en_on_boot()) print(pycom.pybytes_on_boot()) print(pycom.smart_config_on_boot()) print(pycom.wdt_on_boot()) print(pycom.wifi_on_boot()) #colors in hexadecimal (0xRRGGBB) pycom.rgbled(0x00FF00) # Red time.sleep(1) lte.deinit(detach=False, reset=False) machine.deepsleep(40*1000)which brought me to 300uA.
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