I’ve replaced my old coordinator hardware with CC2530 with an external antenna and therefore one of CC2531 was not used.
The guys on GitHub asked me to make a router firmware for СС2531 too. I’ve spent some time and prepared 3 variants:
- CC2531-router.hex – just a router, without diagnostics and a USB serial port.
- CC2531-router-diag.hex – a router with diagnostic reports and without a USB serial port.
- CC2531-router-diag-usb.hex – a router with diagnostic reports and a USB serial port. The firmware dumps diagnostic reports to the serial port too.
Note: this firmware is for simple CC2531 boards without additional RD front-ends.
Buttons:
SW1 – Changes a virtual state of the router (the router sends it in a diagnostic report) and a state of the green light.
SW2:
- Short single press – to re-send a binding request to a coordinator (it allows you to test a connection).
- Long single press (about 5 seconds) – to reset the router and initiate a joining process.
Lights:
Green light – a short blink when the router connected to a network.
Red light:
- short fast blinks (one per second) – the router is connecting to a network.
- long blinks (one short flash per 4 seconds) – normal operations.
- three short blinks – the router cannot send a report to a coordinator.
How to use
1. Download and flash the firmware.
2. Power off/on (restart) the router.
3. Permit joining to a network on your coordinator.
===========================
UPDATE 2018-09-26
1. Allows a router to use all possible channels (the old firmware was used the channel #11). But now, the router will take more time to connect to a coordinator.
2. A router may report link quality for all connected neighbors.
UPDATE 2019-02-04
1. The previous version allowed to join for deleted devices.
2. СС2530 can be re-paired if you power on/power off it three times (power on, wait 2 seconds, power off, repeat this cycle three times).
John
I have a xiaomi sensor which is sometimes out of range of the xiaomi gateway.
Is it possible to add this router between an existing Xiaomi sensor and the Xiaomi gateway?
If yes, what will be the procedure to make this work ?
How do I connect the router to the gateway and how connect the sensor to the router?
Owner
Sorry, this router was designed for networks based on alternative gateways (not the Xiaomi gateway). I didn’t test it with the Xiaomi gateway.
John
I can confirm it is working as a router with a xiaomi gateway.
Thomas
How did you link it?
Peter
How did you connect it to the Xiaomi Gateway?
Owner
I’m sorry, but I didn’t try my routers with Xiaomi Gateways.
Tiago
Hello,
I’m having the following error when connecting the CC2531 as a router (connecting to another CC2531)
It was working before, until I add some IKEA devices. Then this error start. I’ve deleted all config from zigbee2mqtt a number of times, trying to find the device that was causing the problem. I then arrive to the CC2531 with router firmware as it is the only one connected. The error is:
2018-6-15 17:48:57 INFO Currently 1 devices are joined:
2018-6-15 17:48:57 INFO 0x00124b0012013a42 (0x00124b0012013a42): CC2530.ROUTER – Texas Instruments [CC2530 router](http://ptvo.info/cc2530-based-zigbee-coordinator-and-router-112/) (Router)
2018-6-15 17:48:57 INFO Connecting to MQTT server at mqtt://192.168.1.201:1883
/app/lib/zigbee.js:79
this.shepherd.find(device.ieeeAddr, 1).getDevice().update({
^
TypeError: Cannot read property ‘getDevice’ of undefined
at devices.forEach (/app/lib/zigbee.js:79:55)
at Array.forEach ()
at Zigbee.handleReady (/app/lib/zigbee.js:77:17)
at emitNone (events.js:106:13)
at ZShepherd.emit (events.js:208:7)
at Immediate._onImmediate (/app/node_modules/zigbee-shepherd/lib/shepherd.js:89:18)
at runCallback (timers.js:789:20)
at tryOnImmediate (timers.js:751:5)
at processImmediate [as _immediateCallback] (timers.js:722:5)
npm
ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! zigbee2mqtt@0.1.0 start: `node index.js`
npm ERR! Exit status 1
npm
ERR!
npm ERR! Failed at the zigbee2mqtt@0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2018-06-15T16:48:57.983Z pm2:client Calling daemon method pm2:getMonitorData on rpc socket:/root/.pm2/rpc.sock
Any ideas on how to proceed?
thanks,
Tiago
Owner
Hi,
This problem is not related with the firmware directly. I’m using the same routers in my home without any problems. Unfortunately, I don’t have IKEA devices to examine this problem more deeply.
Adrian
Quick question regarding the CC2531 router, is the channel hardcoded?
i am using zigbee2mqtt and in the config you can set the channel, i tried changing to a zigbee channel far away from my wifi 2.4g channels to help remove any interference. i can successfully pair any device except the router when i have a channel specified in the config file, removing channel in config file, the router does pair with the coordinator. any ideas?
Owner
Yes, the channel number (11) is hardcoded in the current version.
Adrian Bishop
Thanks for confirming it, thought i was going mad trying to get it to pair. Will it be possible to change in a future update?
Owner
I will try to solve this problem after summer holidays.
John
Did you already have time to change this?
Owner
Yes, I’m working on it right now :). But I cannot estimate the release date of this update.
John
Does this mean it will only connect with a coordinator on channel 11?
Or is this only used for a device connecting to the router?
Owner
All devices in one Zigbee network use the same channel number. If the channel number is different then this is another (different) network with another coordinator.
kaelsaes
Hi,
I paired successfully the CC2531 router with the CC2531 coordinator.
Do I have to delete manually the Xiaomi devices from the coordinator and re-pair them with the router?
Thanks.
Owner
This is not necessary. In any case all devices must be paired with a coordinator.
Stefano
I have one question, i have about 32 devices in my network and one coordinator with normal fw and one router, CC2531 but i can’t add other device… it seems that the coordinator have no more slots… is possible? if yes how can i do to add more devices via the router instead of the coordiator?
i have also created an issue here with some useful images for debug.
https://github.com/Koenkk/zigbee2mqtt/issues/2405
Thanks a Lot
kaelsaes
Okay, thanks.
But how does the router work?
Some of my Xiaomi devices are loosing the connection to the coordinator no matter if the router is installed or not.
Owner
The router works like repeater. You must place it in the middle between the coordinator and your device.
John
Is the source also available?
Owner
Sources (ZStack) you can freely download from the TI website.
John
I mean the sources with your adjustments 🙂
Owner
The license agreement does not allow to share Zstack source code.
John
Can you tell me which sample? application you used as source for this router?
And can you also tell me which symbols you used (like you described on the CC2530 based Zigbee coordinator and router blog)?
Thanks in advance
Owner
Hi,
This is the sample “SampleLight” source code. It is necessary to change files in the “HAL-Target” group in the project workspace (compare with the ZNP project). I’ve used the following symbols:
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
TC_LINKKEY_JOIN
NV_INIT
NV_RESTORE
xHOLD_AUTO_START
xZTOOL_P1
MT_TASK
MT_APP_FUNC
MT_SYS_FUNC
xMT_ZDO_FUNC
xLCD_SUPPORTED=DEBUG
HAL_LCD=FALSE
HAL_SPI=FALSE
MULTICAST_ENABLED=FALSE
ZCL_READ
xZCL_WRITE
ZCL_REPORT
xZCL_EZMODE
ZCL_BASIC
xZCL_IDENTIFY
ZCL_ON_OFF
xZCL_SCENES
xZCL_GROUPS
xZCL_LEVEL_CTRL
xZCL_DIAGNOSTIC
ZCL_DISCOVER
FEATURE_SYSTEM_STATS
MT_UART_DEFAULT_BAUDRATE=HAL_UART_BR_115200
MT_UART_DEFAULT_OVERFLOW=FALSE
HAL_LED=TRUE
MT_UTIL_FUNC
HAL_KEY=TRUE
ZSTACK_MANUFACTURER_CODE=4447
BLINK_LEDS
HAL_UART=FALSE
kaelsaes
Thanks.
But how can I check if the router works correct?
As I said I can’t see a positive effect when the router ist paired with the coordinator. Some devices are still having problems sending data to the coordinator even if the router is placed in the same room.
I flashed the third version of your firmware although I only use a CC2531 with a USB charger. Is this okay?
Thanks.
Owner
Yes, you need cc2531 and a power plug only for the router.
The debug version of my firmware (with USB and diagnostic messages) can output debug messages to the USB port. You may use any com port terminal and capture these messages (a portable computer is required). There you may see devices in the field of view of the router. The Cc2531 router can cover 5-15 meters.
kaelsaes
Are your routers building up a mesh network?
Can I cascade several routers?
Is the CC2531 router only pairing with a CC2531 coordinator or can it also pair with a HUE ZigBee bridge?
Thanks
Owner
Mesh network: yes
Cascade: yes
HUE bridge: I don’t know. I didn’t use it.
lolorc
Hi,
I don’t really get what’s the purpose of SW1.
Any idea on why a CC2531 router pairs perfectly with a CC2531 coordinator and not with a CC2530+CC2591 coordinator ?
Owner
Is it possible a channel number is not 11?
lolorc
Hi,
I’ve read about this issue in the comment, but zigbee2mqtt says it’s using channel 11 and I’ve not specified any channel in its config;
I can try to force it to 11 in the config and see if I have to rebind the devices.
lolorc
I’ve just specified it to be 11 even it’s it’s the default in zigbee2mqtt, still working with the devices, still no luck with the router. I guess I should try to run a sniffer to see if it’s really using channel 11.
The firmware I’m using on the cc2530+CC2591 is https://github.com/Koenkk/Z-Stack-firmware/blob/master/coordinator/CC2530_CC2591/bin/CC2530_CC2591ZNP-Prod.hex
lolorc
hi,
as far as I tested the channel is 11, I’ve forced the channel to 11 with zigbee2mqtt, then devices were still paired. so I guess the channel is really 11. I’m trying to run a zigate (jn5168) a sniffer but documentation is *beeep* as hell. I guess my next tries will be to recompile cc2530+cc2591 firmware myself and see what I can alter/enable/disable to make them work all along.
Owner
Hi,
Unfortunately, I don’t have this hardware device and I cannot test this coordinator. Did you try a firmware file where “Security LinkJoin” words exist in the file name? (like CC2531ZNP-Pro-Secure_LinkKeyJoin.hex)
lolorc
Hi,
I haven’t found such firmware, I guess I’ll have to compile it myself.
John
If you download zstack then you can find it here: Z-Stack Home 1.2.2a.44539\Projects\zstack\ZAP\ZNP-HexFiles\CC2530
TLu
License preventing sharing share Zstack source code but we can still share diff files. With TI’s source & your patch files it would be possible to anyone to participate development and to it maybe a bit more better.
Example i’m interested to replace xiaome coordinator with any solution where source code is available as i need to maintain system 10-20 years and without source code it’s not really possible.
Im also interested to connect one wire temperature sensors directly to CC2531 but it’s not worth to do if system is not public. (I currently have my totally own made zigbee network in home and i can expand it but i would like use some not so proprietary stuff)
baerengraben
Thank you for your work! I got two Sticks (one coordinator and one router) working! Amazing Job, thumb up!!!
Kirov Ilya
Hey. Thanks for the router firmware.
I and many others use it. But there is one remark.
The current firmware does not send a list of nearby devices in response to the request of mgmtLqiReq, but the other zigbee-routers do this. As a result, the list of connected devices and the quality of communication to them are not visible. I use this to build a network map.
https://github.com/ioBroker/ioBroker.zigbee/issues/40#issuecomment-414063084
Could you share the source code of the firmware or a method how to assemble the firmware so that I can experimentally try to fix the situation. You can send it personally to the emal.
Or, try to assemble the firmware from MT_ZDO_MGMT, it is possible in this case will be sent the necessary information.
Owner
Hi Ilya,
I’ve used the “SampleLight” example and didn’t remove anything. MT_ZDO_MGMT is not specified in the project settings (C compiler – Preprocessor).
Tiago
Hi Kirov,
I’m having the same issue. Ever got to solve this?
thanks
Tiago
kaelsaes
Hi,
is it possible that my CC2531 with your new firmware connected inadvertently with my HUE bridge which uses zigbee channel 25 ?
Thanks.
Owner
Hi,
Yes, this is possible if your bridge permits joining. The router connects to the first found network that permits joining.
Kai
Hi,
what are the numbers in the filename of the zip file?
Would it be possible to add the release date into the filename?
Thanks
Owner
Hi,
The release data exists in the file path 🙂
John
The router is blinking red every 4 seconds. I see this message through usb (I use diag_usb):
0/0x00158D0002280C3A,COORD,Depth:0,Assoc:0
Does this means the router is connected to my coordinator?
Should I also see messages from a sensor connected to the same coordinator through debug on this router?
Or will a sensor only connect through a router when it cannot connect to the gateway itself?
Owner
Hi,
Yes, this info means that the router was connected to your coordinator. The router will also output info for neighbors.
John
Can I see when a sensor is connected to the router and the router is sending the sensor message to the coordinator?
Or will a sensor only connect through a router when it cannot connect to the gateway itself?
Owner
The sensor searches for the best path to a coordinator. Therefore it may connect to your coordinator directly. If your sensor will appear in the field of view of your router you’ll see a message in router output.
John Brattinga
Just to make sure:
I have a router, coordinator and sensor all in 1 meter range of each other.
I think the router is connected to the coordinator because I see these messages on the router (cc2531) serial output:
0/0x00158D0002280C3A,COORD,Depth:0,Assoc:0
0/0x00158D0002280C3A,COORD,Depth:0,Assoc:0
0/0x00158D0002280C3A,COORD,Depth:0,Assoc:0
Now I activate the sensor. With a sniffer I see the sensor sending and it is received on the coordinator.
But I don’t see anything on the router output.
Should this not be the case?
If yes what should be wrong?
Owner
Hi,
The sensor should appear as NEIGHBOR after some time. But in your case, the sensor will not use the router because it found a better path to the coordinator.
Peder
Good job.
Been looking through description and comments as I was searching for a way to disable to red blinking every 4th second. It this possible anyhow? E.g. by sending a mqtt message?
Owner
Hello,
I’m sorry, but this is not possible in the current version.
Peder
Okay. But would be an excellent feature.
Also – my router sends: ‘zigbee2mqtt/0x00124b0018ed3c96’, payload: ‘{“state”:false,”linkquality”:115}’
Is state:false correct?
Tiago Marques
Hello,
I’ve been using a cc2531 as a router, and noticed that some info gets lost when passing trough the router.
Checking graphviz output, the devices connected to the cc2531 router have no link information. They do work (if I take the router off they stop working) but without router info.
“0x00158d0001a64b58″ [label=”{0x00158d0001a64b58|EndDevice|Xiaomi Aqara temperature, humidity and pressure sensor (WSDCGQ11LM)|online}”];
“0x00158d0001a36711″ [label=”{0x00158d0001a36711|EndDevice|Xiaomi Aqara temperature, humidity and pressure sensor (WSDCGQ11LM)|online}”];
“0x00158d0001a36711” -> “0x00124b0012022458″ [label=”41”]
In this example only the second sensor has the origin of the package. 0x00158d0001a36711 (xiaomi sensor) -> delivered to 0x00124b0012022458 (coordinator)
there should be a line for the 0x00158d0001a64b58 sensor like: “0x00158d0001a64b58” -> “0x00124b0012013a42″ [label=”41”], where 0x00124b0012013a42
is the CC2531 Router
Is there a way we can pass this info? I’ll leave the entire graphviz output in this link: https://hastebin.com/ipuhosidil.bash
thanks for your great work on this firmware
Owner
Hello. I’ve fixed this problem in the latest firmware. Please, re-download and re-flash it.
Wael
Hi Can u please add a SBL version of the same firmware that can be uploaded by the serial boot loader for the people without a debugger
Owner
Hi,
In any case, you need a debugger for first uploading :).
Mihail
Sorry for the noob question, but how were these firmwares produced?
Owner
I use the Z-Stack 1.2.2 from Texas Instruments and the corresponding compiler.
Adam
I’m hoping you can help.
I flashed the latest router firmware using Texas Instruments Flash Programmer (v1).
I enable joining on my zigbee2mqtt
I used the USB debugging and this is what I get over and over from Putty:
PANID:EE00,Ch:11,Join:0
PANID:1A62,Ch:11,Join:1
PANID:13B,Ch:15,Join:0
PANID:D6B,Ch:20,Join:0
PANID:31AB,Ch:25,Join:0
But the router will not join the coordinator. I’ve tried pressing SW2 and then holding for 5 seconds and neither does anything.
What can I try next?
Owner
Hi,
The router found several networks around, and the only one allows to connect.
PANID:1A62,Ch:11,Join:1
Is it your network based on zigbee2mqtt? Is it possible this is a Xiaomi gateway?
Try to change a channel number in the zigbee2mqtt settings (if you didn’t pair other devices yet).
Wael Eweda
Am having issue where my end devices are not connecting to my routers ( the are Xiaomi Switches and Sensors ) where they are with a 5 cm radius wile my router is getting connected the router with out any issues
Owner
The end devices search for the best path to the coordinator. Is it possible, there is no reason to send data through the router.
Wael Eweda
The signal if very week i got a netowrk map from zigbee2mqtt the link level is 2 and it is still connected to the cordinator
Quatuor
I’m using CC2531-diag as a router for Homeassistant zha and I see the router sending some information on ZCL cluster id 0x11. Where I can find formatting of those messages, like fields and fields data type/descriptions?
Owner
Search for ‘genBinaryValue’ here:
http://ptvo.info/cc2530-based-zigbee-coordinator-and-router-112/
Owen
I’ve flashed a CC2531 with the latest firmware but it’s having trouble joining. The red light just keeps flashing every second or so.
The serial debug shows the following:
PANID:1A62,Ch:11,Join:1
PANID:1A62,Ch:11,Join:1
PANID:1A62,Ch:11,Join:1
PANID:1A62,Ch:11,Join:1
PANID:1A62,Ch:11,Join:1
PANID:1A62,Ch:11,Join:1
PANID:1A62,Ch:11,Join:1
This is the correct network, if I cycle joining on/off the Join:1 turns to Join:0.
I’ve tried it with a spare CC2531 and it isn’t working either.
I’ve got 16 sensors on the base coordinator and I can see MQTT traffic so I know there’s life there.
Any ideas on how to get the new router(s) to join the mesh?
Owner
Sorry, I don’t have ideas. It looks the coordinator does not accept a connection.
Mific
Hello,
I have an end device (Xiaomi Aqara) paired with my CC2531 coordinator. Everything is OK.
I power on my CC2531 router (flashed with the latest firmware). The router is correctly paired to my CC2531 coordinator => see debug traces
0/0x00124B0014B93838,COORD,Depth:0,Assoc:0
0/0x00124B0014B93838,COORD,Depth:0,Assoc:0
0/0x00124B0014B93838,COORD,Depth:0,Assoc:0
…
but the end device is not seen by the router (is it normal ?).
Then I try to re-paired my end device with the router (I put the end device close to the router but the router far away – 10m – from the coordinator). The traces are as follows :
0/0x00124B0014B93838,COORD,Depth:0,Assoc:0
19105/0x00158D000204719F,CHILD_RFD,Depth:2,Assoc:0
0/0x00124B0014B93838,COORD,Depth:0,Assoc:0
19105/0x00158D000204719F,CHILD_RFD,Depth:2,Assoc:0
0/0x00124B0014B93838,COORD,Depth:0,Assoc:0
19105/0x00158D000204719F,CHILD_RFD,Depth:2,Assoc:0
…
Any ideas on how to get the router to transmit data to the coordinator ?
Owner
It is possible, your device prefers the direct path to the coordinator.
Hai
I upload fw for C2531 as router but can’t connect to coordinator (red led blink quickly).
My coordinator also use other C2531. Please help me.
Owner
Please, check the following: your coordinator allows joining, the distance between the router and the coordinator is short.
Santi
I have the same issue, router red blinking and not pairing with coordinator at all, any advice?
Thank you!
Mike
Hi,
Could you please explain a bit more about what SW1 does? What does the “virtual state of the router (the router sends it in a diagnostic report)” mean? Does it route the same way in both states? (I see that it’s sending a different value of onOff which gets translated into state in HA by zigbee2mqtt, but what does this actually *mean*?)
Thanks
Owner
Hi Mike.
It means nothing important. It is the state of the green led.
Mike
ok, thanks! I saw some people saying it mattered, some it didn’t… I didn’t see any change, but I wanted to make sure I wasn’t missing something 🙂
Alec
Hello and thank you for making this great firmware.
I am using your CC2531 router firmware with deconz. It is all working fine, but I would like to disable the once per 4 sec blinking red light. I see from the previous comments that in October 2018 someone also requested this feature.
Do you have plans to implement it?
Owner
It is necessary to send the report configuration request to the coordinator, where maxInterval = minInterval = 65535. Below is the example for zigbee2mqtt:
2
3
4
5
6
7
8
9
10
11
12
13
14
15
const value = 65535;
return {
cid: cid,
cmd: 'configReport',
cmdType: 'foundation',
zclData: [{
direction: 0,
dataType: zclId.attrType(cid, attrId).value,
attrData: value,
minRepIntval: value,
maxRepIntval: value,
}],
cfg: cfg.default,
};
Paul
noob question, but how do I do that?
Owner
Hello,
Do you mean to assemble it from various parts physically?
Alessio Di Cataldo
How can I be sure that my end devices (sensors) are connected by the Router.
I have two sensors near to the router that have a very low linkquality and sometimes they will lose the connection.
The router seems correctly recognized:
zigbee2mqtt:info 7/27/2019, 7:10:03 PM MQTT publish: topic ‘zigbee2mqtt/Router_1’, payload ‘{“state”:true,”led_state”:false,”linkquality”:0,”description”:”0/0x00124B00193678AB”,”type”:”COORD”,”rssi”:2}’
Owner
It seems the link quality between the router and the coordinator is bad (RSSI = 2). It should be at least 20-30.
marrold
Hi, you mention a 2019-02-04 update, but the file hosted on the blog and Koenkk’s github page reference the older, 2018 version. Is the 2019 version hosted anywhere?
Thanks
Owner
Hi, the latest version is hosted on my website. The date in the link does not matter. Just download the file.
Ivan Conde
Hi!
Thank you very much for this great firmware. How many direct device connections does it support? I want to have an idea on how many routers do I need.
Best regards
Owner
Hi Ivan,
The router firmware support 18 direct devices.