CC2531 based router (firmware)

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:

  1. CC2531-router.hex – just a router, without diagnostics and a USB serial port.
  2. CC2531-router-diag.hex – a router with diagnostic reports and without a USB serial port.
  3. 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 an additional RF 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:

  1. Short single press – to re-send a binding request to a coordinator (it allows you to test a connection).
  2. 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 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 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).


Comments
Harvey Specter
Posted at 21:42 September 9, 2021
Kedr
Reply
Author

Hello, i have cc2531 coordinator now i need change to router.I can flash by Serial boot tool(i don’t have cc debuger). But SBT can’t flash hex file. Can can you compile hex to bin? Thx for great work!

    Harvey Specter
    Posted at 03:31 September 10, 2021
    Owner
    Reply
    Author

    Hello. You can find an instruction on the Internet how to convert hex to bin. Please, note, my firmware does not have SBT. You cannot return back or change to another firmware without a CC debugger.

      Harvey Specter
      Posted at 09:35 September 10, 2021
      Kedr
      Reply
      Author

      I tried several options found on the Internet, at all at the end of the download it gives an error

Harvey Specter
Posted at 13:27 June 4, 2021
dave
Reply
Author

Thanks – I already have a coordinator I would connect this to – I’m trying to make some smart devices with some CS2531+sbc with software on the sbc, and the adapter to connect it to the zigbee network talking to it with ZigbeeNet for example. Be nice if these were also routers like e.g. smart lightbulbs usually are. Am I looking in the wrong place?

    Harvey Specter
    Posted at 13:44 June 4, 2021
    Owner
    Reply
    Author

    I’m sorry, but I confused. It seems I didn’t understand your first question. A stick with CC2531-router-diag-usb.hex should create a UART on your SBC and dump some debug info to it. Does your coordinator use CC2531 too? Do you see it the devices list in your SBC?

      Harvey Specter
      Posted at 14:55 June 4, 2021
      dave
      Reply
      Author

      Sorry It’s because I don’t know much about this. I have one CC2531 which I’ve been playing with, I’ll buy a different one to be coordinator at some point for sure. I also have an existing hive hub, but I can get rid of this.

      I was trying the firmwares over at https://github.com/Koenkk/Z-Stack-firmware….

      router Z-Stack_Home_1.2 for CS2513 (this is attributed to ptvo.info, I think it’s CC2531-router.hex):
      – Flashed and pairs with the hive hub (suprisingly), but no usb serial uart

      coordinator Z-Stack_Home_1.2
      – Flashed, has a usb serial port, can connect to HomeAssistant using zigbee2mqtt for example

      CC2531-router-diag-usb.hex above:
      – Flashed, but doesn’t pair with hive hub. It does have a usb serial port. Tried to see if HomeAssistant would work with ZHA on that port – it says it can’t connect.

      I assume this is because it’s just outputting diagnostic data over the usb, rather than accepting commands to send/recieve messages.

      What I’m wondering if I can do, is put a firmware on the CC2531 that will expose a usb serial and join a zigbee network as a router (or as an end-device) and do some stuff like this:

      https://github.com/Mr-Markus/ZigbeeNet/wiki/Turn-light-on-off

      So that I can code a smart device on something with the CC2531 plugged into it without writing firmware…e.g. expose some gpios on a rpi as smart lights etc.

        Harvey Specter
        Posted at 03:31 June 7, 2021
        Owner
        Reply
        Author

        I see. Unfortunately, my router firmware cannot work as your wish. It cannot accept external commands. You can download ZStack 1.2 SDK and use simple examples from it.

Harvey Specter
Posted at 10:40 June 4, 2021
Dave
Reply
Author

Hi and also thanks for your work 🙂

I’m a software engineer but new to zigbee, I have a CC2531 and I’d like to use e.g. ZigbeeNet to code up a zigbee device on a sbc, using the router firmware here.

I know I need to start by connecting to the zigbee network controller via serial e.g. `new ZigBeeSerialPort(“/dev/ttyACM0”);`.

Is it actually `CC2531-router.hex` I need? I read that as not having a usb serial port and installed `CC2531-router-diag-usb.hex` instead but that didn’t want to connect.

    Harvey Specter
    Posted at 11:51 June 4, 2021
    Owner
    Reply
    Author

    Hi! The router is a standalone device. It should be wirelessly connected to a coordinator. The coordinator works together with an SBC. So, first of all, you need a coordinator and firmware for it.

Harvey Specter
Posted at 18:01 April 30, 2021
Gert
Reply
Author

Thanks for your reply, as to 2. Yes: I stated two possibilities, therefore a retry:

case b) If the device is paired to the coordinator and moved out of reach but within reach of a router with your firmware -> does the device still count as a connection in the limited list of the coordinator?

Answer 3. I am using Domoticz and a network map indeed shows the connections. I suppose that if there is no connection between coordinator and device, that means it does not count as a device in the (limited cc2531) coordinator list?

    Harvey Specter
    Posted at 06:25 May 1, 2021
    Owner
    Reply
    Author

    1. The device should select a new parent device. When it has done, it will free a slot on a coordinator.
    2. Yes, correct.

Harvey Specter
Posted at 22:26 April 28, 2021
Gert
Reply
Author

Hi, thanks for your work, I am using it with success with Zigbee2Mqtt, although some practical issues are not clear to me:
I use one cc2531 as a coordinator and another one as router in an attempt to support more than 20 devices.
1. a) Do I need to pair devices at the location of the router, or b) can I pair at the coordinator and move them out of reach, but within reach of the router?
2. In case of b): does the device then take a space in the limited list of the coordinator or of the router?
3. Is it possible to find information on devices whether they count in the list for the coordinator or for a router?
4. I have Ledvance smart plugs in my network that also have router capabilities. There are other devices like that such as switches or dimmers with router properties. Do these operate similar to the cc2531 with router firmware? Or is the cc2531 router much more powerful?
Thanks for your help in my understanding.

    Harvey Specter
    Posted at 03:32 April 29, 2021
    Owner
    Reply
    Author

    Hi Gert!
    1. Both.
    2. Yes.
    3. For example, Z2M can show a device’s map, where you can see direct connections and count them.
    4. CC2531 may work better because it is outside a wall.

« Older Comments

Leave a Reply to Dave
Cancel Reply