Flashing a Sonoff Zigbee Dongle P to be used as a router

I recently changed my Sonoff Zigbee Dongle P coordinator for a SMlight SLZB-06U. As it's a little bit more powerful 'antenna wise' , also being easier to update and install anywhere using a POE connection and so I had a Sonoff Dongle -P lying around doing nothing.

I'd seen posts about changing the Dongle to a router by flashing it, but every time I read these they were always too complicated to bother with, and then I came across the below post.

https://blog.bitscry.com/2025/05/07/adding-a-sonoff-zigbee-dongle-plus-p-router-to-zigbee2mqtt/

Now this post is perfect, and seemed easy to do. So to be honest I have just copied everything below, changed very little, apart from the sudo apt to sudo pacman as I flashed my dongle using CachyOS which is a Arch-based Linux and changed some pythons names as they are slightly different in Arch Linux and added permissions, because Arch requires a bit more explicit permission handling.

Install required package
sudo pacman -S python python-pyserial python-intelhex python-magic wget git unzip

sudo usermod -aG uucp yourusername
Note: If you run this command, you need to logout and back for it to be effective.
Note: If you are on Arch, the serial access often requires membership in the uucp group, which is consistent with Arch-style /dev/ttyUSB* access handling.

Install flashing software
cd ~ git clone https://github.com/JelmerT/cc2538-bsl/
cd ~/cc2538-bsl

Download router software
wget https://raw.githubusercontent.com/Koenkk/Z-Stack-firmware/refs/tags/Z-Stack_3.x.0_router_20221102/router/Z-Stack_3.x.0/bin/CC1352P2_CC2652P_launchpad_router_20221102.zip -O router-firmware.zip
unzip -j router-firmware.zip
mv CC1352P2_CC2652P_launchpad_router*.hex router-firmware.hex
Note This software is about three years old but I checked and it's still the latest version https://github.com/Koenkk/Z-Stack-firmware/releases

Identify the serial device. in my case is ttyUSB0
ls -l /dev/serial/by-id

Flash the dongle
python cc2538_bsl/cc2538_bsl.py -ewv -p /dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_aa6d4001718aef119ef720ccef8776e9-if00-port0 --bootloader-sonoff-usb router-firmware.hex

If all goes well, the dongle is now re-flashed. I unplugged it, set Zigbee2MQTT to Permit Join and plugged it back in. It joined immediately and I now have a decent router for the Zigbee mesh. In fact it works so well, I've gone and ordered a second dongle as I have sockets that all run USB outputs, so just perfect for another dongle / router.

So many thanks to Shinigami and his above article. I couldn't have flashed my dongle or written this post without his blog post. It saved me a lot of time :)

For info: I replaced an Aeotec-ZI by this Sonoff dongle -P, plugged in to a mains socket that also has a USB outlet integrated in it (I now have two, one at each end of the house). The latest dongle in the same room, same place as the Aeotec, it's far better, my nearby devices have far better LQI's

Like this post? Buy me a coffee!
Your support means a lot and helps me keep creating useful content ☕😊
https://buymeacoffee.com/minty95