Skip to content

Extend range of zigbee network using CC2531/CC2530 routers #52

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
james-fry opened this issue May 18, 2018 · 303 comments
Closed

Extend range of zigbee network using CC2531/CC2530 routers #52

james-fry opened this issue May 18, 2018 · 303 comments

Comments

@james-fry
Copy link

james-fry commented May 18, 2018

The CC2531 does not seem to have as good range as my Xiaomi hub.
Using same type of Xiaomi sensor (new generation reed switch sensor - MCCGQ11LM) I found that the CC2531 is failing to receive updates, where the Xiaomi does. Hub and CC sniffer are in same room ~1.5M apart. The reed sensors are in a room in floor below next to each other.
(Neither network has active/powered devices to act as repeater)

Is there any way to improve range?

  1. I have the dongle on a USB extension to move it away from the metal of my VM server, but I think I can use a longer extension to get further away from the metal...

  2. I can add powered device (e.g.) bulb as a repeater. Problem with this is that bulbs do get hard switched off sometimes. I dont have any zigbee sockets.

  3. There are CC2531 devices with a RF front end and external antenna with supposedly higher range.
    e.g. this one
    But these cost more + less easy to program (need to solder header) + not sure if firmware is compatible with the RFX2401C PA chip

Anything else?

@kirovilya
Copy link
Contributor

kirovilya commented May 19, 2018

Hello. I have been tested 4 types of cc253x devices as coordinator:
sticks_4
From left to right: cc2531, cc2530 with external antenna, cc2530+cc2591, cc2530+RFX2401

Three last (right) devices not different for xiaomi sensors. Because it is not listen xiaomi sensor in long range (sensor can not send long range signal).

In direct line of sight I get work sensor on ranges: 30m with cc2531 and about 50-60m with cc2530 + external antenna and also with cc2530 + range amplifieres.

https://www.youtube.com/watch?v=v6iMcxRl_Xc

@ptvoinfo
Copy link
Contributor

You may add a custom router with the external antenna (based on 2nd board from the left)
http://ptvo.info/cc2530-based-zigbee-coordinator-and-router-112/
I'm using 2 routers and 1 coordinator in my rather large home (about 500 m2).

@kirovilya
Copy link
Contributor

@ptvoinfo It is good news! Thank you. Can you make and share cc2531 firmware for router?

@ptvoinfo
Copy link
Contributor

@kirovilya
I can try. But why CC2531 is better than CC2530? CC2530 is cheaper and has the external antenna.

@kirovilya
Copy link
Contributor

@ptvoinfo yes, but cc2531 is simplier for other users :) "plug and use"

@ptvoinfo
Copy link
Contributor

@kirovilya this is not simple as you think :)

  1. you need to flash a new firmware.
  2. you need to place it somewhere with a 5V power source and usually this is a hidden place. So IMHO, CC2530 is better.
    Therefore I use CC2531 as a sniffer only.

@james-fry
Copy link
Author

james-fry commented May 19, 2018

Plug a cc2531 with router firmware into 5v USB PSU like one of these?
https://www.amazon.co.uk/dp/B01N25761P/ref=cm_sw_r_cp_api_i_KxdaBbMNEQA2E

@dgomes
Copy link
Contributor

dgomes commented May 19, 2018

I would also like to get my hands on a cc2531 router firmware :)

Too easy to stick it directly to a usb mains charger behind some furniture

@james-fry
Copy link
Author

Hi @ptvoinfo
I read your blog post linked above - thx for sharing.
I notice that for the router firmware you mention that you "Pre-configured manufacturer code for Xiaomi devices."
Does this mean that the router f/w needs to be customised for the devices that will be in the network? Can it be made generic?

@ptvoinfo
Copy link
Contributor

Hi @james-fry
A generic router must be configured first using Z-Tool (set network ID, default channel, security key). From my point of view this is not an easy process.

@james-fry
Copy link
Author

Understood. With my limited understanding of zigbee, I had assumed that we'd need to pair the router with the coordinator in the same was as an end device - e.g. perhaps using one of the two ptm switches on the cc2531 sniffer to initiate pairing?. This would then set the ID/channel/key in same way as a device like the xiaomi smart sockets (which are both end device and router).
BTW I totally get that writing f/w for this is a big job, but maybe there is capability in this forum to get it working?

@james-fry
Copy link
Author

Hi @kirovilya - I noticed that your testing includes two boards with RF frontends (cc2530+cc2591, cc2530+RFX2401).
Are you aware of whether the "48 device" coordinator firmware for this project is compatible with those frontends? As I understand it the CC253x SoC has to program/control the frontend chip via GPIOs, so the f/w needs to include support. Both 2591 and RFX2401 have different requirements.
@oskarn97 - If Im correct you were the source for the f/w. Would you be able to confirm this?

Maybe we can start a list of compatible boards over and above the recommended CC2531 sniffer USB dongle?

@kirovilya
Copy link
Contributor

kirovilya commented May 21, 2018

@james-fry for cc2530 (without range amplifieres) you need firmware https://github.com/kirovilya/files/blob/master/CC2530ZNP-Pro-Secure_LinkKeyJoin.hex (but this firmware without maximum 48 devices) and for cc2530 with RF you need https://github.com/kirovilya/files/blob/master/CC2530ZNP-Test_for_CC2591.hex
(thank @oskarn97 for this firmware)

@oskarn97
Copy link

I've just increased the device limit and enabled secure link join. Apart from that I did not modify the default TI Z Stack Home.

@james-fry
Copy link
Author

james-fry commented May 21, 2018

Thanks for the swift replies, @kirovilya @oskarn97

So as a summary we have support for: (UPDATED)

Not supported

  • CC2531 with any RF front end (CC2591 or RFX2401)

Is this correct?

@kirovilya
Copy link
Contributor

kirovilya commented May 21, 2018

@james-fry not correct.
https://github.com/kirovilya/files/blob/master/CC2530ZNP-Test_for_CC2591.hex compatible with CC2591 and RFX2401.
I not found CC2531 with any RF. sorry, found in first post

@james-fry
Copy link
Author

james-fry commented May 21, 2018

@kirovilya Thanks. Updated the summary with this confirmation.
This guy is selling CC2531 + RFX2401
https://www.ebay.co.uk/itm/CC2531-RFX2401C-PA-LNA-RF-Front-End-2-4GHz-IEEE-802-15-4-ZigBee-USB-dongle/141931496878
There are a couple of versions - one also with ext antenna.

@dgomes
Copy link
Contributor

dgomes commented May 21, 2018

We need to make this information sticky in the Wiki :)

@kirovilya
Copy link
Contributor

@dgomes I also maintain wiki in Russian. it will be possible to give a link to it as a localized resource :)

@james-fry
Copy link
Author

I'm happy to update wiki and make a PR later today.

@ptvoinfo
Copy link
Contributor

@kirovilya

CC2530 with this firmware: https://github.com/kirovilya/files/blob/master/CC2530ZNP-Pro-Secure_LinkKeyJoin.hex

What communication settings does this firmware use? What pins must be connected? I've tried 115200,8N1 pins (P02, P03, GND, 3.3V) and it does not work for me. My own firmware works.

@kirovilya
Copy link
Contributor

@ptvoinfo P20 to GND

@ptvoinfo
Copy link
Contributor

@kirovilya P20 to GND: tried too.

@kirovilya
Copy link
Contributor

@ptvoinfo Hmm. My connections to UART cable:
RX - P03
TX - P02
3.3v - VCC
GND - GND

and on board wire P20 to GND. Port speed 115200, but rtscts is false

What error did you receive?

@ptvoinfo
Copy link
Contributor

ptvoinfo commented May 21, 2018

@kirovilya
I'm using UART TTL to USB converter. Wiring is the same (tried swap RX and TX, with/without P20). zigbee2mqtt cannot initialize CC2530. Data timeout.

@james-fry
Copy link
Author

@Koenkk - I didn't realise that wiki is not part of repo (GH noob here), so I cant edit your wiki in my fork and submit PR :(
Are you able to give me permission to update the wiki? Alternative I can message you with the wiki markup?

@kirovilya
Copy link
Contributor

@ptvoinfo Very strange... Try to reboot :)
I flashed and used cc2530 many times...

@kirovilya
Copy link
Contributor

@ptvoinfo may be you have CC2530 + CC2591 board ?

@kirovilya
Copy link
Contributor

@ptvoinfo in case cc2530+RF i need connect P06 and P04 to GND too (do not ask me "why" :) ). may be it help in your case.

@trekker25
Copy link

what router firmware is needed for a CC2531? Has it been changed in the past months? My firmware is from around January 2019.

@james-fry
Copy link
Author

Latest is here:
https://github.com/Koenkk/Z-Stack-firmware/tree/master/coordinator/Z-Stack_Home_1.2/bin

You need to choose default or source_routing
Default is best for low number of devices connecting directly
source routing is best for larger number of devices but need routers because only 5 devices connect to coordinator directly

@VivantSenior
Copy link

@kirovilya do you know that is a name of multi-colour cable that connects GBAN and CC Debugger or know the socket that links the cable with CC Debugger? I'm sure that it's not 5-pin JST 1,25mm. Maybe ZH 1,5mm?

@bonjour81
Copy link

Hi, is it possible to just use the ikea repeater to extend range ?
https://www.zigbee2mqtt.io/devices/E1746.html
It seems pretty low cost and kind of plug&play (no need to reflash a firmware).
I didn't tested it, but only issue I see so far is that family mate may think it's just an other USB charger :)

@james-fry
Copy link
Author

Hi, is it possible to just use the ikea repeater to extend range ?
https://www.zigbee2mqtt.io/devices/E1746.html
It seems pretty low cost and kind of plug&play (no need to reflash a firmware).
I didn't tested it, but only issue I see so far is that family mate may think it's just an other USB charger :)

Yes it works fine

@aganapa
Copy link

aganapa commented Feb 11, 2020

Hi All,

Any suggestion on where I can buy CC2531 USB dongles in Canada-Toronto. Searching on Amazon.ca points to shipping locations from China with huge international shipping costs, potential customs duties & long delivery times.

Thank you!

@adrianmihalko
Copy link

Hi All,

Any suggestion on where I can buy CC2531 USB dongles in Canada-Toronto. Searching on Amazon.ca points to shipping locations from China with huge international shipping costs, potential customs duties & long delivery times.

Thank you!

Buy Deconz.

@creativtransfer
Copy link

Or get it from Aliexpress.
https://www.aliexpress.com/item/32920807462.html

@tlc76
Copy link

tlc76 commented Feb 27, 2020

Hi there,

I am trying to attach a CC2530+CC2591 device to a NodeMCU ESP8266 board, in order to use it as a standalone Zigbee coordinator.

I followed this tutorial but I realized that it covers only the CC2530 type (the one without a signal amplifier).

Can you please help with some instructions on how to connect the pins of the CC2530+CC2591 device to the pins of the NodeMCU ESP8266 board?

FYI, I have posted a similar request here.

Thanks for helping out!

@fred-c1
Copy link

fred-c1 commented Feb 27, 2020

@tlc76
CC2591 is only connected to CC2530 and the antenna
CC2591 is not connected to the host (microcontroller or USB to serial adapter)

Suggestions:
1 = Read this: #794
2 = make sure you have the proper firmware loaded in the CC2530.
CC2530+CC2591 requires a special firmware
3 = Describe your problem

@tlc76
Copy link

tlc76 commented Feb 28, 2020

Thanks a lot @fred-c1

I was already able to successfully upload this coordinator FW: CC2530_CC2591_DEFAULT_20190608.zip on the CC2530+CC2591 device.

Also, I attached the CC2530+CC2591 to the RPi serial interface and was able to start the zigbee2mqtt daemon:

openhabian@pi:/opt/zigbee2mqtt/data/log $ cat ./2020-02-25.16-52-43/var/log/zigbee2mqtt.log
info  2020-02-25 16:52:43: Logging to console and directory: '/opt/zigbee2mqtt/data/log/2020-02-25.16-52-43' filename: /var/log/zigbee2mqtt.log
debug 2020-02-25 16:52:43: Removing old log directory '/opt/zigbee2mqtt/data/log/2020-02-25.02-52-40'
debug 2020-02-25 16:52:43: Loaded state from file /opt/zigbee2mqtt/data/state.json
info  2020-02-25 16:52:44: Starting zigbee2mqtt version 1.10.0 (commit #8df6be8)
info  2020-02-25 16:52:44: Starting zigbee-herdsman...
debug 2020-02-25 16:52:44: Using zigbee-herdsman with settings: '{"network":{"panID":6754,"extendedPanID":[221,221,221,221,221,221,221,221],"channelList":[11],"networkKey":"HIDDEN"},"databasePath":"/opt/zigbee2mqtt/data/database.db","databaseBackupPath":"/opt/zigbee2mqtt/data/database.db.backup","backupPath":"/opt/zigbee2mqtt/data/coordinator_backup.json","serialPort":{"baudRate":115200,"rtscts":false,"path":"/dev/ttyAMA0"}}'
info  2020-02-25 16:52:46: zigbee-herdsman started
info  2020-02-25 16:52:46: Coordinator firmware version: '{"type":"zStack12","meta":{"transportrev":2,"product":0,"majorrel":2,"minorrel":6,"maintrel":3,"revision":20190608}}'
debug 2020-02-25 16:52:46: Zigbee network parameters: {"panID":6754,"extendedPanID":"0xdddddddddddddddd","channel":11}
info  2020-02-25 16:52:46: Currently 0 devices are joined:
warn  2020-02-25 16:52:46: `permit_join` set to  `true` in configuration.yaml.
warn  2020-02-25 16:52:46: Allowing new devices to join.
warn  2020-02-25 16:52:46: Set `permit_join` to `false` once you joined all devices.
info  2020-02-25 16:52:46: Zigbee: allowing new devices to join.
info  2020-02-25 16:52:46: Connecting to MQTT server at mqtt://localhost:1883
info  2020-02-25 16:52:46: Connected to MQTT server
info  2020-02-25 16:52:46: MQTT publish: topic 'zigbee2mqtt/bridge/state', payload 'online'
info  2020-02-25 16:52:46: MQTT publish: topic 'zigbee2mqtt/bridge/config', payload '{"version":"1.10.0","commit":"8df6be8","coordinator":{"type":"zStack12","meta":{"transportrev":2,"product":0,"majorrel":2,"minorrel":6,"maintrel":3,"revision":20190608}},"log_level":"debug","permit_join":true}'

but my goal is to make the coordinator device physically independent (i.e. disconnect it from the RPi serial and make it accessible via WiFi). This can be done by attaching it to a NodeMCU board and to a power supply.

So, to confirm the pinout: I will apply the configuration described in this table:
image

to the real thing:
image

while ignoring the last 3 pins (P20, P04 and P05).
(thanks for confirming this is correct!)

Also, this setting should be defined in file /opt/zigbee2mqtt/data/configuration.yaml:

advanced:
  rtscts: false

but the problem is that I am moving from RPi serial connection to the NodeMCU ESP8266 board, and I am not sure how to map this setting it in the ESPEasy serial server configuration which looks like this (please ignore the highlighted text "TX enable pin" - I took the screenshot from another post):
image

Can you please help here too? :)

Thanks a lot!

@fred-c1
Copy link

fred-c1 commented Feb 28, 2020

@tlc76
I don't think you need to enable a "TX Enable Pin"
Apparently, this is intended for RS485 physical layer
Since our physical layer is "3.3V CMOS levels" you don't need this

@tlc76
Copy link

tlc76 commented Feb 28, 2020

Actually my question is related to the "rtscts: false" setting which I cannot find among the ESPEasy serial server configuration options.

As this is a setting that should be defined at the serial interface level of the CC2530 device, and now given that the NodeMCU/ESP8266 board will connect directly to the CC2530, I imagine the setting should be placed at NodeMCU level and not at zigbee2mqtt level.

Any ideas?
Thanks

@fred-c1
Copy link

fred-c1 commented Feb 28, 2020

If you don't see anything about RTS and CTS signals
https://en.wikipedia.org/wiki/RTS/CTS

it probably means that it is not supported
This is OK since since there is no RTS or CTS on CC2530 (hardware or firmware)

@pharpe
Copy link

pharpe commented May 8, 2020

@tpavesi Yes, the CC2530/CC2531 chip uses the 3.3V voltage, but 50% of boards have a builtin DC shifter and accept 5V.

How do I know if my board will accept 5V? I ordered from aliexpress but I don't see anything about 5V in the description. I was going to power it with the HLK-PM03 per the router guide but I don't want to burn it up with too much voltage.

@ptvoinfo
Copy link
Contributor

ptvoinfo commented May 8, 2020

@pharpe Look for a small AMS1117 chip on the board.

@pharpe
Copy link

pharpe commented May 11, 2020

I have one that is working on the 5V HLK-PM03. I was going to buy another and the picture looks identical to the one I have but I don't see the AMS1117 chip on either. Unless its that silver one that I can't read.
image

@ptvoinfo
Copy link
Contributor

The board on this image uses VCC=3.3V.

@codmpm
Copy link

codmpm commented Jun 24, 2020

I've built an USB powered router PCB (open source) based on the ebyte E18-MS1PA1-IPX (CC2530+CC2592). Hit me up, if you need something like that.

cc2530-cc2595-zigbee-router-small

@Pascal2708
Copy link

How good is the range of it compared to a CC2531? How can we build it?

@talondnb
Copy link

I use two of these:

https://www.aliexpress.com/item/4000112752493.html

Great range and reliability in my long home (10m x 50m).

@Pascal2708
Copy link

Is this CC2530 or CC2531 because both names are in the product. Which firmware does it use?

@talondnb
Copy link

Is this CC2530 or CC2531 because both names are in the product. Which firmware does it use?

CC2530. It uses the same Zstack firmware. Check the z2m wiki.

@codmpm
Copy link

codmpm commented Jun 27, 2020

My standalone router uses the CC2530 plus an CC2592 RF Range Extender:
https://www.ti.com/product/CC2592

I implement the E18-MS1PA1-IPX Module from ebyte. They state 1000m in the data sheet, which os obviously only in an ideal situation. The CC2530 (E18-MS1-IPX) from them - so without CC2592 - is specified with 240m under ideal circumstances.

Our pcb (#52 (comment)) is powered with an 5V USB power adapter and has a custom firmware from ptvo.info, based on Z-Stack 1.2:
https://ptvo.info/cc2530-cc2590-cc2591-cc2592-rfx2401-routers-190/
https://ptvo.info/zigbee-configurable-firmware-features/

Here is our test zigbee mesh mapped out with zigbee2mqtt's mapping feature:
Bildschirmfoto_2020-06-12_um_15 22 19

We are currently finishing up the documentation. It is open source (CC-BY-NC-SA) and will be buyable in germany in the next weeks. There will be an PCB version and a complete bundle with 3d printed case, antenna and power adaptor.
If you want to have one outside of germany, drop me a message.


I've also built some coordinators using these CC2530+CC2592 modules for the Raspberry Pi - see my blog post about that (german): https://allgeek.de/2020/06/22/zigbee-modul-fuer-den-raspberrypi-cc2530-mit-homegear-oder-zigbee2mqtt/
They are also buyable in our webshop and you can choose between Z-Stack firmware 1.2 or 3.0.x.

@pedroborges1
Copy link

good, where can I get the ebyte E18-MS1PA1-IPX (CC2530 + CC2592) ?

@codmpm
Copy link

codmpm commented Jul 2, 2020

See the blog bost, there are links to our shop where I'm selling coordinators based on the E18-MS1PA1-IPX.
Contact me ([email protected]) if you need shipping outside germany or a E18-MS1PA1-IPX SMD module.
Also hit me up if you wan't to have one of the routers from my earlier post. We are currently finishing the manual for the router, thus it is not listed in the webshop yet.

Albeit, I don't want to hijack this issue for marketing purposes. Sorry for that.

//edit:
router is now buyable in our webshop.

@lemasorange
Copy link

@kirovilya ce n'est pas simple comme vous le pensez :)

  1. vous devez flasher un nouveau firmware.
  2. vous devez le placer quelque part avec une source d'alimentation 5V et il s'agit généralement d'un endroit caché. Donc à mon humble avis, CC2530 est mieux.
    Par conséquent, j'utilise CC2531 uniquement comme renifleur.

La carte sur cette image utilise VCC=3.3V.

Hello ptvinfo
well done for your work
I flash the same card as in this photo with a debug cc: RAS
I inject the firware router-cc2530-cc2591-diag.hex: RAS

On the other hand under home assistant no apeirage zigbee2mqmtt.

Am I missing something?

Thank you for your answer

@tlc76
Copy link

tlc76 commented Jan 9, 2022

Hi, do you also build stand-alone Coordinators based on an E18-MS1PA1-IPX and an ESP8266/ESP32 board?
thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests