mcci-catena / arduino-lmic

LoraWAN-MAC-in-C library, adapted to run under the Arduino environment
https://forum.mcci.io/c/device-software/arduino-lmic/
MIT License
642 stars 210 forks source link

Customize the join procedure #776

Closed Kampi closed 2 years ago

Kampi commented 3 years ago

Describe your question or issue

I use the current version of the MCCI LoRaWAN library with an ESP32 MCU. As far as I observed it correctly the library is waiting around 1 minute between each join request by default and the device isn´t going to any kind of power-saving mode.

I´m looking for a way to reduce the wait time between two join requests. And I´m looking also for a way to put the MCU into sleep during each join request. Is there a chance to do this?

Environment

chansheunglong commented 3 years ago

You can always join by calling LMIC_startJoining(), but you have to make sure you are following the duty cycle (check your local law) and fair use policy (e.g. from TTN). For putting MCU to sleep, you should ask help in Espressif's forum.

But since I also work with ESP32 board... If you go for deep sleep mode, ESP32 will be reset when waking up (all ram content lost). If the first thing your program does is to OTAA, you can just instruct the MCU to sleep for 1 minute then wake up, and start all over again.

esp_sleep_enable_timer_wakeup(60000000); //Sleep for 60 seconds
esp_deep_sleep_start();
miguemorales commented 3 years ago

Hi @Kampi, I am using almost the same set up as you, and sometimes my end-nodes are pretty far from the gateway, having joining issues and waiting some iterations to get the downlink even when in the gateway I oftenly receive the joint-resquest with no problems but por rssi and SNR. Did you get to request the joint in a higher frequency? Can you explain me what was your solution. Thank you in advance

Kampi commented 3 years ago

Hi @miguemorales,

I came up from the RFM95 and use the RAK3172 instead. This module provides a really good performance instead of the RFM95W and I can do a lot more in the firmware in terms of joining and power reduction.