zigbee2mqtt icon indicating copy to clipboard operation
zigbee2mqtt copied to clipboard

Extending Zigbee Range with CC2530 + CC2591

Open HKC001 opened this issue 8 years ago • 38 comments

Following on from: https://github.com/Koenkk/zigbee2mqtt/issues/52, I was wondering if anyone can provide more specific links detailing the cc2530 + cc2591 setup.

  1. For use with zigbee2mqtt, should I be using the firmware at ptvo.info or on james-fry's page?

  2. How do you maintain power supply and connection to a Raspberry Pi 3 B+? Is there a shield available, or do we use jumper cables? Is there a link to a product or jumper cabling guide to help achieve this connection?

  3. For those who have used any of the 4 devices here, how do you normally position them? I have 2 CC2531s I plan to use as routers, and the cc2530 + cc2591 as a coordinator on my Pi. I understand that the cc2530 + cc2591 is more sensitive and can 'hear' better, so the CC2531's effective range is increased. But how big is the range increase? Is it only 2 - 3 meters, or more?

And just a random question, but has anyone considered using the RS232 based on the CC2630 chip? It claims to have a 1.6KM range!

HKC001 avatar Oct 09 '18 16:10 HKC001

  1. https://github.com/Koenkk/Z-Stack-firmware/blob/master/coordinator/CC2530_CC2591/bin/CC2530_CC2591ZNP-Prod.hex

  2. mine is attach to a usb2serial converter, with a long usb cable ever looked at https://github.com/Koenkk/zigbee2mqtt/issues/291#issuecomment-424116534 with the firmware from 1) you don't need to ground P2_0, P0_6 and P0_4

  3. my cc2531-cc2590 is in my living room, downstairs, It attach to wall, 2meter high. at the moment I have 3 routers downstairs. t I've replaced my cc2531 by cc2530+cc2590 2 days ago

and now I've just replaced the antenna by a 9db wifi one.

don't know about CC2630, i've been looking at cc2538+cc2592 but there's no support for either of them yet

lolorc avatar Oct 10 '18 10:10 lolorc

the 9db antenna test is a failure, worst rssi.

lolorc avatar Oct 10 '18 12:10 lolorc

Hi @lolorc , I see that the firmware you propose is not the one mentioned on the wiki. What's the advantage of the one that you recommend?

Which usb2serial converter are you using?

I believe the #291 comment mixed up RX and TX. And does not mention 3.3v to VCC on the 2530, I assume that is needed as well to power the board?

GoSpursGoNL avatar Oct 14 '18 05:10 GoSpursGoNL

I think it's just matter of updating the wiki :) this one removes the need for bridging P2_0, P0_6 and P0_4, it doesn't require hardware control. and if I recall correctly it also has increased buffers.

About powering the cc2530 from the rpi, as far as I remember the rpi is not able to provide a lot of current on its 3.3V output. My usb2serial converter is a FT232BM clone, I power the cc2530 from it with its 5V output, and the serial levels are ttl ones, 3.3V. So I would connect my cc2530+cc2590 to the 5V output of the rpi. I can't check right now, but my board might have a 3.3V reg because the cc2530 is not supposed to be 5V tolerant.

lolorc avatar Oct 14 '18 19:10 lolorc

Flashed successfully and it's working correctly in combination with the 3.3v from the Pi, thanks.

GoSpursGoNL avatar Oct 18 '18 08:10 GoSpursGoNL

The range is still not as good as the Xiaomi Gateway though.

GoSpursGoNL avatar Oct 21 '18 06:10 GoSpursGoNL

This is failing for me, can someone give some advice? My error:

  zigbee2mqtt:info 2018-10-25 14:58:05 Starting zigbee2mqtt version 0.1.8 (commit #unknown)
  zigbee2mqtt:info 2018-10-25 14:58:05 Starting zigbee-shepherd
  zigbee2mqtt:info 2018-10-25 14:58:06 Error while starting zigbee-shepherd, attemping to fix... (takes 60 seconds)
  zigbee2mqtt:info 2018-10-25 14:59:06 Starting zigbee-shepherd
  zigbee2mqtt:error 2018-10-25 14:59:06 Error while starting zigbee-shepherd!
  zigbee2mqtt:error 2018-10-25 14:59:06 Press the reset button on the stick (the one closest to the USB) and start again
  zigbee2mqtt:error 2018-10-25 14:59:06 Failed to start
	{"message":"Error: No such file or directory, cannot open /dev/ttyACM0","stack":"Error: Error: No such file or directory, cannot open /dev/ttyACM0"

My steps:

  1. Got this cc2530+cc2591, which looks exactly like the one in https://github.com/Koenkk/zigbee2mqtt/issues/52.

  2. I'm using Hass.IO, so I tried disabling BT and switching the UART by adding these lines in config.txt:

dtoverlay=pi3-disable-bt
dtoverlay=pi3-miniuart-bt
  1. Flashed CC2530_CC2591ZNP-Prod.hex from the link above, filesize 681 KB. Using those single pin wires (UART?) connected cc2530+cc2591 to CC Debugger:
P2_2 > DC
P2_1 > DD
RST  > RESETn
GND > GND
VCC > 3.3V from Debugger
  1. Flashed without issues. Then using the same UART wires, connected cc2530+cc2591 to Pi 3B+ (numbered according to this pinout
P0_2 (RX) > BCM 14 (TX, pin 8)
P0_3 (TX) > BCM 14 (RX, pin 10) 
GND > GND (pin 9)
VCC > 3.3V (pin 1)

HKC001 avatar Oct 25 '18 07:10 HKC001

@HKC001 Execute ls /dev/ttyS* in the console. The port name should look like /dev/ttyS1

ptvoinfo avatar Oct 25 '18 07:10 ptvoinfo

I don't have any ttyS* port

core-ssh:~# cd /dev/
core-ssh:/dev# ls
fd       init     null     pts      shm      stdin    tty      zero
full     mqueue   ptmx     random   stderr   stdout   urandom

The tty word is in pink. Also tried the debug console:

hassio > hw info
{
    "result": "ok",
    "data": {
        "serial": [
            "/dev/ttyAMA0"
        ],
        "input": [],
        "disk": [],
        "gpio": [
            "gpiochip128",
            "gpiochip0"
        ],
        "audio": {
            "0": {
                "name": "bcm2835_alsa - bcm2835 ALSA",
                "type": "ALSA",
                "devices": {
                    "0": "digital audio playback",
                    "1": "digital audio playback"
                }
            }
        }
    }
}

HKC001 avatar Oct 25 '18 08:10 HKC001

I tried plugging in 2 devices at once, a working cc2531 coordinator and a cc2530 + cc2591 + ptvoinfo's firmware, and now 2 serial connections are showing, but none of them are ttyS* ports.

    "data": {
        "serial": [
            "/dev/ttyACM0",
            "/dev/ttyAMA0"
        ],

HKC001 avatar Oct 25 '18 23:10 HKC001

Hi, I can't understand the range off CC2531 coordinator. My CC2351 in my office room, upstairs. My senors (Xiaomi Aqara temperature sensor WSDCGQ11LM and Xiaomi Aqara door sensor MCCGQ11LM) are in the next room, about 3-4M from the coordinator with 2 walls between. I found that the CC2531 coordinator is failing to receive updates. BUT i have another Xiaomi Aqara door sensor, it's in my living room, downstairs, about 8M from the coordinator. The CC2531 coordinator is alway receive updates from it.

So, I plan to use CC2531 as routers, and the cc2530 + cc2591 as a coordinator. Does this have a better?

mrfoxbit avatar Oct 26 '18 02:10 mrfoxbit

CC2530 does not have a USB interface. Therefore, you need to connect it to Rx, Tx pins in your SBC (RPi for example). Did you enable the built-in UART? Or do you use an additional UART to USB converter?

ptvoinfo avatar Oct 26 '18 04:10 ptvoinfo

Can I use USB UART CP2102? (for flash and use on RPi)

download

mrfoxbit avatar Oct 26 '18 04:10 mrfoxbit

Ok, got a little further but still no success so far. But this is what I tried:

  1. Using this USB to TTL/232 and lolorc's firmware from his first post above.
  2. In zigbee2mqtt config, set "serial_port": "/dev/ttyUSB0"
  3. Removed from config.txt:
dtoverlay=pi3-disable-bt
dtoverlay=pi3-miniuart-bt
  1. Upon starting up, I get a new error:
2018-10-26 13:53:44 - error: Failed to start Error: request timeout
    at CcZnp.<anonymous> (/zigbee2mqtt-0.1.8/node_modules/cc-znp/lib/ccznp.js:255:22)
    at Object.onceWrapper (events.js:315:30)
    at emitOne (events.js:116:13)
    at CcZnp.emit (events.js:211:7)
    at Timeout.<anonymous> (/zigbee2mqtt-0.1.8/node_modules/cc-znp/lib/ccznp.js:234:18)
    at ontimeout (timers.js:498:11)
    at tryOnTimeout (timers.js:323:5)
    at Timer.listOnTimeout (timers.js:290:5)

HKC001 avatar Oct 26 '18 05:10 HKC001

Hi all, did anything come of this? I've moved from a cc2531 to a cc2530 and I'm attempting to use a USB TTL stick to connect the cc2530 to the pi. ttyUSB0 appears when I plug it in, but the shepherd just gives a message "request timeout". BTW, I'm running this through the home assistant addon with the following: zigbee2mqtt:debug 2018-11-5 15:18:49 Using zigbee-shepherd with settings: '{"net":{"panId":6754,"channelList":[11]},"dbPath":"/share/zigbee2mqtt/database.db","sp":{"baudRate":115200,"rtscts":true}}'

RodBr avatar Nov 05 '18 04:11 RodBr

I FINALLY got the CC2530 + RFX2401 (the device on the far right) running with a Pi 3B+ with 25 devices joined.

I think the setup is similar to the CC2530 + CC2591. Here's what I did, if this info helps you, please post here so others know:

  1. Soldered according to this image from Kirovilya.

  2. Flashed Koenkk's optimised firmware, coordinator version 20181030.

  3. Did NOT add these lines into the Pi config.:

dtoverlay=pi3-disable-bt
dtoverlay=pi3-miniuart-bt
  1. Using zigbee2mqtt-edge, zigbee2mqtt version 0.1.8 (commit #2e736bf), set "rtscts": false and "serial_port": "/dev/ttyUSB0" on the config page.

  2. After the above, plug in the usb stick for the first time then power on/off the Pi. There might be a zigbee2mqtt:info 2018-10-25 14:58:06 Error while starting zigbee-shepherd, attemping to fix... (takes 60 seconds) error message, but wait awhile and it should initialise. I did not see anymore errors after the first successful initialisation.

HKC001 avatar Nov 05 '18 06:11 HKC001

Thanks @HKC001 for that info.

So the firmware for CC2530+CC2591 works with the CC2530+RFX2401?

Sent with GitHawk

ryanbeaton avatar Nov 05 '18 06:11 ryanbeaton

@HKC001 @lolorc So what's the "best one"?

I ideally I want to just power it using raspberry pi's power output but still have a have lot of range

thibaultmol avatar Nov 11 '18 14:11 thibaultmol

@ryanbeaton Yes. I did find issues after a few days, but its still a big improvement over the 'default' firmware, so I strongly suggest you give it a try for a few days.

@thibaultmol I've only tried the CC2531 and CC2530 + RFX2401. If you can solder (or are willing to try, its not that hard), I really suggest you go for the CC2530 + RFX2401. For me, the CC2531's range is too short and keeps dropping devices from the network, causing automations to break every so often. Having unreliable automations is far worse than no automations.

HKC001 avatar Nov 11 '18 16:11 HKC001

anybody tried this version of CC2530+CC2591?

AnhDuc85 avatar Nov 27 '18 17:11 AnhDuc85