Skip to content

Commit 9183366

Browse files
d-a-vigrr
authored andcommitted
fix IDE's OTA when using MSS != 1460
1 parent f9c60a2 commit 9183366

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tools/espota.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,10 +171,14 @@ def serve(remoteAddr, localAddr, remotePort, localPort, password, filename, comm
171171

172172
sys.stderr.write('\n')
173173
logging.info('Waiting for result...')
174+
# libraries/ArduinoOTA/ArduinoOTA.cpp L311 L320
175+
# only sends digits or 'OK'. We must not not close
176+
# the connection before receiving the 'O' of 'OK'
174177
try:
175178
connection.settimeout(60)
176-
data = connection.recv(32).decode()
177-
logging.info('Result: %s' ,data)
179+
while True:
180+
if connection.recv(32).decode().find('O') >= 0: break
181+
logging.info('Result: OK')
178182
connection.close()
179183
f.close()
180184
sock.close()

0 commit comments

Comments
 (0)