From 833b4b229b2b244fecace0d373155477bba81c76 Mon Sep 17 00:00:00 2001 From: LIYOU ZHOU Date: Sun, 24 Sep 2017 22:12:02 +0100 Subject: [PATCH] :bug: Interpret firmware file as an bytearray (#403) Fix https://github.com/marvinroger/homie-esp8266/issues/397 --- scripts/ota_updater/ota_updater.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/ota_updater/ota_updater.py b/scripts/ota_updater/ota_updater.py index 1db4b35b..2b0f1f5b 100755 --- a/scripts/ota_updater/ota_updater.py +++ b/scripts/ota_updater/ota_updater.py @@ -145,8 +145,10 @@ def base_topic_arg(s): args = parser.parse_args() # read the contents of firmware into buffer - firmware = args.firmware.read() + fw_buffer = args.firmware.read() args.firmware.close() + firmware = bytearray() + firmware.extend(fw_buffer) # Invoke the business logic main(args.broker_host, args.broker_port, args.broker_username,