From cd288f6efa725c62c673d4d304473891161e0db0 Mon Sep 17 00:00:00 2001 From: Julius Jurgelenas Date: Mon, 18 May 2026 00:40:17 +0300 Subject: [PATCH] Fix wifi flashing via flasher.pyz Restore call/signature alignment between binary_configurator and upload_via_esp8266_backpack, broken by the STM32 removal in 20d083c4 (#177): - binary_configurator.upload_wifi: drop the orphaned `False` (was isstm) so the 3-param do_upload signature matches. - upload_via_esp8266_backpack.do_upload: the `[isstm]` indexer was removed but the `['update', 'upload']` list literal was left in the URL format string, producing `http://elrs_txbp/['update', 'upload']`. Replace with `/update`. Also tighten the bare `except:` in upload_wifi so failures surface as stderr instead of being silently masked - this is what hid the TypeError across releases 1.5.2 - 1.5.5. --- python/binary_configurator.py | 7 ++++--- python/upload_via_esp8266_backpack.py | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/python/binary_configurator.py b/python/binary_configurator.py index 3293c116..db8bf870 100644 --- a/python/binary_configurator.py +++ b/python/binary_configurator.py @@ -58,10 +58,11 @@ def upload_wifi(args, mcuType, upload_addr): with open(args.file.name, 'rb') as f_in: with gzip.open('firmware.bin.gz', 'wb') as f_out: shutil.copyfileobj(f_in, f_out) - upload_via_esp8266_backpack.do_upload('firmware.bin.gz', upload_addr, False, {}) + upload_via_esp8266_backpack.do_upload('firmware.bin.gz', upload_addr, {}) else: - upload_via_esp8266_backpack.do_upload(args.file.name, upload_addr, False, {}) - except: + upload_via_esp8266_backpack.do_upload(args.file.name, upload_addr, {}) + except Exception as e: + print("WIFI upload failed: %s" % e, file=sys.stderr) return ElrsUploadResult.ErrorGeneral return ElrsUploadResult.Success diff --git a/python/upload_via_esp8266_backpack.py b/python/upload_via_esp8266_backpack.py index 88933a9c..b7800472 100644 --- a/python/upload_via_esp8266_backpack.py +++ b/python/upload_via_esp8266_backpack.py @@ -18,7 +18,7 @@ def do_upload(elrs_bin_target, upload_addr, env): upload_addr = [upload_port] for addr in upload_addr: - addr = "http://%s/%s" % (addr, ['update', 'upload']) + addr = "http://%s/update" % (addr,) print(" ** UPLOADING TO: %s" % addr) try: if bootloader_target is not None: