LoRaWan Sllep Function

I need to understand what exactly the function LoRaWAN.sleep(loraWanClass,debugLevel);
does?
How does it differ from esp_deep_sleep()?
Thanks.
JWS
.

1 Like

Same question…Kindly, any member of the Heltech developers could give us a brief description of what this function does, Does it stop the LoRa Radio? Who wakes it up?

It counts sleep time, sleeps, and wakes up.

1 Like

Thank you navi for your response, would you please clarify why at the joining phase when LoRaMacMlmeRequest returns:

LoRaMacMlmeRequest( &mlmeReq ) == LORAMAC_STATUS_OK

The Node goes into :

deviceState = DEVICE_STATE_SLEEP

which uses LoRaWAN.sleep Function where it’s not clear for me which timer is set to trigger this Function to wake-up from sleep?

And what i should avoid when i use the esp_deep_sleep() in order to not conflict the functionality of LoRaWAN.sleep Function?

Does the Function goes into Deep Sleep (So we can avoid using the esp_deep_sleep) or it uses one of the light sleep modes ?

Thank you

When you need to use sleep, you can also call the LoRaWAN.sleep function to sleep.

I think it do more as setting the debug level to 3 would show some Tx/Rx activity.

LoRaWAN_DEBUG_LEVEL=3

image

during the joining, as in the ESP32_LoRaWAN.cpp , the ESP32 should be going into sleep (deep sleep) but the debugging on the terminal shows something else.

This information is really important as trying to use the RTOS with this library produce crashs.