arduino-libraries / Arduino_ConnectionHandler

GNU General Public License v3.0
97 stars 36 forks source link

LoRa: add retries if joinOTAA(...) fails #88

Closed pennam closed 1 year ago

pennam commented 1 year ago

Issue: user reported problems on multiple boards not connecting to the network and to ArduinoIoTCloud. The boards are printing the following message on the serial monitor:

Something went wrong; are you indoor? Move near a window, then reset and retry.

and after they start looping without doing nothing.

Proposed solution: This patch adds automatic retries if joinOTAA(...) fails, this is very similar to what we are doing in the CONNECTING state of WiFiConnectionHandler callingWiFi.begin(...) until board gets connected.

github-actions[bot] commented 1 year ago

Memory usage change @ a2746dc27745d005a07d2b2b4e91f0563475884e

Board flash % RAM for global variables %
arduino:mbed:envie_m7 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:mbed_nano:nanorp2040connect 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:mbed_nicla:nicla_vision 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkr1000 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrgsm1400 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrnb1500 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrwan1300 :small_red_triangle: +88 - +88 +0.03 - +0.03 0 - 0 0.0 - 0.0
arduino:samd:mkrwan1310 :small_red_triangle: +88 - +88 +0.03 - +0.03 0 - 0 0.0 - 0.0
arduino:samd:mkrwifi1010 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:nano_33_iot 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
esp32:esp32:esp32 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
esp8266:esp8266:huzzah 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
Click for full report table Board|examples/ConnectionHandlerDemo
flash|%|examples/ConnectionHandlerDemo
RAM for global variables|% -|-|-|-|- arduino:mbed:envie_m7|0|0.0|0|0.0 arduino:mbed_nano:nanorp2040connect|0|0.0|0|0.0 arduino:mbed_nicla:nicla_vision|0|0.0|0|0.0 arduino:samd:mkr1000|0|0.0|0|0.0 arduino:samd:mkrgsm1400|0|0.0|0|0.0 arduino:samd:mkrnb1500|0|0.0|0|0.0 arduino:samd:mkrwan1300|88|0.03|0|0.0 arduino:samd:mkrwan1310|88|0.03|0|0.0 arduino:samd:mkrwifi1010|0|0.0|0|0.0 arduino:samd:nano_33_iot|0|0.0|0|0.0 esp32:esp32:esp32|0|0.0|0|0.0 esp8266:esp8266:huzzah|0|0.0|0|0.0
Click for full report CSV ``` Board,examples/ConnectionHandlerDemo
flash,%,examples/ConnectionHandlerDemo
RAM for global variables,% arduino:mbed:envie_m7,0,0.0,0,0.0 arduino:mbed_nano:nanorp2040connect,0,0.0,0,0.0 arduino:mbed_nicla:nicla_vision,0,0.0,0,0.0 arduino:samd:mkr1000,0,0.0,0,0.0 arduino:samd:mkrgsm1400,0,0.0,0,0.0 arduino:samd:mkrnb1500,0,0.0,0,0.0 arduino:samd:mkrwan1300,88,0.03,0,0.0 arduino:samd:mkrwan1310,88,0.03,0,0.0 arduino:samd:mkrwifi1010,0,0.0,0,0.0 arduino:samd:nano_33_iot,0,0.0,0,0.0 esp32:esp32:esp32,0,0.0,0,0.0 esp8266:esp8266:huzzah,0,0.0,0,0.0 ```