From 91833667343b17d4494464e80ca900eae884bff8 Mon Sep 17 00:00:00 2001 From: david gauchard Date: Sun, 31 Dec 2017 02:27:33 +0100 Subject: [PATCH] fix IDE's OTA when using MSS != 1460 --- tools/espota.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/espota.py b/tools/espota.py index ecd00b322..862a48c1a 100755 --- a/tools/espota.py +++ b/tools/espota.py @@ -171,10 +171,14 @@ def serve(remoteAddr, localAddr, remotePort, localPort, password, filename, comm sys.stderr.write('\n') logging.info('Waiting for result...') + # libraries/ArduinoOTA/ArduinoOTA.cpp L311 L320 + # only sends digits or 'OK'. We must not not close + # the connection before receiving the 'O' of 'OK' try: connection.settimeout(60) - data = connection.recv(32).decode() - logging.info('Result: %s' ,data) + while True: + if connection.recv(32).decode().find('O') >= 0: break + logging.info('Result: OK') connection.close() f.close() sock.close()