Introduction
I recently updated the firmware on my Sonoff Zigbee USB Dongle Plus device. It wasn't the easiest process but the results were a big improvement in range and reliability from the firmware version that came on the device.
I watched a YouTube video showing the procedure using a Windows PC with Python. So I migrated the information and procedure over to Debian Linux.
Coordinator
The coordinator is a critical component of a Zigbee network, responsible for initiating and managing the network. There is only one coordinator per network, and it assigns unique addresses to each device, maintains routing tables, and controls overall network operation.
Router
Routers are Zigbee devices that can relay data between other devices in the network. They have the ability to extend the range of the network by acting as intermediaries between devices that are not within direct communication range of each other.
Links
Bootloader
https://github.com/JelmerT/cc2538-bslZ Stack Firmware - coordinator & router
https://github.com/Koenkk/Z-Stack-firmware/releasesInstall required software
sudo nala install -y python3
sudo nala install -y python3-pip
Fix some parameters
sudo rm -rf /usr/lib/python3.11/EXTERNALLY-MANAGED
echo export PATH="$HOME/.local/bin:$PATH" >> ~/.config/zsh/.zprofileLog out and then back in for PATH change to take effect.
Install required Python plugins
pip3 install intelhex
pip3 install pyserial
pip3 install python-magic
pip3 install wheel
pip3 install zigpy-znpCheck device and add user to correct group
ls -aFl /dev/ttyUSB0
sudo usermod -a -G dialout $USERDownload and unpack the Bootloader software
curl -LSso master.zip https://github.com/JelmerT/cc2538-bsl/archive/refs/heads/master.zip
unzip master.zip
mv cc2538-bsl-master bootloader
rm master.zipDownload and unpack the coordinator software
curl https://github.com/Koenkk/Z-Stack-firmware/releases/download/Z-Stack_3.x.0_coordinator_20250321/CC1352P2_CC2652P_launchpad_coordinator_20250321.zip
unzip CC1352P2_CC2652P_launchpad_coordinator_20250321.zip
mv *.hex bootloader
rm CC1352P2_CC2652P_launchpad_coordinator_20250321.zipStop mosquitto and zigbee2mqtt containers (if running)
docker stop mosquitto
docker stop zigbee2mqttChange permissions on ttyUSB0 (resets on reboot)
sudo chmod 777 /dev/ttyUSB0
sudo chown $USER:$USER /dev/ttyUSB0Make a backup of existing firmware
python3 -m zigpy_znp.tools.nvram_read /dev/ttyUSB0 -o nvram_backup.jsonCompress and copy backup file to laptop
cd bootloader
python3 -m zigpy_znp.tools.nvram_read /dev/ttyUSB0 -o nvram_backup.json && tar -czvf backup.tar.gz nvram_backup.json
scp backup.tar.gz user@computer:~Install new firmware
python3 cc2538-bsl.py -p /dev/ttyUSB0 -e -v -w --bootloader-sonoff-usb CC1352P2_CC2652P_launchpad_coordinator_20250321.hexReboot system after flashing.