My current issue is:
After sending the payload I wait for the “SendCallback” and go to Sleep. It works most of the times. But, when the extra +EVT:TX_DONE comes it wakes the system up!
I haven’t found a way to detect this and prevent the system from being waked up.
Please, how to handle this extra +EVT:TX_DONE ?
You cannot handle the +EVT:TX_DONE message, it is generated automatically by RUI3 for the AT command interface.
If you setup your code well, this message will only shortly wake-up the device and it will go immediately into sleep again if you use api.system.lpmlvl.set(2); and api.system.lpm.set(1); and do not use the loop.
However, if you are using api.system.sleep.xxxx(yyyy) in your loop(), it is quite difficult.
Check our RUI3-Best-Practices repo for examples for RUI3.
Specially the RUI3-LowPower-Example is a good example how to use RUI3 as an event driven system and achieve lowest power consumption.
You can try to use api.system.lpm.set(1) and api.system.lpm.set(0) to enable/disable the sleep mode if you need to use UART1, but I never used that.
What “interrupt source” do you mean?
If you setup interrupts, you have to define the interrupt handler.
For LoRa/LoRaWAN, only the callbacks mentioned in the documentation are available.