In this post, I will guide you through the process of flashing the Sonoff Zigbee 3.0 USB Dongle Plus with the latest firmware using Python. This method allows you to update the dongle without the need to dismantle it, providing access to the latest functionality and expanding device compatibility.
Please note that the instructions provided here are specifically for macOS, and the Windows version may have slight differences.
Step 1: Install Python
First, ensure that Python is installed on your system. You can download the latest version of Python from the official website: Python Downloads. Follow the installation instructions for your operating system.
Step 2: Plug in the Sonoff Zigbee Dongle
Connect the Sonoff Zigbee 3.0 USB Dongle Plus to an available USB port on your computer.
Step 3: Install Device Drivers
To enable communication between the dongle and your computer, you'll need to install the appropriate device drivers. For Windows or macOS, visit the Silicon Labs website and download the USB-to-UART bridge VCP drivers: Silicon Labs USB-to-UART Bridge VCP Drivers. Install the drivers according to the provided instructions.
On macOS to find device serial ID use this command in terminal:
ls /dev/tty* | grep usb
Step 4: Backup Firmware
Before proceeding with the firmware update, it's a good practice to create a backup of the existing firmware. Open your command prompt or terminal and enter the following commands:
python -m pip install --upgrade pip
pip install wheel pyserial intelhex python-magic
pip install zigpy-znp
python -m zigpy_znp.tools.nvram_read /dev/tty.usbserial-1420 -o nvram_backup.json
Note: Replace /dev/tty.usbserial-1420
with the appropriate serial port identifier for your Sonoff Zigbee Dongle.
This will install the necessary dependencies and create a backup of the current firmware in a file named nvram_backup.json
.
Step 5: Download Bootloader
Next, you'll need to download the bootloader for the Sonoff Zigbee Dongle. You can find the bootloader on the following GitHub repository: CC2538 BSL Bootloader.
Step 6: Download Firmware
Download the latest Z-Stack firmware for the coordinator from the Koenkk's GitHub repository: Z-Stack Firmware. Make sure to select the appropriate firmware file for your Sonoff Zigbee Dongle Plus.
Step 7: Flash the Dongle
Once you have the bootloader and firmware files downloaded, it's time to flash the dongle. Open your command prompt or terminal and enter the following command:
python cc2538-bsl.py -p /dev/tty.usbserial-1420 -e -v -w --bootloader-sonoff-usb CC1352P2_CC2652P_launchpad_coordinator_20230507.hex
Note: Replace /dev/tty.usbserial-1420
with the appropriate serial port identifier for your Sonoff Zigbee Dongle. Additionally, ensure that you're using the correct bootloader file and firmware file names.
This command will initiate the flashing process. It will erase the existing firmware, write the new firmware, and verify the flashing process. You will see progress and verification messages in the command prompt or terminal.
Once the flashing process completes successfully, your Sonoff Zigbee Dongle Plus will be updated with the latest firmware, allowing you to enjoy enhanced functionality and support for a wider range of devices.
Please note that flashing firmware carries some risks, and it's important to follow the instructions carefully and ensure you have a backup of the original firmware. If any issues arise during the flashing process, refer to the documentation provided with the bootloader and firmware files or seek assistance from the respective GitHub repositories.
Happy flashing and enjoy your Sonoff Zigbee 3.0 USB Dongle Plus with the latest firmware for Home Assistant!