Skip to content

Commit

Permalink
0.3.0
Browse files Browse the repository at this point in the history
## 0.3.0
- Add built in z-stack release selections For 20240710 Release
- Add sonoff option to trigger sonoff bootloader during flash
- Update ESPHome Bootloader call to work with more devices.
  • Loading branch information
tube0013 committed Aug 26, 2024
1 parent 7011b90 commit ef5cb01
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 12 deletions.
61 changes: 52 additions & 9 deletions tzb-cc2652-flasher/rootfs/etc/s6-overlay/scripts/cc2652-flasher-up
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ declare device_type
declare network_device_url
declare firmware
declare exit_status
declare cc2652p2_release_url
declare cc2652p7_release_url

# Current Z-Stack FW Release URL
# Repo Local due to https://github.com/Koenkk/Z-Stack-firmware/issues/512

cc2652p2_release_url="https://github.com/tube0013/tubeszb_addons/raw/main/tzb-cc2652-flasher/firmware/CC1352P2_CC2652P_launchpad_coordinator_20240710.zip"
cc2652p7_release_url="https://github.com/tube0013/tubeszb_addons/raw/main/tzb-cc2652-flasher/firmware/CC1352P7_coordinator_20240710.zip"

function cleanup() {
exit_status=$?
Expand All @@ -36,30 +44,65 @@ else
device="socket://${network_device}"
fi

if bashio::config.true 'trigger_esphome_bsl'; then
bashio::log.info "Triggering Bootloader mode on ${network_device_url}"
curl --silent -X POST http://${network_device_url}/button/trigger_zigbee_module_bootloader/press
sleep 8s
fi
# Get Firmware

if bashio::config.has_value 'firmware_url'; then
curl --silent -L -o "/root/firmware.zip" "$(bashio::config 'firmware_url')"
if bashio::config.true 'cc2652p2_fw'; then
curl --silent -L -o "/root/firmware.zip" ${cc2652p2_release_url}
if [ ! -f "/root/firmware.zip" ]; then
bashio::log.warning "Downloading firmware failed"
exit 0
fi

unzip -p "/root/firmware.zip" > "/root/firmware.hex"
if [ ! -f "/root/firmware.hex" ]; then
bashio::log.warning "Unzipping firmware failed"
exit 0
fi

if bashio::config.true 'cc2652p7_fw'; then
curl --silent -L -o "/root/firmware.zip" ${cc2652p7_release_url}
if [ ! -f "/root/firmware.zip" ]; then
bashio::log.warning "Downloading firmware failed"
exit 0
fi

unzip -p "/root/firmware.zip" > "/root/firmware.hex"
if [ ! -f "/root/firmware.hex" ]; then
bashio::log.warning "Unzipping firmware failed"
exit 0
fi

if bashio::config.true 'custom_fw_url:'; then
curl --silent -L -o "/root/firmware.zip" "$(bashio::config 'firmware_url')"
if [ ! -f "/root/firmware.zip" ]; then
bashio::log.warning "Firmware Download failed"
exit 0
fi

unzip -p "/root/firmware.zip" > "/root/firmware.hex"
if [ ! -f "/root/firmware.hex" ]; then
bashio::log.warning "unzipping Download failed - Did you use the GitHub raw link?"
exit 0
fi

firmware="firmware.hex"
else
exit_no_firmware
bashio::log.warning "No Firmware Found"
fi

if bashio::config.true 'trigger_esphome_bsl'; then
bashio::log.info "Triggering Bootloader mode on ${network_device_url}"
curl --silent -X POST http://${network_device_url}/button/trigger_zigbee_module_bootloader/press
curl --silent -X POST http://${network_device_url}/button/prep_the_cc2652p2_for_firmware_update/press
sleep 8s
fi


bashio::log.info "Starting cc2652 flasher with ${device}"
cc1352-flasher.py -p ${device} -evw "/root/${firmware}"
if bashio::config.true 'sonoff'; then
bashio::log.info "Starting CC2652P flasher with Sonoff ${device}"
cc1352-flasher.py -p ${device} -evw --bootloader-sonoff-usb "/root/${firmware}"
else
bashio::log.info "Starting cc2652 flasher with ${device}"
cc1352-flasher.py -p ${device} -evw "/root/${firmware}"
fi
16 changes: 14 additions & 2 deletions tzb-cc2652-flasher/translations/en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
configuration:
device:
name: Device
description: The serial port where the CC2652 radio is connected to.
description: The serial port where the CC2652 radio is connected. Select any value here even if doing a Network flash (Needed to validate the config form)
network_device:
name: Network Device
description: The ip address and port of your network connected CC2652 radio. IP_ADDRESS:PORT
Expand All @@ -19,4 +19,16 @@ configuration:
Enables the addon to trigger bootloader mode by talking directly to ESPHome (requires most recent esphome FW from https://github.com/tube0013/tube_gateways)
device_type:
name: Flash USB Device
description: Flash USB device instead of Network Device (Requires you to trigger bootloader mode by holding BSL button while plugging in to USB)
description: Flash USB device instead of Network Device (Requires you to trigger bootloader mode by holding BSL button while plugging in to USB)
sonoff:
name: Sonoff Dongle-P
description: Select to enable the bsl trigger for the Sonoff Dongle-P
cc2652p2_fw:
name: CC1352P2_CC2652P_launchpad_coordinator_20240710
description: Current Z-Stack Release for CC2652P2 Devices - Use with all TubesZB CC2652 P2 Coordinator Devices
cc2652p7_fw:
name: CC1352P7_coordinator_20240710
dedescription: Current Z-Stack Release for CC2652P7 Devices - Use with TubesZB CC2652 P7 PoE
custom_fw_url:
name: Custom_Firmware_URL
description: Select if entering a custom url for zipped firmware
9 changes: 8 additions & 1 deletion tzb-silabs-flasher/config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
version: 0.2.2
version: 0.3.0
slug: tzb-silabs-flasher
name: TubesZB Silicon Labs FW Flasher
description: TubesZB Silicon Labs firmware flasher add-on
Expand All @@ -19,6 +19,9 @@ options:
network_device: null
device: null
device_type: false
sonoff: false
cc2652p2_fw: false
cc2652p7_fw: false
firmware_url: str?
bootloader_baudrate: "115200"
flow_control: false
Expand All @@ -27,6 +30,10 @@ schema:
network_device: str?
device: device(subsystem=tty)?
device_type: bool?
sonoff: bool?
cc2652p2_fw: bool?
cc2652p7_fw: bool?
custom_fw_url: bool?
firmware_url: str?
bootloader_baudrate: list(57600|115200|230400|460800|921600)
flow_control: bool?
Expand Down
5 changes: 5 additions & 0 deletions tzb-zigpy-cli-tools/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 0.3.0
- Add built in z-stack release selections For 20240710 Release
- Add sonoff option to trigger sonoff bootloader during flash
- Update ESPHome Bootloader call to work with more devices.

## 0.2.3
- Update Builds

Expand Down

0 comments on commit ef5cb01

Please sign in to comment.