Rak3172 not Sleeping RUI 4.0

Hello RakWireless,

I have updated to RUI 4.0 and found that api.system.sleep.all() doesn’t work to put device into sleep.

api.system.sleep.all(some number); does seem to work

Has there been an update to api.system.sleep.all(); ?

Hi @pmjackson ,

I tested my RAK3172 and sleep.all API and both empty and with parameter, both works fine. It still sleeps. What code do you use to test and what current did you measure?

On my test I used a modified System_Powersave example to remove the parameter.

Hello @carlrowan ,

Thank you for repling…
As you see Past1 keeps getting printed.

I am using a push button attached to Reset pin & Gnd to simply reset the RAK3172 device.
RUI3.5.3 worked very well with this.

In setup I simply set P2P parmeters and add
api.system.atMode.add((char *)“encKey”,(char *)“Set Enckey”,(char *)“encKey”, encKey_handler);

I am using Encryption. The receiver counts payload not needing decryption.

Hi @pmjackson ,

I did some test based on your code and I can confirm your situation.

I had some measurements and find out that the psend payload will take around 30mSec to process.

This means that if you send a sleep command immediately, it will be missed by the module.

So I tried adding a short delay to offset the 30mSec LoRa TX time.

This code works as expected when I added 40mSec delay. If you add less than the LoRa TX time, it will not work


The duration of the LoRa TX time will depend on the payload size and LoRa parameters like spreading factor, coding rate, etc.

Maybe the PSEND callback might be a good option to use if the payload size might change in the future.

1 Like

Thank you @carlrowan

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