Time to wait between SEND and SLEEP

I am working on a low power device and I have noticed that I must wait at least 3 seconds between a successful AT+SEND command and AT+SLEEP, otherwise the sleep will not occur or only be very brief.

Given that the SEND returns OK, it seems like I should be able to sleep straight away. Is there anyway to query the device to make sure it can enter sleep?I have found 3 seconds to work well but that might be because I am testing right next to my gateway. When I deploy this in the field the time required might increase.

The current sent of commands which works well is as follows

>>>>>>AT+SEND=50:112233445566778899
<<<<<<OK
<Wait 3 seconds>
>>>>>>AT+SLEEP=0

If I instead use

>>>>>>AT+SEND=50:112233445566778899
<<<<<<OK
>>>>>>AT+SLEEP=0
<sleep my mcu>

I see from my power supply that the mcu is sleeping but the RAK3172 is not.

Hi @WillAnderson ,

The module won’t be able to sleep immediately because it has to open its RF based on the LoRaWAN RX1 and RX2 delay (if working on class A). I am not sure what network server you are using but the standard will allow up to 15seconds RX1 delay (usually this is way less - timeout in TTN V3 is 5 sec) plus the RX2 delay which is 1 second after.

I understand your concern about this that’s why on our next firmware release, we will have the automatic low power mode like the legacy firmware where the module will go back to sleep automatically after execution of commands.

Hi @carlrowan ,

Considering the latest firmware 4.2.0, with AT+LPM=1, and last command is different than AT+SEND, how long it takes to go automatically to sleep mode?

Hi @carlrowan , please did you see my question above?

Hi @IGtti ,

The RAK3172 goes to sleep mode immediately after AT+SEND. It will prepare to get any packets on RX1 and RX2 delays but after than immediately goes to sleep again.

Hi @carlrowan ,

What about other commands, other than AT+SEND. Will it also automatically and immediately go into sleep mode?

While in Sleep mode, does the next AT command wakes up and is processed or will it miss the first AT command?

Thank you

Hi @carlrowan , please, any feedback on the last question above?
Thank you.

Hi @IGtti ,

This behavior is consistent to all AT Commands as long as AT+LPM (low power mode) is set to 1. If the value of AT+LPM is 0, the module will not automatically go to sleep and will require AT+SLEEP command.

@carlrowan ,

And, while in Sleep mode, any risk to loose the first AT command (as it must wakeup to process the command)?

We have this issue/s before (very early days of RUI3) but this was fixed already long time ago and will not show on latest RUI3 firmware.

I personally do not see this errors now. I haven’t check specifically the fix/patch on code but we have no reports of any missed AT commands in sleep mode.