
Solving Sonoff/Zigbee Performance Issues
Zigbee-based smart home solutions can be incredibly powerful and flexible. With a single Zigbee Hub (no, I’m not looking at you Hue Bridge!), you can operate lights, sensors, switches, thermostats, and more.
However, if you’ve been in the smart home world long enough, you know that sometimes the simplest-sounding setup can turn into a hair-pulling adventure.
In this post, I’m going to walk through the challenges I faced for nearly 6 months using the Sonoff Plus Zigbee stick along with zigbee2mqtt and Home Assistant, and how I eventually resolved the issues
Spoiler: it involved firmware re-flashing and some config tweaks in zigbee2mqtt.
Signs Your Zigbee Network Is Having Issues
It took me a while to figure out why my Zigbee network kept crashing. The errors didn’t initially point to a clear cause, just generic errors such as Data request failed with error: 'MAC no ack' (233)
and Error: ZCL command 0xc498860000077cd3/1 genOnOff.off
Usually, after a reboot everything worked fine again, but that stability never lasted long. Other signs your Zigbee network is struggling:
- Unresponsive Devices: Some devices paired fine, but after a few hours they stopped reporting state.
- Random Disconnects: Certain Zigbee bulbs periodically dropped off the network. They would show as offline in zigbee2mqtt logs.
- Interference: High WiFi traffic can worsen the instability.
- Inconsistent Pairing: Some devices won’t pair unless they’re right next to the coordinator, and even then, they might fail mid-join.
From the logs, it looked like the devices kept leaving the network or struggling to send data. My coordinator wasn’t always at fault—sometimes the devices themselves simply dropped out, which made troubleshooting extra confusing.
Steps I Took Debugging
1. Checking Channel Conflicts
Zigbee networks often operate on channels 11–26. WiFi, on the other hand, uses 2.4 GHz channels that can overlap heavily. My WiFi router was on channel 6. To reduce potential interference:
- I changed the Zigbee channel (in zigbee2mqtt’s configuration) to 20, which is typically less crowded.
- While this helped slightly with stability, it still did crash.
2. Checking the USB Power Supply
I verified that my Raspberry Pi’s USB port provided enough power for the Sonoff stick. Using a cheap USB hub or an underpowered port can cause weird connection issues for any coordinator. Everything seemed fine, so I ruled this out.
3. Relocating the Coordinator
I was already using a USB extension cable to keep the Zigbee stick out-of-range of the server rack. Any metal housing or adjacent USB 3.0 ports can degrade the Zigbee signal. While this is a best practice and can help in many cases, it didn’t solve my particular issues.
4. Updating Firmware
After digging into the Zigbee2Mqtt GitHub project, I saw that others reported various stability problems with Sonoff or CC2652-based sticks—though not all errors were the same. One issue that was exactly the same was this one: https://github.com/Koenkk/zigbee2mqtt/issues/26375
Some developers suggested re-flashing the Sonoff stick with newer firmware. In my case, that finally got me a rock-solid Zigbee network—but note that I needed to re-pair ALL my Zigbee devices! Yes, it’s painful, but it can be the difference between a flaky network and one that works day in, day out.
Flashing Sonoff Zigbee Plus
If you’re using a Mac or Linux system, it’s fairly straightforward to flash your Sonoff stick. You can do the same on a Raspberry Pi or Windows machine, though the commands will differ slightly. Below is a summary of the essential steps.
Tip: Consider using a virtual environment for Python-based flashing utilities. This keeps your host OS clean and avoids dependency conflicts.
Prepare a Python Runtime Environment
Create a new Python Virtual Environment
1python3 -m venv .venv
Activate the Virtual Environment
1source .venv/bin/activate
Install the needed dependencies
1python3 -m pip install pyserial intelhex
Download the Firmware and Flasher Tool
Get the right firmware Refer to Z-Stack firmware documentation to figure out the exact image for your stick.
- For Sonoff Plus, I used
CC1352P2_CC2652P_launchpad_*.zip
, specifically theCC1352P2_CC2652P_launchpad_coordinator_20240710.zip
.
- For Sonoff Plus, I used
Download the flasher tool I used cc2538-bsl. Download and unzip the tool into a directory of your choice, then place the
.hex
firmware file in that same directory.
Your directory structure might look like:
1/Downloads/cc2538-bsl-master
2 ├─ .gitignore
3 ├─ .travis.yml
4 ├─ .venv
5 ├─ CC1352P2_CC2652P_launchpad_coordinator_20240710.hex
6 ├─ ...
7 ├─ cc2538-bsl.py
If you’re following along, it’s important to have the .hex
and .py
files in the same directory.
Connect and Identify Your Sonoff Stick
- Plug the Sonoff stick into your computer (or Pi).
- Identify its path via:
1ls /dev/tty* | grep usb
On macOS or Linux, you might see something like /dev/tty.usbserial-14320
.
Flashing the Firmware
Within your /Downloads/cc2538-bsl-master
directory, run:
1python3 cc2538-bsl.py -ewv \
2 -p /dev/tty.usbserial-14320 \
3 --bootloader-sonoff-usb \
4 ./CC1352P2_CC2652P_launchpad_coordinator_20240710.hex
You’ll see progress logs and a “Verified” message if it’s successful. Unplug your stick, reconnect it to your Home Assistant device, and move on to configuring zigbee2mqtt.
Next Steps With Zigbee2mqtt
After flashing newer firmware, you might run into initial startup issues with zigbee2mqtt—like conflicts over pan_id
. Many of these are detailed in the zigbee2mqtt docs. For me, the simplest approach was to let zigbee2mqtt generate a new PAN ID:
Once I applied this in my zigbee2mqtt/configuration.yml
and restarted zigbee2mqtt, it came up without errors. Unfortunately, I had to re-pair ALL my Zigbee devices, but after doing so, the network finally settled into a stable, predictable state.
Extra Config Tweaks for Stability
Although these tweaks are not necessary to solve the initial firmware issues, it may improve the performance and stability of your Zigbee network.
If you see random drop-offs or strange routing behavior, consider more advanced settings in configuration.yaml, such as:
network_key
: Ensures all devices use the same encryption key for communication.ext_pan_id
: Helps devices find and remain on the correct network, and is important for maintaining a stable and consistent mesh.
Additionally, USB extension cables, avoiding WiFi channel overlap, and adding main powered Zigbee repeaters (like smart plugs or bulbs) can drastically improve network reliability.
Conclusion
Zigbee is a powerful protocol, but each coordinator and device firmware can have its own quirks. After nearly half a year of frustration, I learned:
Firmware Updates Are Critical – Many reliability issues simply vanish once you’re on a newer firmware.
Re-Pairing Might Be Unavoidable – If you change important Zigbee parameters (like pan_id) or flash new coordinator firmware, it’s often best to just start fresh.
Channel and Interference Management – Make sure your WiFi and Zigbee networks aren’t clobbering each other.
Zigbee2mqtt Configuration – Adjusting settings like
pan_id
, andnetwork_key
can ensure a stable mesh.
In my case, re-flashing the Sonoff Zigbee Plus stick with updated firmware and letting zigbee2mqtt regenerate a new PAN ID resolved the instability.
The process required a complete re-pairing of devices, but that was a small trade-off for a rock-solid network.
If you’re struggling with similar problems, hopefully these steps—and a bit of patience—will help you tame your Zigbee mesh once and for all!