sudo apt install mosquitto mosquitto-clients
.sudo systemctl enable mosquitto
./etc/mosquitto/conf.d/*.conf
, e.g.:listener 1883 # allow remote access
allow_anonymous true # enable non-authenticated access
sudo systemctl restart mosquitto
.mosquitto_sub -v -t test/message
, publisher `mosquitto_pub [-h ADDRESS] -t test/message -m 'Hello'Here Sonoff Zigbee 3.0 USB Dongle Plus (ZBDongle-P) with CC2625P chip. Visible in my case as /dev/ttyUSB0 or by ID as /dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_*-if00-port0.
https://github.com/wirenboard/wb-cc2652p-flasher
.python cc2538-bsl.py --bootloader-sonoff-usb
:sonoff
Opening port /dev/ttyUSB0, baud 500000
Connecting to target...
CC1350 PG2.1 (7x7mm): 352KB Flash, 20KB SRAM, CCFG.BL_CONFIG at 0x00057FD8
Primary IEEE Address: xx:xx:xx:xx:xx:xx:xx:xx
https://github.com/Koenkk/Z-Stack-firmware/tree/master/coordinator/Z-Stack_3.x.0/bin
, file CC1352P2_CC2652P_launchpad_*.zip
.python -m venv .
, . bin/activate
, pip install pyserial
, pip install intelhex
, pip install python-magic
.python cc2538-bsl.py -e -w -v --bootloader-sonoff-usb CC1352P2_CC2652P_launchpad_coordinator_*.hex
:sonoff
Opening port /dev/ttyUSB0, baud 500000
Reading data from CC1352P2_CC2652P_launchpad_coordinator_20240710.hex
Firmware file: Intel Hex
Connecting to target...
CC1350 PG2.1 (7x7mm): 352KB Flash, 20KB SRAM, CCFG.BL_CONFIG at 0x00057FD8
Primary IEEE Address: xx:xx:xx:xx:xx:xx:xx:xx
Performing mass erase
Erasing all main bank flash sectors
Erase done
Writing 360448 bytes starting at address 0x00000000
Write 104 bytes at 0x00057F988
Write done
Verifying by comparing CRC32 calculations.
Verified (match: 0xd9dd0124)
The procedure works exactly the same way. The same python tool does the job.
In my case the tool was not able to find the respective COM port, so looking it up in the Device Manager and providing explicitly in the command line solved the issue: python wb-cc2652p-flasher-1.0.0\cc2538-bsl.py --bootloader-sonoff-usb -p COM6 -e -w -v SELECTED_IMAGE.hex
.
There is an alternative firmware for the ZBDongle, making it work as a router (repeater). The update procedure is identical as above, just the image is different: from https://github.com/Koenkk/Z-Stack-firmware/tree/master/router/Z-Stack_3.x.0/bin
the file CC1352P2_CC2652P_launchpad_router_*.zip
. After rebooting the dongle, it will automatically try to join a network and becomes visible as router:
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo bash -
.sudo apt-get install -y nodejs git make g++ gcc libsystemd-dev
.node --version
-> output v20.18.1
.npm --version
-> output 10.8.2
.sudo mkdir /opt/zigbee2mqtt
, sudo chown -R ${USER}: /opt/zigbee2mqtt/
.git clone --depth 1 https://github.com/Koenkk/zigbee2mqtt.git /opt/zigbee2mqtt
.cd /opt/zigbee2mqtt
, npm ci
-> output added 647 packages, and audited 648 packages in 8m
.npm run build
-> output > zigbee2mqtt@1.42.0 build > tsc && node index.js writehash
, pretty fast./opt/zigbee2mqtt/data/configuration.example.yaml
to /opt/zigbee2mqtt/data/configuration.yaml
:# Home Assistant integration (MQTT discovery)
homeassistant: false
permit_join: false
# Enable the frontend, runs on port 8080 by default
frontend:
port: 8888
host: 0.0.0.0
# MQTT settings
mqtt:
# MQTT base topic for zigbee2mqtt MQTT messages
base_topic: zigbee2mqtt
# MQTT server URL
server: 'mqtt://localhost'
# MQTT server authentication, uncomment if required:
# user: my_user
# password: my_password
# Serial settings
serial:
# Location of CC2531 USB sniffer
port: /dev/ttyUSB0
# Advanced settings
advanced:
# Let Zigbee2MQTT generate a network key on first start
network_key: GENERATE
# Let Zigbee2MQTT generate a pan_id on first start
pan_id: GENERATE
# Let Zigbee2MQTT generate a ext_pan_id on first start
ext_pan_id: GENERATE
log_level: info
npm start
:> zigbee2mqtt@1.42.0 start
> node index.js
Starting Zigbee2MQTT without watchdog.
[2024-12-16 15:34:15] info: z2m: Logging to console, file (filename: log.log)
[2024-12-16 15:34:15] info: z2m: Starting Zigbee2MQTT version 1.42.0 (commit #bc6eccf)
[2024-12-16 15:34:15] info: z2m: Starting zigbee-herdsman (2.1.9)
[2024-12-16 15:34:16] info: zh:zstack:znp: Opening SerialPort with {"path":"/dev/ttyUSB0","baudRate":115200,"rtscts":false,"autoOpen":false}
[2024-12-16 15:34:16] info: zh:zstack:znp: Serialport opened
[2024-12-16 15:34:17] info: zh:zstack:znp: Writing CC2530/CC2531 skip bootloader payload
[2024-12-16 15:34:18] info: zh:zstack:znp: Skip bootloader for CC2652/CC1352
[2024-12-16 15:34:44] info: zh:controller: Wrote coordinator backup to '/opt/zigbee2mqtt/data/coordinator_backup.json'
[2024-12-16 15:34:44] info: z2m: zigbee-herdsman started (reset)
[2024-12-16 15:34:44] info: z2m: Coordinator firmware version: '{"meta":{"maintrel":1,"majorrel":2,"minorrel":7,"product":1,"revision":20240710,"transportrev":2},"type":"zStack3x0"}'
[2024-12-16 15:34:44] info: z2m: Currently 0 devices are joined.
[2024-12-16 15:34:44] info: z2m: Zigbee: disabling joining new devices.
[2024-12-16 15:34:45] info: z2m: Connecting to MQTT server at mqtt://localhost
[2024-12-16 15:34:45] info: z2m: Connected to MQTT server
[2024-12-16 15:34:45] info: z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/bridge/state', payload '{"state":"online"}'
[2024-12-16 15:34:45] info: z2m: Started frontend on port 0.0.0.0:8888
[2024-12-16 15:34:45] info: z2m: Zigbee2MQTT started!
Next: Raspberry Pi with SIM7600X 4G HAT as a router