Skip to content

Commit

Permalink
Merge pull request #125 from CapnBry/backpack-gzip
Browse files Browse the repository at this point in the history
Mismatch in parameter count for esp8266 upload
  • Loading branch information
CapnBry authored Dec 28, 2023
2 parents df4eb7e + bef34ac commit 88ce11d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion python/build_env_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ def copy_bootfile(source, target, env):
shutil.copyfile(FRAMEWORK_DIR + "/tools/partitions/boot_app0.bin", env.subst("$BUILD_DIR") + "/boot_app0.bin")

if platform in ['espressif8266']:
env.AddPostAction("buildprog", esp_compress.compressFirmware)
env.AddPreAction("${BUILD_DIR}/spiffs.bin",
[esp_compress.compress_files])
env.AddPreAction("${BUILD_DIR}/${ESP8266_FS_IMAGE_NAME}.bin",
Expand Down Expand Up @@ -45,3 +44,5 @@ def copy_bootfile(source, target, env):
except FileNotFoundError:
None
env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", UnifiedConfiguration.appendConfiguration)
if platform in ['espressif8266'] and "_WIFI" in target_name:
env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", esp_compress.compressFirmware)
8 changes: 5 additions & 3 deletions python/upload_via_esp8266_backpack.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import subprocess, os

def do_upload(elrs_bin_target, upload_addr, isstm, env):
def do_upload(elrs_bin_target, pio_target, upload_addr, isstm, env):
bootloader_target = None
app_start = 0 # eka bootloader offset

Expand Down Expand Up @@ -65,7 +65,9 @@ def on_upload(source, target, env):
bin_path = os.path.dirname(firmware_path)
elrs_bin_target = os.path.join(bin_path, 'firmware.elrs')
if not os.path.exists(elrs_bin_target):
elrs_bin_target = os.path.join(bin_path, 'firmware.bin')
elrs_bin_target = os.path.join(bin_path, 'firmware.bin.gz')
if not os.path.exists(elrs_bin_target):
raise Exception("No valid binary found!")
elrs_bin_target = os.path.join(bin_path, 'firmware.bin')
if not os.path.exists(elrs_bin_target):
raise Exception("No valid binary found!")
do_upload(elrs_bin_target, pio_target, upload_addr, isstm, env)

0 comments on commit 88ce11d

Please sign in to comment.