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 20:01 March 6, 2024
Jan
Reply
Author

Is there a chance to get the command to create a bin-file of those hex-files that will be flashable with zippy-znp? objcopy –gap-fill 0xFF –pad-to 0x3a800 -I ihex router-cc2531-diag-usb.hex -O binary CC2531-TEST2.bin did not do the trick. It will throw out a file that has correct size but wrong hash. 0x040000 as pad-to is throwing out wrong file size. Could you help me here?

Harvey Specter
Posted at 03:10 February 5, 2023
AP
Reply
Author

Hello, is it possible to use simple CC2531 module as repeater (range extender)? What firmware do I use for this?

    Harvey Specter
    Posted at 06:38 February 5, 2023
    Owner
    Reply
    Author

    Yes, you can use this stick as a router (repeater) using the firmware from this page.

Harvey Specter
Posted at 03:13 February 14, 2022
David
Reply
Author

I downloaded cc2531 router software from the link below shown. It unzips to the files with this dates shown below. HOWEVER, zigbee2mqtt reports a firmware build date of 2018-09-26

What should I believe?

Thanks for your work on this project and help on this question!

https://ptvo.info/download/cc2531_1.2.2a.44539_firmware.zip

Firmware build date
2018-09-26

drwxr-xr-x@ 3 d staff 102 Feb 13 18:04 coordinator
-rw-rw-r–@ 1 d staff 542945 Sep 28 2020 router-cc2531-std.hex
-rw-rw-r–@ 1 d staff 564683 Sep 28 2020 router-cc2531-diag-usb.hex
-rw-rw-r–@ 1 d staff 550341 Sep 28 2020 router-cc2531-diag.hex
-rw-rw-r–@ 1 d staff 2792 Jun 6 2019 README.txt

    Harvey Specter
    Posted at 05:15 February 14, 2022
    Owner
    Reply
    Author

    Please ignore the timestamp in Z2M.

Harvey Specter
Posted at 10:43 December 9, 2021
MMS
Reply
Author

Hello! Thank yo very very much for your excellent firmware. I installed it without a hitch as router to extend the signal further from the coordinator. I have one question/observation, though.

The router seems to be sending too many MQTT message (to the coordinator). The console of the coordinator (running Tasmota) shows a message every second. Why so many? Are they needed? Nothing else on my 30+-device network is so actively sending messages.

If this frequency is not required, can it be reduced somehow? I am just concerned about it flooding he coordinator and keeping it unnecessarily busy.

    Harvey Specter
    Posted at 13:17 December 9, 2021
    Owner
    Reply
    Author

    I can only offer to build a custom firmware using my configurable firmware. It has a preset for the CC2531 router. Please enable the “Disable configuring interval remotely” option on the Expert tab.

      Harvey Specter
      Posted at 08:30 December 11, 2021
      MMS
      Reply
      Author

      Wow that would be excellent. In general, Tasmota devices send tele msgs every 1 minute, so that would be a good option.

      I am not clear, though, on your answer above. To extend the period to 1 min, you or I would have to rebuild the firmware? I do not know to to build it, nor how to use the tabs. Kindly let me know.

      Thank you very much again. You are great.

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 08:33 December 11, 2021
        MMS
        Reply
        Author

        I found it easiest to use raspberry pi. You can use the hex file. There are many instruction on the net on that (or search for it on youtube from NotEnoughTech. It took no more than about 5-10 minutes. You have to solder the pins, though.

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