RAK11700 Apollo3 api.system.sleep.all corrupting LoRaWAN Send

I’m using RAK 11720 Apollo3 on Arduino for the 1st time (win10 - Arduino 2.2.1, Board RUI is v4.0.6 ) . The LoRaWAN example (when adjusted for US BAND and MASK) in the Arduino menu compiles fine and uploads and runs but the script apparently fails when sending data. The script serial output reports failed send attempts after the first send and the data does not arrive at my Chirpstack LNS.

I’m seeing that the problem is the sleep function between sends when using api.system.sleep.all( ms) that is called in the loop() function.

My temporary workaround is: replace api.system.sleep.all (int ms_time) with a delay(int ms_time).

Hello Peter,

I can see the same problem when using the example code from the BSP (I am on AS923-3), not sure why it doesn’t work. Pushing this to our R&D team to check.

In the meantime, maybe you can have a look at RUI3-LowPower-Example.
It is a different approach, instead of using loop() to sleep and send in intervals, it is using a timer to wake-up and send a packet. And in loop() it just calls sleep() to keep the MCU down when not needed.

I have found the same issue with mine. Even with the timer based system having api.system.sleep.all() in the main loop will cause issues with the send function.

Any progress on this from the R&D team? I currently don’t have a work around.

I am going to try older RUI3 versions and also have a go using a loop which calls api.system.sleep.all(1000); while your otaa period hasn’t been met. Pretty hacky and not ideal but I will try.

I have tried on an older version of RUI3 with the same result.

I have setup a loop using millis() which called api.system.sleep(1000); until I am ready to send a packet.

This seems to work but it is more difficult to get the timing right than using the RAK timers but also the device will briefly come out of sleep every second this way.

Sleep all seems to not allow the device to properly come out of sleep even when a timer is triggered. I tried calling api.system.sleep.cpu() and had the same result.

I also tried destroying the loop and using lpm set to 1 and had the same result again.

The only solution I have right now is to tell the device to sleep for a fixed amount of time which is quite clunky. Please let me know if there is something else I should try or if there is a solution.


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