Skip to content

Commit

Permalink
Use async sleep, increase chunk size
Browse files Browse the repository at this point in the history
  • Loading branch information
Tony763 authored and Links2004 committed Aug 22, 2022
1 parent ccdba4e commit 94a531c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/esp8266/WebSocketClientOTA/python_ota_server/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@ 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:
await websocket.send(chunk)
except Exception as exception:
Logger.exception(exception)
return False
time.sleep(0.2)
asyncio.sleep(0.2)


def version_checker(name, vdev, vapp):
Expand Down

0 comments on commit 94a531c

Please sign in to comment.