Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to implement low power LoRaWAN device using OTAA? #144

Open
wzab opened this issue Sep 17, 2020 · 3 comments
Open

How to implement low power LoRaWAN device using OTAA? #144

wzab opened this issue Sep 17, 2020 · 3 comments

Comments

@wzab
Copy link

wzab commented Sep 17, 2020

I need to implement a LoRaWAN device that sends a message every 10 minutes. To limit the power consumption I need to put the device to sleep between sending the messages.
If I use ABP, the problem can be solved easily with simple putting the CPU to sleep in the loop() function.
However such solution is not possible when using OTAA, as it breaks the timing,
I have checked the sources, and I can see that Arduino_LoRaWAN::loop()

void Arduino_LoRaWAN::loop()
calls the os_runloop_once routine from the underlying Arduino-LMIC library, and this routine calls hal_sleep() .
Unfortunately, the hal_sleep() function is currently not implemented .
Does it mean that if I need to implement a low-power LoRaWAN device I have to use ABP or I need to use another, not-MCCI LoraWAN library?

@wzab
Copy link
Author

wzab commented Sep 18, 2020

I have found that website. It requires me to use the low-level library, but seems to support the deep sleep mode.
The solution works nice, consuming ca. 100µA in the sleep state (probably mainly by the voltage regulator). There is however one serious disadvantage. If the device can't join the network (e.g., because there is no active gateway in the vicinity) , it remains all the time in the active mode and may drain the battery very quickly. Probably it is necessary to limit the number of the attempts to join the network, and in case of failure the device should go to sleep, and retry after e.g. half an hour.

@jdeus
Copy link

jdeus commented Sep 29, 2020

Yes these LMIC libraries are far from being usable. They lack key features such as saving the state to be restored when exiting a deep sleep.

Much work has to be done for this to be used in any serious application.

@postfalk
Copy link

postfalk commented Nov 2, 2020

It says "It provides a simple framework for doing low-power programming." in the documentation and never gets back to the topic. Documentation needs to be improved. This library is not user-friendly due to a lack of concise documentation. See also #143

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants