CC2530 based Zigbee coordinator and router

Introduction

My smart home infrastructure contains several Xiaomi humidity/temperature and door sensors. I’ve used these sensors with the corresponding Xiaomi gateway. The gateway was connected with my BananaPi M2U and Pimatic. But my home is long and tall. One gateway does not cover all rooms, and therefore far sensors disappear periodically.

I’ve googled and found I can use Xiaomi sockets (Zigbee edition) like Zigbee routers. This socket is less expensive than a new gateway, and it has a smaller size. I’ve purchased two sockets and used them for about a month. This socket has a big problem (from my standpoint). It can go into the deep sleep mode and cannot forward data packets from sensors.

I’ve decided to use a CC2530 based development board and build my router. Aliexpress.com offers some variants. I’ve purchased two samples:

cc2530 board with debug interface
cc2530 board with the debug interface
cc2530 compact board with antenna
cc2530 compact board with the external antenna

1. This board will be used in my Zigbee router.

2. This board will be used in Banana Pi as a coordinator instead of the CC2531 USB stick. This board has an external antenna, and I hope it will work better.

Firmware for Zigbee Coordinator

Z-Stack Home Automation SDK 1.2.2a comes with a precompiled firmware for CC2530 ZNP (Projects\zstack\ZNP\CC253x\bin\CC2530ZNP-SB.hex), but all my attempts to launch it on my samples failed. The gateway software xiaomi-zb2mqtt cannot detect and work with boards through a UART port.

RS232 pins:

P0_2 <=> RS232 RX
P0_3 <=> RS232 TX
P0_4 <=> RS232 CTS
P0_5 <=> RS232 RTS

The precompiled firmware uses hardware flow control wires. If you do not want to use it, you must connect P2_0 (CFG1) to GND.

So I’ve installed the trial version of IAR Embedded Workbench for 8051 (CC2530 is based on this processor architecture) and compiled the “SampleLight” demo application as a coordinator. Yes, of course, it may take some time. Below are my defined symbols:

 SECURE=1
 TC_LINKKEY_JOIN
 NV_INIT
 NV_RESTORE
 xHOLD_AUTO_START
 ZTOOL_P1
 MT_TASK
 MT_APP_FUNC
 MT_SYS_FUNC
 MT_ZDO_FUNC
 HAL_LCD=FALSE
 xLCD_SUPPORTED=DEBUG
 MULTICAST_ENABLED=FALSE
 xZCL_READ
 xZCL_WRITE
 xZCL_REPORT
 xZCL_EZMODE
 xZCL_BASIC
 xZCL_IDENTIFY
 xZCL_ON_OFF
 xZCL_SCENES
 xZCL_GROUPS
 xZCL_LEVEL_CTRL
 xZCL_DIAGNOSTIC
 FEATURE_SYSTEM_STATS
 MT_UART_DEFAULT_BAUDRATE=HAL_UART_BR_115200
 MT_UART_DEFAULT_OVERFLOW=FALSE
 HAL_LED=FALSE
 HAL_SPI=FALSE
 MT_UTIL_FUNC
 MT_AF_FUNC
 MT_SAPI_FUNC
 MT_SAPI_CB_FUNC
 MT_ZDO_CB_FUNC
 MT_ZDO_FUNC
 MT_SYS_FUNC
 OSAL_SAPI=FALSE
 SAPI_CB_FUNC=FALSE
 xHAL_UART_DMA_RX_MAX=128
 MT_TASK_CUSTOM
 MT_ZDO_MGMT

How to use

Download and flash the firmware.

Baud rate: 115200
Hardware flow control: Disabled
P2_o pin state: ignored
P0_2 <=> UART (RS232) RX
P0_3 <=> UART (RS232) TX
UART port uses the DMA mode.
You may also connect to this port using ZTool.

Firmware for Zigbee Router

I’ve used the source code of the “SampleLight” demo application for my router’s firmware. I did some modifications and improvements:

  • The pre-configured manufacturer code for Xiaomi devices.
  • The pre-configured security key.
  • LED blinking for some states:
    • Short fast blinks (one per second) – the router is connecting to a network.
    • Short long blinks (one per 4 seconds) – normal operations.
    • Three short blinks – the router cannot send a report to a coordinator.
  • The router sends the “genOnOff” report to a coordinator every minute (you may configure an interval using the corresponding ZCL command). It works like a keep-alive message.
  • The debug version of the firmware additionally sends the “genBinaryValue” report for every neighbor in a network:
1
2
3
4
5
6
7
{
description: '28069/0x00158D0001DE7964',
inactiveText: 'PARENT',
presentValue: 6,
relinquishDefault: 1,
minimumOffTime: 0
}

description – network and MAC address.
inactiveText – device role in a network.
presentValue – RSSI value of the last received packet (rxLqi).
relinquishDefault (optional) – path depth.
minimumOffTime (optional) – number of associated devices.

Defined symbols from the project:

 SECURE=1
 TC_LINKKEY_JOIN
 NV_INIT
 NV_RESTORE
 xHOLD_AUTO_START
 ZTOOL_P1
 MT_TASK
 MT_APP_FUNC
 MT_SYS_FUNC
 xMT_ZDO_FUNC
 LCD_SUPPORTED=DEBUG
 xHAL_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
 DIAG_INFO_REPORT

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 2020-09-28

Added the “Aging” mode. The router forgets child devices that didn’t send any data for four hours. It helps when an end-device selects a new path to a 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 joining 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).


Comments
Harvey Specter
Posted at 14:52 March 1, 2024
Greg88
Reply
Author

Hi, just flashed bare Ebtye cc2530 as A router and joined ZHA network in HA instantly. Router firmware contains two entities light switch and reed sensor. Could you please share connection pins for those?

    Harvey Specter
    Posted at 06:38 March 2, 2024
    Owner
    Reply
    Author

    Sorry, but I cannot remember the actual pins for this old firmware. You can use my configurable firmware and build a router with the necessary features.

Harvey Specter
Posted at 15:15 February 10, 2024
Tom
Reply
Author

Hello there!

The .HEX files in the downloadable folder can’t be opened in your configurator. Am I overseeing something?

    Harvey Specter
    Posted at 03:32 February 12, 2024
    Owner
    Reply
    Author

    It is expected because it is a “template”. The program uses it internally, to create a firmware for your with your settings when you click “Save”.

Harvey Specter
Posted at 07:43 August 25, 2021
Fred
Reply
Author

Hello and huge thanks for great wotk!

Could i ask.i few questions?
1. I have flashed my spare cc2531 stick with latest router firmware from 2020, but still get thos date in z2m in HA
“Firmware build date
2018-09-26” is it ok?
2. I have connected the router with my cc2652p coordinator stick. It shows good link quality. But now i can not connect my xiaomi aqara sensors to the routers network. Could you share the exact manual how to do it? I have connected one of sensors once and but now not do it again.

Thanks a lot!

    Harvey Specter
    Posted at 05:45 September 1, 2021
    Owner
    Reply
    Author

    Hi,
    1. Yes, it is a known issue. Please, ignore the build date.
    2. Some Xiaomi devices do not like 3rd party routers. Sorry, but I cannot help here.

Harvey Specter
Posted at 04:48 February 6, 2021
Bdb
Reply
Author

I am running the latest version of HA (feb 2020). I have a deconz conbee II stick but running this using ZHA. All my devices connect and are running OK. I am trying to pair a ZigBee CC2530 + CC2592 Long Range Router as I have a few outdoor things. https://shop.codm.de/bundles/zigbee/router/25/zigbee-cc2530-cc2592-long-range-router-bundle-9cm/2.5dbi?c=7 1 I have two. Neither will pair despite the light sequences suggesting they are in the pairing mode. It simply does not complete the interview. I have looked in the logs but nothing stands out. Any help would muchly be appreciated,

Harvey Specter
Posted at 10:03 January 30, 2021
Karthick
Reply
Author

Hi, I have used your coordinator firmware for CC2530-CC2591, initially it is working good, I could able to add 20 lighting modules and it is working good until I restart the power to the coordinator device. Whenever there is a power restart to the coordinator then I am unable to control or get feedback from the devices. Do you have any fix for this?

    Harvey Specter
    Posted at 10:06 January 30, 2021
    Owner
    Reply
    Author

    Hello,

    I don’t have any ideas. Maybe, your coordinator lost a database with all connected devices or info about the network.

      Harvey Specter
      Posted at 04:19 February 1, 2021
      Karthick
      Reply
      Author

      Is that the basic behavior of your firmware? Because rest of the things are working well in your firmware except this, if you can check about this issue then it will be useful.

Harvey Specter
Posted at 20:09 January 29, 2021
CHB
Reply
Author

Hello PTVO,

I am looking for a router firmware that would also pass the packets thru the UART.

Would the coordinator firmware join a network created by another coordinator?
Would the coordinator firmware pass the received packets to the UART?

If not, do you have a firmware to recommend?

Thank you for your great work.

    Harvey Specter
    Posted at 05:52 January 30, 2021
    Owner
    Reply
    Author

    Hi,

    A Zigbee network may have only one coordinator. My router or end device firmware can send and receive UART data to/from a coordinator. But I’m not sure if it is applicable in your application.

      Harvey Specter
      Posted at 22:51 February 3, 2021
      CHB
      Reply
      Author

      PTVO,

      I am looking for the firmware that would enable to connect the CC2530 to a MCU (like Arduino, STM32, etc) thru the UART. In other words, a cheaper alternative to the Digi XBee modules.

      It seems that the router firmware only works as a router (repeater).

      Any suggestions on where to look for such firmware?

      Thank you for your help

Harvey Specter
Posted at 07:56 January 20, 2021
Dueller
Reply
Author

I changed my CC2531 coordinator with a Sonoff ZBBridge tasmota flashed. Now I flashed the spare CC2531 with the router-cc2531-std firmware (2020_09_29).
I use Home Assistant and ZHA. So I paired the new flashed router with my coordinator and now the ZHA map shows it linked with the corrdinator and all other bulbs/repeater.
Then the questions are:

1. in HA there are two new entities related to this cc2531 router: one light switch and one binary sensor (open/close). What is their purpose? In what way should I use them?

2. I cannot pair my sonoff door sensors through the cc2531 router. Sometimes they are found but don’t complete pairing. Is this the normal behavior?
Thank you

Harvey Specter
Posted at 21:06 November 20, 2020
Rolandow
Reply
Author

Thank you for your work! I wanted to extend my zigbee network range, so I flashed a CC2531 (because I had some left over) with the router firmware and put it in an enclosure. I see in my zigbee2mqtt logs and Home Assistant that the router has been added to my network.

However, a sensor that is now only a few meters away from the router, still isn’t connecting to my network. What else can I do to let the sensor connect to the router. Or will it take some time maybe, for the sensor, so find it’s new path?

I’m not sure how I can verify if the router if functioning correctly.

    Harvey Specter
    Posted at 06:22 November 21, 2020
    Owner
    Reply
    Author

    IMHO. End devices prefer shorten paths to a coordinator if a signal level is about the same. You cannot affect on this behavior.

Harvey Specter
Posted at 23:53 December 21, 2019
AR22
Reply
Author

I would like to expand my network with an additional router. I tried to use the zr_light_CC1352P and the zr_genericapp_CC1352P example from the ti sdk. However I am nod able to join my existing network. I was wondering if you could help me to adapt the code so I can use my spare board as a router with zigbee2mqtt. Is there a simple trick to make it appear in zigbee2mqtt?

    Harvey Specter
    Posted at 05:32 December 22, 2019
    Owner
    Reply
    Author

    I’m sorry, this chip has the Arm Cortex architecture. I cannot investigate it right now. I would offer to use CC2530+CC259x instead. It is better for a router.

      Harvey Specter
      Posted at 17:30 December 22, 2019
      AR22
      Reply
      Author

      I already have 2 of them. I would like to use the zigbee 3.0 version. In your text you mentioned, you added Pre-configured manufacturer code for Xiaomi devices & Pre-configured security key. Why did you add this? Are the standard ids not working?

        Harvey Specter
        Posted at 03:50 December 23, 2019
        Owner
        Reply
        Author

        I’ve tried to make a clone of the Xiaomi Zigbee Switch, but this retry was unsuccessful. The pre-configured security key does not matter.

Harvey Specter
Posted at 11:32 December 10, 2019
Ivan Conde
Reply
Author

Wonderful!

I’ve been using this firmware succesfully… until I got into Philips Hue devices

I’ve noticed that the router is unable to join a Philips Hue coordinator, I guess due to using a specific key for receiving transport key which is not the standard “ZigBeeAlliance09”

May you possibly release a router version with Philips (https://peeveeone.com/?p=166)

Thanks!

    Harvey Specter
    Posted at 12:01 December 10, 2019
    Owner
    Reply
    Author

    The router is based on the standard ZStack API v1.2. I think it uses the standard transport keys. Also, the key should be defined on the coordinator side.

Harvey Specter
Posted at 20:42 December 6, 2019
Andreas Granzer
Reply
Author

Hi. Could you please explain how to configure the intvervale when the router sends the “genOnOff” report to a coordinator?

    Harvey Specter
    Posted at 05:07 December 7, 2019
    Owner
    Reply
    Author

    Hi,

    You should send the configure report to the ‘genOnOff’ cluster and the ‘onOff’ attribute.

    Here is the example from zigbee2mqtt:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
        ptvo_switch_trigger: {
            key: ['trigger', 'interval'],
            convertSet: async (entity, key, value, meta) => {
                value = parseInt(value);
                if (!value) {
                    return;
                }

                if (key === 'trigger') {
                    await entity.command('genOnOff', 'onWithTimedOff', {ctrlbits: 0, ontime: value, offwaittime: 0});
                } else if (key === 'interval') {
                    await entity.configureReporting('genOnOff', [{
                        attribute: 'onOff',
                        minimumReportInterval: value,
                        maximumReportInterval: value,
                    }]);
                }
            },
        },
Harvey Specter
Posted at 01:25 October 7, 2019
xiaowei jin
Reply
Author

Hi,
I want to rebuild the code for my cc2530, i just rebuild the samplelight case and download it to cc2530, but nothing happend, zigbee2mqtt can not find device, i don’t know why. but if i download your hex to my cc2530, it works, can you help me to solve this issue? Thanks very much.

    Harvey Specter
    Posted at 06:43 October 13, 2019
    Owner
    Reply
    Author

    zigbee2mqtt will not find your device, because you should add the corresponding converter for your device to zigbee2mqtt.
    https://www.zigbee2mqtt.io/how_tos/how_to_support_new_devices.html

      Harvey Specter
      Posted at 10:54 October 15, 2019
      xiaowei jin
      Reply
      Author

      I mean it can’t appear in mqtt network, not add new device to hass, if the hex works, mqtt netwokr should appear a new device when cc2530 powered on, and can find it in debug log, but it’s not. The coordinator hex is from zigbee2mqtt.

      Thanks.

Harvey Specter
Posted at 12:50 September 28, 2019
Ngô Đinh Duy
Reply
Author

I can use it to transfer data to another MCU by MT_UART

    Harvey Specter
    Posted at 03:50 September 30, 2019
    Owner
    Reply
    Author

    The router firmware does not include this feature.

      Harvey Specter
      Posted at 04:36 September 30, 2019
      Ngô Đinh Duy
      Reply
      Author

      Thanks, how can i do that? i want send data brigthtness form router tu another MCU control LED Driver.

        Harvey Specter
        Posted at 05:53 October 2, 2019
        Owner
        Reply
        Author

        The router can only retransmit data from other devices. It cannot execute any commands. You should use a coordinator to send commands to end devices.

      Harvey Specter
      Posted at 04:48 October 1, 2019
      Ngô Đinh Duy
      Reply
      Author

      Can i do output debug string data ?

        Harvey Specter
        Posted at 05:01 October 1, 2019
        Owner
        Reply
        Author

        This firmware cannot output debug string through a UART port.

          Harvey Specter
          Posted at 07:24 October 1, 2019
          Ngô Đinh Duy
          Author

          Can i pay for your firmware ?

          Harvey Specter
          Posted at 05:52 October 2, 2019
          Owner
          Author

          No, thank you 🙂

Harvey Specter
Posted at 06:17 September 14, 2019
Dwight
Reply
Author

Update: As soon as I ejected the old CC2531 router from the network (zigbee2mqtt/bridge/config/remove “friendly name”) it’s all back to normal.

https://imgur.com/a/Ok0FeLo

Harvey Specter
Posted at 06:05 September 14, 2019
Dwight
Reply
Author

Hi and thanks for your work on the firmware! I ran into something weird, maybe you can shed some light.

At first, I had a coordinator (CC2531), then added another CC2531 as a router (flashed with router FW). At this point I was getting a nice Zigbee map with all sorts of connections between the devices. Then I ended up getting a proper CC2530 with antenna, again flashed with router FW, and joined the network, while disconnecting the old CC2530 router. As a result everything seems to work, but my network map indicates there’s zero effective routing – the CC2530 appears just as an end-device node and there are absolutely no network connections other that the ones going to the coordinator (see link). What’s wrong here?

https://imgur.com/a/kax6Lq3

Harvey Specter
Posted at 06:59 August 18, 2019
Armin
Reply
Author

could you please give me a link to that API?

Harvey Specter
Posted at 05:58 August 11, 2019
Armin
Reply
Author

Hi,

I’m using cc2530 module and I’m looking for a code that I can upload to my module and use that as an end device but I found nothing work fine but your firmware work properly and I appreciate for that but I need to modify code for my personal purpose so I was wondering if you could give me the code you have wrote for this firmware to use as my purpose.
I know it’s a big deal but I’m working on it for a long time and i don’t know what else should i do to get it on working.

    Harvey Specter
    Posted at 13:39 August 11, 2019
    Owner
    Reply
    Author

    Sorry, but I do not share my code. However, ZStack API library contains many examples.

Harvey Specter
Posted at 04:54 April 25, 2019
Alex
Reply
Author

To connect devices the coordinator has to create network, looks approximately so :
07:53:34.79 COM3 UTIL_GET_DEVICE_INFO_RESPONSE (0x6700)
Status: SUCCESS (0x0)
IEEEAddr: 0x00124B001A0C73EC
ShortAddress: 0x0000
DeviceType: COORDINATOR (0x1)
DeviceState: DEV_ZB_COORD (0x9)
NumAssocDevices: 0x00
AssocDevicesList

Harvey Specter
Posted at 18:58 April 23, 2019
Alex
Reply
Author

Hi, would you be able to make the firmware available for CC2530+CC2592 devices (Coordinator), please?

Harvey Specter
Posted at 15:30 March 2, 2019
Vikram
Reply
Author

Hi, Could you please shed some info on the changes required in the source for connecting the router CC2530 to a coordinator running Homeassistant or Zigbee2mqtt.
Thanks in advance.
PS: The binary files work great! Thanks for that

Harvey Specter
Posted at 15:26 March 2, 2019
Vikram
Reply
Author

Hi, the binaries for router firmware works perfectly. Thanks for that. Could you please shed some info on the changes required in the source for connecting CC2530 (router) to coordinator running HomeAssistant or Zigbee2Mqtt.
Thanks in advance.

Harvey Specter
Posted at 14:33 February 9, 2019
Rob
Reply
Author

Hi, would you be able to make the 2019-02-04 version of the firmware available for CC2530+CC2591 devices, please?

Harvey Specter
Posted at 02:51 January 31, 2019
Quatuor
Reply
Author

Is anyone else having issues with CC2531 router firmware that after a power cycle it is open for new zigbee device joins, pretty much keeping the network open.
Is there a setting in firmware to disable it?

    Harvey Specter
    Posted at 04:05 January 31, 2019
    Owner
    Reply
    Author

    The router re-transmits all data packets to a coordinator and does not analyze it. The coordinator may approve or decline to join request. Or do you mean something else?

Harvey Specter
Posted at 19:46 January 28, 2019
Rob
Reply
Author

I guessed that if an end device connects via the router, its “link quality” would be for end device to router, but in fact the end device appears to inherit the link quality of the router to coordinator connection…?

I have a Xiaomi Aqara temp/humidity/pressure sensor in my garage. When originally connected direct to the coordinator, the link quality was typically 75-85. I added a cc2530 router < 1m from the sensor in the garage, and reset the sensor so that it re-paired, and then confirmed that it was connected via the router by getting a network map from zigbee2mqtt. The link quality of both the router and the sensor appear to be equal now, hovering around 45-60.

It would be more useful for the end device to report the link quality between it and the router, as this is lost information otherwise.

Harvey Specter
Posted at 22:09 January 27, 2019
Rob
Reply
Author

> The router sends the “genOnOff” report to a coordinator every minute…

What does the “onOff” value in this keep-alive message mean? It appears to become the “state” value in the message that is published by zigbee2mqtt. After I first flashed the router firmware and it paired, the “state” was true, but after a short while it changed to false. Seem to be working fine, I’m just curious. Thanks again, Rob.

    Harvey Specter
    Posted at 04:20 January 28, 2019
    Owner
    Reply
    Author

    This is the state of green light on CC2531. Usually, CC2530 does not have this LED indicator and therefore this state does not matter for you. But you can still control this state from any high-level application.

Harvey Specter
Posted at 11:06 January 27, 2019
Rob
Reply
Author

Hello, I followed instructions found here https://github.com/Koenkk/zigbee2mqtt/blob/dev/docs/how_tos/how_to_create_a_cc2530_router.md to create a cc2530-based router using your router firmware (thanks!)

I hope the following questions make sense (I’m new to Zigbee things…):

Will the router firmware go into pairing mode every time it is powered up, or will it remember the pairing info and not re-pair after power cycling?

If the former, does that mean “permit_join” needs to be enabled on the host if the router is ever power-cycled, or else the router won’t be able to reconnect to the network?

If the latter, how to force it to re-pair if the previous pairing is no longer correct?

Thanks,
Rob.

ps. You mentioned that you can’t share your code/changes – I’m curious why?

    Harvey Specter
    Posted at 11:52 January 27, 2019
    Owner
    Reply
    Author

    Hello Rob,

    1. You don’t need to re-pair the router after power off. But you need to do it after re-flashing.
    2. You should disable permit_join after pairing of all your devices.
    3. Re-flash the router.
    4. I cannot share my code changes of Z-Stack, because I’m not sure that the TI’s license allows to do it.

      Harvey Specter
      Posted at 21:27 January 27, 2019
      Rob
      Reply
      Author

      OK, understood. Thanks for your swift reply.

Harvey Specter
Posted at 09:25 December 31, 2018
Dr. Apple
Reply
Author

I have the same problem, cc2530 with ex antenna will not work as router 🙁 The cc2531 works great als router or as cordi. But the cc2530 don’t work with any fw 🙁 The LED has no function 🙁 What is wrong ?

    Harvey Specter
    Posted at 15:17 December 31, 2018
    Owner
    Reply
    Author

    There are many places when the problem may exist. I don’t know how to help here.

Harvey Specter
Posted at 07:22 November 16, 2018
KC
Reply
Author

Hi PTVO, are you able to provide detailed instructions on how to compile the firmware for routers? I’m having the same issues as Marco (CC2530+antenna not connecting), and I’d like to try compiling with his instructions.

    Harvey Specter
    Posted at 10:16 November 16, 2018
    Owner
    Reply
    Author

    Sorry, I cannot share the sources.

      Harvey Specter
      Posted at 13:41 January 10, 2019
      fensoft
      Reply
      Author

      Can you please only share the version of zstack you used + the patch file ?

        Harvey Specter
        Posted at 14:15 January 10, 2019
        Owner
        Reply
        Author

        Sorry, I cannot share my code/changes.

Harvey Specter
Posted at 12:41 November 14, 2018
Marco
Reply
Author

Hi, I have installed a couple of routers with the SampleLight firmware (with little modifications and your symbols definitions) and they are working fine for distant devices.
Now I’m in a situation where even the router has weak signal for the most distant devices, so added a router in cascade, but it seems it’s not picking up the closer router (though if the cascaded one is closer to the coordinator, it works).
Is there anything to tweak in the IAR project to make it work?

Thank you.

    Harvey Specter
    Posted at 04:24 November 15, 2018
    Owner
    Reply
    Author

    Hi Marco.

    Sorry, I cannot help here. I think a router found a better path to your coordinator. It is possible the better path is the shortest path.

      Harvey Specter
      Posted at 12:36 November 21, 2018
      Marco
      Reply
      Author

      Thank you. Your suggestion hinted me to try with a smaller antenna on the farthest router and it’s working much better. But from time to time the on-off command is failing.
      I guess there’s some kind of interference. That router is installed on a 2nd floor and I believe there are neighborhood WiFis transmitting on a close channel.
      Will try to set the transmission retries higher.

Harvey Specter
Posted at 19:20 October 28, 2018
Frans
Reply
Author

Is it possible to install the router firmware to a CC2530 + CC2591 board?

    Harvey Specter
    Posted at 03:56 October 29, 2018
    Owner
    Reply
    Author

    Please, try this:
    https://ptvo.info/wp-content/uploads/2018/09/cc2530_cc2591_1.2.2a.44539_firmware.zip
    But I didn’t test it myself. It would be great if you let me know how it works.

      Harvey Specter
      Posted at 19:20 November 30, 2018
      Frans
      Reply
      Author

      I’ve uploaded the firmware (diag) to the cc2530_2591 using the cc-debugger.
      I connect a FTDI to VCC, GND. RX to P0_2 and TX to P0_3. But i don’t get any debug information. My zigbee network is already running, but i don’t see the new router.
      I’m using this board: https://images-na.ssl-images-amazon.com/images/I/51o1F2Xd6oL.01_SL500_.jpg

        Harvey Specter
        Posted at 08:38 December 3, 2018
        Owner
        Reply
        Author

        This firmware does not output diagnostic information through the UART port. But you may get some additional information about router’s neighbors on the controller.

          Harvey Specter
          Posted at 13:46 December 3, 2018
          Frans
          Author

          To make the router work, i only need to connect the VCC to 3.3V and the GND to GND(does it matter wich VCC or GND?)

          Harvey Specter
          Posted at 20:11 December 3, 2018
          Frans
          Author

          The Router is working, thank you for building the firmware!

      Harvey Specter
      Posted at 19:07 December 10, 2018
      Brisko
      Reply
      Author

      Hello Frans,

      Can you explain how you managed to get you routers to work?

      It seems that I have the same module (I think webee is the real producer, model Z-0002).
      I was able to flash this firmware “router-cc2530-cc2591-diag.hex”. But after the successfull flashing procedure the router could not be paired to the existing CC2531 coordinator.

      I have connected the 3.3V to pin2 on the 6-pin header and the ground to pin1 on the same header.

      Is this correct? Does I have to connect anoter pins to ground (perhaps P0_4, P0_6 or P2_0)?

      Hope you can help.

        Harvey Specter
        Posted at 04:08 December 11, 2018
        Owner
        Reply
        Author

        My router firmware needs 3.3V and GND only. But it is possible your board uses a custom schematic, and the cc2530 chip enables the cc2591 chip with help of another pin (cc2530 control the on/off state of cc2591). It is necessary to check it.

          Harvey Specter
          Posted at 14:27 December 11, 2018
          Brisko
          Author

          I still don’t know if the router is working but meanwhile I think that my real problem is the number of paired devices.

          I have one CC2531 USB-Stick as coordinator on my linux-machine and an another CC2531 USB-Stick as a router. This config works.

          But I think I have reached the maximum numbers of paired devices because I also can’t connect any additional end device like an aqara temperature/humidity sensor.

          I had 28 paired devices and to check if I have reached the end I removed 2 devices. But that had no impact to my problem. I still can not pair any additional device. Neither an end device nor the CC2530 router.

          Is it possible that the entry in the list of paired devices in the flash-memory of the CC2531 doesn’t get pruned if I remove a device in zigbee2mqtt? This would explain my problems.

          I just wonder why I get no information from zigbee-shepherd telling me that there is a device that could not be paired because of any limitation.

          Harvey Specter
          Posted at 03:52 December 12, 2018
          Owner
          Author

          As I know the stable quantity is about 20 devices. How many routers did you connect to your coordinator?

          Zigbee-shepherd receives all notifications from a coordinator. The coordinator does not output any info if it does not accept/allow to connect a device.

          Harvey Specter
          Posted at 13:27 December 17, 2018
          Brisko
          Author

          I took me a heart and have rebuilded the whole zigbee-network. This time I replaced the coordinator CC2531 usb-stick with one of the CC2530+CC2591 connected via TTL-USB adapter.

          After deleting of the zigbee2mqtt database and a little problem concerning the RX/TX signal lines (I were so shure that I had connected RX to TX and vice versa TX to RX), I was able to start zigbee2mqtt. Pairing was faster than the first time, not so suprising because it was just an re-pairing of known devices.

          After I had paired the sensors near the coordinator I flashed a CC2530+CC2591 with your router-firmware and paired it with the coordinator by connecting only 3.3V and GND!

          At the moment I have the coordinator with 2 router and 31 end devices in my zigbee network. I will keep my two CC2531 usb-sticks for later, if I have to extend the coverage area in one special direction.

          Thanks a lot for your help!

          Best regards
          Brisko

          Harvey Specter
          Posted at 04:01 December 18, 2018
          Owner
          Author

          Hi! I glad to know that my work is usable 🙂

Harvey Specter
Posted at 18:35 October 23, 2018
Reiner
Reply
Author

Thanks for your great work!
I use the 2530 board with ext. antenna and your firmware router-cc2530-std.hex
Do you support the LED in your FW ? If yes, to which pin must it be connected?

    Harvey Specter
    Posted at 04:04 October 24, 2018
    Owner
    Reply
    Author

    Hello. The firmware controls leds on the CC2531 board only.

Harvey Specter
Posted at 10:45 October 14, 2018
Jeff
Reply
Author

How many ZigBee end devices can one cc2530 coordinator handle?

    Harvey Specter
    Posted at 04:09 October 15, 2018
    Owner
    Reply
    Author

    The firmware can handle up to 24 devices.

Harvey Specter
Posted at 20:28 October 2, 2018
Marco
Reply
Author

Tried your last router firmware: unfortunately, nothing appears in the debug log (after the permit-join for 120s). I tried with a different CC2530 board, just to be sure nothing went wrong, but no results either.
I then set up the IAR workbench and was able to compile the SampleLight project (RouterEB profile) setting just a few channels (11, 15 and 25, ie 0x02008800), plus: your symbols, PanID = 0xFFFF, and Xiaomi security key and it just connected after a few seconds. Any ideas?
For now, it’s working as a router (though need some more time to test it). I would like at least to add the genOnOff report to the code, but I’m not very familiar with the Z-Stack… Any help appreciated 😉

Thank you

    Harvey Specter
    Posted at 04:24 October 3, 2018
    Owner
    Reply
    Author

    This is strange that my router cannot connect, but it is based on the same sample.

      Harvey Specter
      Posted at 14:01 October 4, 2018
      Marco
      Reply
      Author

      I would like to debug that, but have very little time.
      Do you think that adding leds to the CC2530 board would help? I have the compact board version with antenna.
      I’m waiting for a programming cable for the CC2531: may be I can sniff with that?
      Thanx
      P.S. feel free to contact me via email

    Harvey Specter
    Posted at 07:09 November 16, 2018
    KC
    Reply
    Author

    Could you share your firmware? I’m having the same issue as you, using the external antenna version.

      Harvey Specter
      Posted at 12:32 November 21, 2018
      Marco
      Reply
      Author

      Hi KC, please ask PTVO to share my email address with you. I’m not hijacking this post with my firmware. And I’m not supporting it nor sharing sources anyway.

      Harvey Specter
      Posted at 11:20 December 7, 2018
      Marco
      Reply
      Author

      Hi, I didn’t get any contact from KC: I’m still available for sharing ideas with him.

        Harvey Specter
        Posted at 11:33 December 7, 2018
        Owner
        Reply
        Author

        I didn’t get any message from KC. Nothing to say you. Sorry.

Harvey Specter
Posted at 05:32 September 27, 2018
Marco
Reply
Author

Hi. I’m testing the CC2530 router firmware (all channels version), but it doesn’t show up in my HomeAssistant with zha module (using Elelabs ZigBee USB which is working like a charm connecting Xiaomi door sensors).
How do I check that it’s actually trying to connect? Is the only way to use a CC2531 as a coordinator?
Thank you

    Harvey Specter
    Posted at 05:38 September 27, 2018
    Owner
    Reply
    Author

    What PanID do you use in your network?

      Harvey Specter
      Posted at 06:21 September 28, 2018
      Marco
      Reply
      Author

      Mmh… it’s all hardcoded in the homeassistant zha component. Shall I override that with the Xiaomi PanID?

      Thanx

        Harvey Specter
        Posted at 08:01 September 28, 2018
        Owner
        Reply
        Author

        Please, re-download firmware. I’ve changed it tomorrow and the router may connect to a network with any PanId.

          Harvey Specter
          Posted at 08:31 September 28, 2018
          Marco
          Author

          I’m using the 2018-09-26 update: I wasn’t able to change the channel in the Homeassistant component, so when I saw the new firmware I gave it a try.
          Did you change anything after that date?

          Anyway, do you have an estimate of how long should it take to join now? I tried to permit for 254 seconds, but the Homeassistant debug log does not show any sign of communication at all (only if a Xiaomi sensor sends directly to my Zigbee coordinator)

          Harvey Specter
          Posted at 06:40 September 29, 2018
          Owner
          Author

          Yes, I’ve changed the file. Usually, the pairing process takes up to 60-120 seconds. But you can repeat this.

Harvey Specter
Posted at 10:03 September 18, 2018
Michael
Reply
Author

Hi, thank you very much for this great idea!

It is working with a xiaomi-reed-contact! I tried to use it with an Osram SmartPlug in the cellar room. When I turn on/off the Osram-Plug by hand on the switch, the status is immediately transmitted to FHEM. Without the use of the router it is not working.
But when I press the on/off or toggle button in FHEM there isn‘t any reaction at the SmartPlug in the cellar room (using the router!).
Can you please help me? Is it only working for sensors (one way)?

Thanks Michael

    Harvey Specter
    Posted at 05:20 September 19, 2018
    Owner
    Reply
    Author

    Hi Michael.

    I’m sorry, but I don’t have ideas. I don’t have such device to test it. But the router works with similar Xiaomi Plugs.

Harvey Specter
Posted at 07:14 September 12, 2018
Mike Stewart
Reply
Author

Thanks. I might have to find someone running the cc2530 and a pi with hass.io to find out the pi side of the configuration.

Harvey Specter
Posted at 06:20 September 10, 2018
Mike Stewart
Reply
Author

Hi

I use home assistant (hass.io) on a pi3b with xiaomi zigbee sensors.
I bought 3x cc2531 usb sniffers. My initial plan was to install zigbee2mqtt and have 1x co-ordinator and 2x routers using your router firmware. This would allow me to connect 43 xiaomi devices.

If i wanted to use cc2530 as a zigbee co-ordinator
eg. http://s.click.aliexpress.com/e/f2ZBu3N

How do I attach this co-ordinator to my Pi? or how does it communicate with the Pi?

Thanks
Mike

    Harvey Specter
    Posted at 07:45 September 10, 2018
    Owner
    Reply
    Author

    I’m using the identical board with my BPi. Connect:
    P0_2 <=> RS232 RX (note: RPi may have several UARTs on digital pins).
    P0_3 <=> RS232 TX
    GND <=> GND
    + connect power to this board.

Harvey Specter
Posted at 17:13 August 1, 2018
Chris
Reply
Author

I have used your Router firmware file with the external antenna board and it’s working now perfect! With this board as a Zigbee Router I get connection to some Xiaomi devices, that before not worked. Thank you!
One thing I figured out: With the CC-Debugger I had to connect Pin2 (Target Voltage Sense) with VCC to make the programming work.

    Harvey Specter
    Posted at 03:56 August 2, 2018
    Owner
    Reply
    Author

    Hi,

    Thank you for your feedback and comment (I’ve updated one my post with this note)!

Harvey Specter
Posted at 11:59 May 20, 2018
Arik
Reply
Author

Awesome work! This will greatly help diy zigbee home automation deployments.
I learned about this article from the Koenkk/zigbee2mqtt project.

You seem to be familiar with the inner details of zigbee so I though I would try and ask about an issue that concerns me. The security model of zigbee, and specifically the LinkKeyJoin that we are using with Xiaomi devices, how secure is it? Specifically, can I sniff what is going on there? Can somebody send spoofed commands to my HA network? Is it vulnerable at “join-allowed” times or other times as well?
I tried reading some zigbee materials but was not able to find the information I was looking for. Perhaps you can shed some additional light.

Thanks.

    Harvey Specter
    Posted at 04:23 May 21, 2018
    Owner
    Reply
    Author

    Hi Arik.

    My knowledge is limited, but:

    1. Xiaomu devices use a known security key. Therefore everyone (located closely) can monitor your traffic. Also this key can be captured at link-join time (https://www.youtube.com/watch?v=4vG4CVNAm_A). I think Zigbee HA network is not protected in this case.

    2. Sending data. A coordinator receives data only from joined devices. If the coordinator has a good firmware it will not receive unwanted data packets. The popular ZNP firmware for CC2531 USB is good enough. Also, in this case a computer or SBC knows about all connected devices and can report about attacks. Note: Zigbee HA allows to send data between devices directly. Therefore security depends on a firmware of each individual device. For example, a device may check a sender poorly.

      Harvey Specter
      Posted at 18:49 May 30, 2018
      Arik
      Reply
      Author

      I see. Thanks for the additional info. Looks like I will have to make a few experiments with a sniffer.
      Can you tell me what are the: pre-configured manufacturer code for Xiaomi devices and the pre-configured security key that you mention above? What method did you use to find these values?

        Harvey Specter
        Posted at 04:07 May 31, 2018
        Owner
        Reply
        Author

        Manufactured code: 4447
        Networks ID (PanID): 0x1a62
        Security key: I’ve found in Internet (this is a set 8 bytes)

    Harvey Specter
    Posted at 23:06 March 21, 2019
    Turbo T.
    Reply
    Author

    Can I use this to control a 12V motor? A motor such as the Dooya DM25DC for blinds.

      Harvey Specter
      Posted at 04:11 March 22, 2019
      Owner
      Reply
      Author

      No, my firmware cannot control anything.

Leave a Reply to CHB
Cancel Reply