From 03a2b4808b240ac4b7825857dc74f3d31b0c3fdb Mon Sep 17 00:00:00 2001 From: John Doe Date: Wed, 1 Jul 2015 14:38:13 +0300 Subject: [PATCH] add 10 seconds timeout for waiting on ESP to start the update --- tools/espota.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/espota.py b/tools/espota.py index 2ad639584..f1f2baca6 100755 --- a/tools/espota.py +++ b/tools/espota.py @@ -26,16 +26,16 @@ def serve(remoteAddr, filename): content_size = os.path.getsize(filename) print('upload size: %d' % content_size, file=sys.stderr) message = '%d %d %d\n' % (0, serverPort, content_size) - print('sending invitation', file=sys.stderr) - sent = sock2.sendto(message, remote_address) - sent = sock2.sendto(message, remote_address) - sent = sock2.sendto(message, remote_address) - while True: # Wait for a connection + print('sending invitation', file=sys.stderr) + sent = sock2.sendto(message, remote_address) + sock.settimeout(10) print('waiting...', file=sys.stderr) connection, client_address = sock.accept() + sock.settimeout(None) + connection.settimeout(None) try: print('connection from', client_address, file=sys.stderr)