Wisblock low power best practices

Goog morning,

I am developing a project with Wisblock with: RAK4631, RAK1904, RAK1906, RAK5801, RAK15007 and RAK12500.

Now I am redesigning the super loop architecture code to a event driven architecture with low power target.

Do you have a kind of “Wisblock low power best practices guide” ?



I don’t have such a guide as a written document or post.

My own “standard” for low power RAK4631 is my WisBlock-API-V2

  • utilize FreeRTOS semaphores to stop loop() {task} when not required
  • use timers for wakeup to do regular tasks
  • use external events/interrupts for wakeup when required

Wakeup events are defined (up to 9 possible different user defined events)
Events are waking up the loop by using sempahores and the event flag
Loop is stopped by waiting for a semaphore, then checks what event released the semaphore and calls user application to handle the events
Loop is handling events one by one until no more pending events are available

I put LoRa/LoRaWAN handling, BLE handling and an AT command interface into my API.

Usually I start a new application from Low-Power-PIO and add what ever I need to it.

What confuses many people is that they don’t have a setup() and loop() anymore.
Instead they have two setup functions, the first one called before LoRa/LoRaWAN setup, the second one after the API is fully setup.
And the loop is replaced with the app_event_handler which is only called when an event happened that it has to handle.

Most of my example codes are now based on this event driven model.

Well, this is for Arduino based applications.

For RUI3, I started to share some examples in RUI3 Best Practice

Thank you by your support, as always you are “the guy:slight_smile:



This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.