This commit is contained in:
Mathieu Maret 2016-04-01 01:05:29 +02:00
parent 0dd9901d19
commit a204d6fddf
1 changed files with 15 additions and 5 deletions

View File

@ -138,11 +138,21 @@ void OTASetup() {
});
ArduinoOTA.onError([](ota_error_t error) {
SKETCH_DEBUG_PRINTF("Error[%u]: ", error);
if (error == OTA_AUTH_ERROR){ SKETCH_DEBUG_PRINTLN("Auth Failed");}
else if (error == OTA_BEGIN_ERROR){ SKETCH_DEBUG_PRINTLN("Begin Failed");}
else if (error == OTA_CONNECT_ERROR){ SKETCH_DEBUG_PRINTLN("Connect Failed");}
else if (error == OTA_RECEIVE_ERROR){ SKETCH_DEBUG_PRINTLN("Receive Failed");}
else if (error == OTA_END_ERROR){ SKETCH_DEBUG_PRINTLN("End Failed");}
if (error == OTA_AUTH_ERROR) {
SKETCH_DEBUG_PRINTLN("Auth Failed");
}
else if (error == OTA_BEGIN_ERROR) {
SKETCH_DEBUG_PRINTLN("Begin Failed");
}
else if (error == OTA_CONNECT_ERROR) {
SKETCH_DEBUG_PRINTLN("Connect Failed");
}
else if (error == OTA_RECEIVE_ERROR) {
SKETCH_DEBUG_PRINTLN("Receive Failed");
}
else if (error == OTA_END_ERROR) {
SKETCH_DEBUG_PRINTLN("End Failed");
}
});
ArduinoOTA.begin();
SKETCH_DEBUG_PRINTLN("Ready");