Reconnect WiFi on error
This commit is contained in:
parent
8cc99d2437
commit
aa6c09e9aa
@ -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 New Issue
Block a user