RAK4630 light sleep guide

(I’m using VSCODE for all of this)

I’m trying to make RAK4630 to “light sleep” and wake on a timer or LoRa wake up pin.

I guess I have it well defined the pins to sleep like so:

pinMode(RADIO_WAKEUP_PIN, INPUT);
attachInterrupt(digitalPinToInterrupt(RADIO_WAKEUP_PIN), wakeUpLoRaPacketReceived, RISING);
LoRa_Utils::wakeRadio();

this lines were lend by ESP32 code that works waking up from sleep (on VSCODE)

so far I could not make any code (founded and or chatgpt) to make it sleep :

__WFI();
__SEV();
__WFI();

or

__WFE();
__SEV();
__WFE();

did not wait any time at all

any help/guide where or how to continue?

Hi @richonguzman ,

There is no lightsleep and deepsleep on RAK4630 as it differs on ESP32.

However, to achieve your sleep goals for your device, you can use this example that uses FreeRTOS to trigger a wakeup on specific time period (2 minutes in this example).

is FreeRTOS and the use of xSemaphore… the only way to get to light sleep (and also wake upon LoRa Message Rx )???

There are other ways but that’s the reference we provide to our users. Event driven approach.

1 Like