add cli argument for address to otaflash.py

This commit is contained in:
j3d1 2021-11-18 04:03:53 +01:00
parent 24f5e4398d
commit 7a627ee1f1

View file

@ -8,6 +8,7 @@ from websocket import WebSocketTimeoutException
parser = argparse.ArgumentParser(description='Update fiatlux firmware via websocket.')
parser.add_argument("binfile")
parser.add_argument("address")
args = parser.parse_args()
@ -25,7 +26,7 @@ with open(args.binfile, "rb") as f:
try:
ws = websocket.WebSocket()
print("send {}".format(args.binfile))
ws.connect("ws://172.16.0.1")
ws.connect("ws://" + args.address)
i = 0
bytes = f.read()
rolling = zlib.crc32(bytes)