Reconnect WiFi on error
This commit is contained in:
parent
8cc99d2437
commit
aa6c09e9aa
2 changed files with 9 additions and 0 deletions
|
@ -82,6 +82,9 @@ void checkBitcoinBlock(void *pvParameters)
|
|||
Serial.print(F("Error in HTTP request to mempool API: "));
|
||||
Serial.print(httpCode);
|
||||
Serial.println(http->errorToString(httpCode));
|
||||
if (httpCode == -1) {
|
||||
WiFi.reconnect();
|
||||
}
|
||||
}
|
||||
|
||||
http->end();
|
||||
|
|
|
@ -56,6 +56,9 @@ void taskGetPrice(void *pvParameters)
|
|||
{
|
||||
Serial.print(F("Error retrieving BTC/USD price (CoinGecko). HTTP status code: "));
|
||||
Serial.println(httpCode);
|
||||
if (httpCode == -1) {
|
||||
WiFi.reconnect();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
|
@ -86,6 +89,9 @@ void taskGetPrice(void *pvParameters)
|
|||
{
|
||||
Serial.print(F("Error retrieving BTC/USD price (CoinDesk). HTTP status code: "));
|
||||
Serial.println(httpCode);
|
||||
if (httpCode == -1) {
|
||||
WiFi.reconnect();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue