RAK811 Telling itself to sleep

Hello comunity,
This is more a brainstorm than anything else.
I am programming a RAK811 using the IDE and this code.
Evaluation_Boards/RAK811 at master · RAKWireless/Evaluation_Boards · GitHub

I altered the code to my likings and sensor fittings all good.
But the consumptions are high, and not the breasy uA the RAK811 can do.
I know the RUI compiler is available, but i thing adding the libraries there would be more complicated for now.
First question, how can i enable the sleep mode in the RAK811 like i would wih a AT+comnand?
Secondly (and please be kind) question: can i use the other RAK serial ports to tell itself to go to sleep? I imagine it should work right?

Since you are now using STM32Duino, most of your work will involve that development ecosystem. This is same with the MCCI Lmic for your LoRaWAN Stack.

I found this one GitHub - stm32duino/STM32LowPower: Arduino Low Power library for STM32

Unfortunately, you cannot combine RUI with STM32Duino.

With saving battery, you can also consider to totally remove the power of the whole circuit by using low power external RTC or timer switch. But this will require you to re-join every turn on of the device (if OTAA) and frame counters are always 0. Might be viable option if you will only send very few times a day.

1 Like

Only as long as he’s not using TTN where we hunt people that re-join on OTAA more than once a decade down like the huge resource hogs that they are and make them write out lines, Bart Simpson style.

A device joins and stays joined, battery changes permitting.

2 Likes

@bioshock2k , you can disregard the last two sentences of my reply if you are using TTN. @nmcc will hunt you and your constantly re-joining device :sweat_smile:

1 Like

HAHAH no no i want to use the RUI sleep mode that keeps all its information. Don´t want no rejoining in here ahhaha.
That´s why i am talking about using the Serial to give that command.
I want my devices to last 2 years with one battery not 1 month :sweat_smile:

1 Like

I will no worries :joy:

I am fluid in this case…but i should also be able to sent AT-commands on STM32Duino right? The ports are there so it has to work.

When you upload your STM32Duino code to RAK811, the default RAK FW is actually overwritten so AT commands are lost.

Btw, the RUI sleep documentation is here:

https://docs.rakwireless.com/RUI/rui-device-general-format/#rui-device-sleep

This is a RUI example with sleep command Products_practice_based_on_RUI_v2.0/at_cmd.c at e21b45b2d4bb3fe25411d4e6d1812d01520185d7 · RAKWireless/Products_practice_based_on_RUI_v2.0 · GitHub

When RAK811 is in sleep mode, it will wake up by positive edge on any RX pin of UART1 or UART3. Those pins are internally pull-down during sleep.

There are plenty of Arduino libraries around that you can use to implement something similar (or even identical if you want).