In the article Zigbee – Preparing a Sonoff zigbee 3.0 USB Dongle Plus for zigbee2mqtt, I described how to write the firmware for zigbee2mqtt to a Zigbee stick from Sonoff.
An alternative to this Zigbee stick is the Electrollama zig-a-zig-ah! (zzh!) Coordinator USB stick by Electrolama
I have described in the following article how flashing works with this stick
Safety instructions
I know the following hints are always a bit annoying and seem unnecessary. But unfortunately, many people who knew it "better" from carelessness lost their eyes, fingers or other things or hurt themselves. In comparison, a loss of data is almost not worth mentioning, but even these can be really annoying. Therefore, please take five minutes to read the safety instructions. Even the coolest project is worth no injury or other annoyance. https://www.nerdiy.de/en/sicherheitshinweise/
Affiliate links / advertising links
The links to online stores listed here are so-called affiliate links. If you click on such an affiliate link and store via this link, Nerdiy.de receives a commission from the online store or provider concerned. The price doesn't change for you. If you do your purchases via these links, you will support Nerdiy.de in being able to offer further useful projects in the future. 🙂
Requirements
Helpful articles:
Before you start with this article, you should have prepared a RaspberryPi so that it can be reached via the network and controlled via SSH. In addition, zigbee2mqtt should of course already be installed.
The following articles describe what needs to be done to prepare the RaspberryPi.
- Zigbee – Installing zigbee2mqtt on the Raspberry Pi
- Zigbee – Register devices, sensors and actuators with zigbee2mqtt
- Zigbee – Administration of Zigbee2mqtt via the dashboard
In the following lists you will find all the parts you need to implement this article.
Required tool:
Number | Link |
---|---|
1x | screwdriver set Buy at Amazon |
1x | SD card reader Buy at Amazon |
Required material:
Number | Link |
---|---|
1x | https://electrolama.com/projects/zig-a-zig-ah/ |
1x | USB extension cable Buy at Amazon |
1x | Raspberry Pi Buy at Amazon |
1x | Raspberry Pi power supply Buy at Amazon |
1x | Raspberry Pi housing Buy at Amazon |
1x | MicroSD card 64GB Buy at Amazon |
Download flashing software
So that you can flash the Zigbee USB stick with the appropriate firmware, you must first download the appropriate software. This later helps to copy the actual firmware to the USB stick.

To do this, open the Texas Instruments website (this is the manufacturer of the IC used and the associated flash software) under the following link.
Then click on the download button…

In the window that opens you should then select the option
"Windows Installer for SmartRF Flash Programmer"

At this point you have to verify yourself with a TI account.
This account can be created for free. Simply follow the link below
"Register now".

After that you should be redirected to the shown view. Here you can click on the download button shown …

You now have to install the downloaded software.
In the following article I have described how to proceed with the installation of a program under Windows.

During the installation it may happen that the window shown is displayed. This is only an indication that additional drivers will be installed and can be confirmed by clicking on "Install".
Download correct firmware
But before you can start the flashing process, you must first download the correct firmware version. This depends on the chip used and the desired configuration. In most cases, however, you can use the firmware linked below.

Under the following link you will find an overview of the available firmware versions and the associated hardware.
The current firmware version is also linked here.
Alternatively, the current firmware version is linked under the following link.
Activate the boot loader of the USB stick
Now only one last step is necessary to prepare the USB stick for the flash process. So that this can be equipped with the new firmware, you have to activate the bootloader. This is a small program component of the firmware currently installed on the USB stick, which helps to transfer the new firmware to the USB stick.
To activate the bootloader, you have to press and hold the small button on the stick's circuit board and then plug it into the USB port while holding down the button.
You should now connect the Zigbee USB stick to your computer at the latest.

So navigate to the GIT repository linked above and copy the python script uartLog.py to your computer.
I have described how you can download files from a GIT repository using an example in the following article.
After you have downloaded the script you can start it. To do this, open a command prompt, navigate to the location of the script and run the following command.
python uartLog.py
You may have to install the pySerial and/or gevent library for a successful start. To do this, you need to run the following commands.
pip install pyserial
pip install gevent

The script will now perform a few simple steps and then list all the connected COM ports. Here it can happen that more than one COM port is found. In this case you have to specify the COM port that belongs to your Zigbee USB stick.
If your USB stick is not recognized there, you may first have to install the appropriate driver. You can find the driver under the following link. (Thanks to Christopher for the rear. 🙂 )

In this example you can recognize the correct COM port by the line with the entry
Silicon Labs CP210x USB to UART Bridge
i.e. COM14
If you have several devices with this entry, it is easiest if you first disconnect all other devices from the computer, restart the script and then continue.

In any case, you must enter the number of the associated COM port and confirm with Enter.
In the example shown here, "14" for COM14.
The script then carries out all the necessary steps to activate the bootloader on your USB stick.
Important: From now on you may no longer disconnect the USB stick from your computer. If so, you have to run the script again to reactivate the bootloader.
Start flash process
Now you can (finally) start the flashing process. To do this, start the previously installed software – if you haven't already done so
- SmartRF Flash Programmer 2

In the view shown, you should select your Zigbee USB stick again in the upper left corner. You can recognize this by the entry
Silicon Labs CP210x USB to UART Bridge
Then select the entry "Unknown" below.

After that you should select the IC used on the Zigbee USB stick. In this case, that's the one
CC2652P
Select the relevant entry in the list below on the left.

This step is optional:
If you migrate from another Zigbee stick and want to transfer a known MAC address directly to the USB stick, you have to go to the tab
MAC Address

This step is optional:
Then enter the desired MAC address in the text field for "Secondary Address". Attention: In the picture the wrong text field is marked! The correct text field is the one with the label "Secondary Address".
You can find more information about this in the article

You can then select the firmware to be flashed by clicking on the button
- Browse
You downloaded the firmware in one of the previous steps.

Now you can start the flash process.
To do this, tick the boxes as shown and click on the marked arrow button.

As soon as this has been successfully completed, the following message will appear in the read ammarked area
- Success!
Update zigbee2mqtt configuration file
So that zigbee2mqtt knows at which address it can address the new Zigbee USB stick, you now have to configure the configuration file of zigbee2mqtt correctly.
In order for this to work, you should now connect your Zigbee USB stick to the Raspberry Pi on which zigbee2mqtt is installed.
In the example shown, only one USB stick is connected, which is why only one entry is displayed here.
If there are several entries there, you should select the entry with the identification string for the "select zzh stick".
Copy the complete line here:
- /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0
and save them in a text file, for example, so that you can later insert them into the configuration file.

Now open the configuration file of zigbee2mqtt by entering the following command.
sudo nano /opt/zigbee2mqtt/data/configuration.yaml

You must now paste the previously copied address for your Zigbee USB stick into the configuration file as shown in the example.
Make sure that the indentation is correct and that there is only one entry under the "port:" category.
Now save the changes in the configuration file
- CTRL-X, Y and Enter
Restart zigbee2mqtt to apply the changes
In order to apply the changes to the configuration file, you should now restart your zigbee2mqtt installation.
Zigbee2mqtt should now restart and the configured Zigbee USB stick should be available. In the following articles I have described how you can add Zigbee sensors or actuators and administrate zigbee2mqtt via a simple dashboard.
- Zigbee – Register devices, sensors and actuators with zigbee2mqtt
- Zigbee – Administration of Zigbee2mqtt via the dashboard
In the following category I have also listed other Zigbee devices which can be controlled or read out with the NodeRed code offered there.
More articles on the topic
I have summarized other articles on the subject of Zigbee and zigbee2mqtt in the following category. There you will also find articles on various Zigbee devices and how they can be controlled from NodeRed.
External links:
- https://www.zigbee2mqtt.io/guide/adapters/#flashing-cc1352-cc2652-cc2538-based-adapters
- https://www.zigbee2mqtt.io/guide/adapters/#recommended
Have fun with the project
I hope everything worked as described. If not or you have any other questions or suggestions, please let me know in the comments. Also, ideas for new projects are always welcome. 🙂
P.S. Many of these projects - especially the hardware projects - cost a lot of time and money. Of course I do this because I enjoy it, but if you appreciate that I share this information with you, I would be happy about a small donation to the coffee box. 🙂