itead / Sonoff_Zigbee_Dongle_Firmware

155 stars 18 forks source link

[SUGGESTION] SL Web Tools implementation as Web Flasher for flashing Silicon Labs EFR32 firmware via a web browser #19

Open Hedda opened 1 year ago

Hedda commented 1 year ago

Home Assistant founders (and Nabu Casa) have recently among other things announced: "SL Web Tools" project (short for "Silicon Labs Web Tools") is available as open source, so wondering if you would consider adding that to ITead/Sonoff official website as a tool for updating/flashing ITead’s “Sonoff Zigbee 3.0 USB Dongle Plus V2” (model “ZBDongle-E”) based on Silicon Labs EFR32MG21 SoC/MCU. See:

https://www.home-assistant.io/blog/2023/02/08/state-of-matter-and-thread/#silabs-multi-flasher--sl-web-tools

(Note that this is only just one section from https://www.home-assistant.io/blog/2023/02/08/state-of-matter-and-thread/ )

SL Web Tools allows users to manage the firmware on Zigbee/Thread sticks directly from a web browser, with no terminals or compilation necessary. This allows product creators like yourself to offer easy firmware updates to their users and make experimental firmware updates available to test bug fixes quickly.

SL Web Tools runs in the browser using Pyodide and is currently powered by another new open-source Python project from them, “silabs-universal-flasher” for Silicon Labs EFR32 based SoCs like the EFR32MG21 SoC.

https://github.com/NabuCasa/sl-web-tools

(and currently powered by https://github.com/NabuCasa/universal-silabs-flasher for Silicon Labs based chips)

https://www.youtube.com/watch?v=-88K23e8XYw&t=2s&ab_channel=HomeAssistant

To see it in action, a demo of SL Web Tools for Silicon Labs chips has been added to the Home Assistant SkyConnect documentation.

https://skyconnect.home-assistant.io/firmware-update/ redirected from https://skyconnect.home-assistant.io/

image

Also, if wanted to take it to the next level then maybe forking that for ITead’s “Sonoff Zigbee 3.0 USB Dongle Plus” (model “ZBDongle-P”) based on Texas Instruments CC2652P and CP2102/CP2102N USB to UART/Serial Converter Chip by starting a new project called "TI Web Tools" (short for "Texas Instruments Web Tools") or similar that is based on that in combination with cc2538-bsl code (and/or ZigStarGW-MT) for the TI flashing part(?). That is, an idea to extend this would be to replace the silabs-universal-flasher code part with cc2538-bsl and/or ZigStarGW-MT code in order to allow flashing of Texas Instruments based adapters instead.

Note! SL Web Tools is in turn a fork of their previous "ESP Web Tools" project which allow DIY firmware flashing of ESP32/ESP8266 SoC projecst to offer an easy web installer on their homepage, allowing users to get started directly from their browser. It has been adopted by all the great projects, including Tasmota, WLED, and ESPresense. Ever since the introduction of ESP Web Tools, they expanded this to more devices, and now they also introduced SL Web Tools for SiLabs based chips.

PS: For reference; the firmware build system for Silicon Labs was made by Home Assistant developer/engineer and Nabu Casa employee Stefan Agner (a.k.a. agners, who also developed the EFR32MG21-based Home Assistant SkyConnect USB stick/dongle as well as the EFR32MG21-based radio module integrated into the Home Assistant Yellow appliance for Rasberry Pi 4 Compute Module). And the "universal-silabs-flasher" firmware tool was made by puddly who is also one of the lead developers of zigpy and the radio libraries for zigpy that is used in Home Assistant's ZHA integration (among other projects).

@Daniel-zhan-itead

Hedda commented 1 year ago

Note that would also need to add your VID and PID to "usb_filters" to manifest file for it to detect Sonoff ZBDongle-E USB dongle:

https://github.com/NabuCasa/sl-web-tools/blob/dc5d5c239d330e03add1511971280e4180bebf94/assets/manifests/skyconnect.json#L5

PS: @Daniel-zhan-itead sl-web-tools now also support flashing Thread/OpenThread firmware too -> https://github.com/NabuCasa/sl-web-tools/pull/7

Hedda commented 1 year ago

FYI, @darkxst has patched and published a barebone implementation for ZBDongle-E on his Github pages as proof-of-concept:

https://github.com/darkxst/sl-test/tree/gh-pages

https://darkxst.github.io/sl-test/

He does however write that it would, however, require some modifications to the build system:

https://github.com/ksjh/silabs-firmware-builder/issues/12

That in turn depends on silabs-firmware-builder fork from @ksjh here:

https://github.com/ksjh/silabs-firmware-builder