Skip to content

Commit 917cf13

Browse files
authored
Merge pull request #88 from pennam/lora-retry
LoRa: add retries if joinOTAA(...) fails
2 parents 2dcb0fa + a2746dc commit 917cf13

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Arduino_LoRaConnectionHandler.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,9 @@ NetworkConnectionState LoRaConnectionHandler::update_handleConnecting()
124124
bool const network_status = _modem.joinOTAA(_appeui, _appkey);
125125
if (network_status != true)
126126
{
127-
Debug.print(DBG_ERROR, F("Something went wrong; are you indoor? Move near a window, then reset and retry."));
128-
return NetworkConnectionState::ERROR;
127+
Debug.print(DBG_ERROR, F("Connection to the network failed"));
128+
Debug.print(DBG_INFO, F("Retrying in \"%d\" milliseconds"), CHECK_INTERVAL_TABLE[static_cast<unsigned int>(NetworkConnectionState::CONNECTING)]);
129+
return NetworkConnectionState::INIT;
129130
}
130131
else
131132
{

0 commit comments

Comments
 (0)