ZigBee USB stick

CC2531 ZigBee USB Wireless Module, Model E18-2G4U04B manufactured by Ebyte

Flashing the CC2531 Z-stack firmware

The USB stick’s pinout diagram:

Assumptions

It’s assumed you already have an Operating System running on the Raspberry Pi and know your way around the command line.

Connecting the dongle to the Pi

With the Raspberry Pi turned off, plug the Dongle into an available USB port. Connect the Zigbee USB stick to the Raspberry PI GPIO:

ZigBee USB stick pinRaspberry Pi GPIO pin
GND39
RESET35
DC36
DD38

Once everything is connected up, you can power on the Raspberry Pi. Hopefully you won’t see any magic smoke escaping.

Flashing the firmware

The next step is to flash the Z-stack firmware to the dongle.

Sudo to root:

sudo su 

Install some dependencies:

apt-get install wiringpi git unzip

Change into the opt directory:

cd /opt

Clone the repo:

git clone https://github.com/jmichault/flash_cc2531.git

Change into the new directory:

cd flash_cc2531

Check the dongle is properly connected, by running the command below. It should return the ID as b524. If there is an error, check the connections!

./cc_chipid

In my case, I got ID 000. Problem was not caused by the connections, but by an outdated Raspbian and wiringpi library. Updating/upgrading solved it.

Download the latest firmware and unzip it:

wget https://github.com/Koenkk/Z-Stack-firmware/raw/master/coordinator/Z-Stack_Home_1.2/bin/default/CC2531_DEFAULT_20190608.zip
unzip CC2531_DEFAULT_20190608.zip

Erase and flash the firmware. It should take around 3 minutes:

./cc_erase
./cc_write CC2531ZNP-Prod.hex

Once you see “Flash Ok” you’ve finished flashing the firmware and can start using the dongle.

Credits

https://zigbee.blakadder.com/Ebyte_E18-2G4U04B.html

https://www.marrold.co.uk/2019/09/flashing-cc2531-zigbee-dongle-with.html

https://www.home-assistant.io/integrations/zha/