Skip to content

Commit 4665859

Browse files
committed
Update ArduinoOTA.cpp
Restarts the UDP port if it becomes disconnected. Works when for example the wifi is disconnected and reconnected
1 parent 49bc812 commit 4665859

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

libraries/ArduinoOTA/ArduinoOTA.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ void ArduinoOTA::setup() {
5151
}
5252

5353
void ArduinoOTA::handle() {
54+
55+
if (!*_udp_ota) {
56+
_udp_ota->begin(_port);
57+
Serial.println(F("OTA restarted"));
58+
}
5459

5560
if (!_udp_ota->parsePacket()) return;
5661

0 commit comments

Comments
 (0)