From 94a531c464185feae2f90672f2ce43ae0df6159e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=C3=ADn=20Skala?= Date: Mon, 22 Aug 2022 12:33:59 +0200 Subject: [PATCH] Use async sleep, increase chunk size --- examples/esp8266/WebSocketClientOTA/python_ota_server/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/esp8266/WebSocketClientOTA/python_ota_server/main.py b/examples/esp8266/WebSocketClientOTA/python_ota_server/main.py index 1c1c5b6..5d2750c 100644 --- a/examples/esp8266/WebSocketClientOTA/python_ota_server/main.py +++ b/examples/esp8266/WebSocketClientOTA/python_ota_server/main.py @@ -55,7 +55,7 @@ async def binary_send(websocket, fw_file): with open(fw_file, "rb") as binaryfile: while True: - chunk = binaryfile.read(2048) + chunk = binaryfile.read(4096) if not chunk: break try: @@ -63,7 +63,7 @@ async def binary_send(websocket, fw_file): except Exception as exception: Logger.exception(exception) return False - time.sleep(0.2) + asyncio.sleep(0.2) def version_checker(name, vdev, vapp):