Closed makuser closed 5 years ago
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Hi @makuser, any success with this? I have a similar scenario: XBee PRO S2B + Arduino Uno + XBee Shield and I want to know with I can router with this. I think I have to flash my XBee PRO but which firmware? Do you know? Thanks!
I have paired my XBee-PRO S2B as a router in zigbee2mqtt and it is working fine. It shows up as an unknown device but that does not seem to affect operation.
The settings I used were ZS = 2 NJ = 5A NO = 3 EE = 1 EO = 1 SN = AF0 SP = 64
Its the blue box on the networkmap.
@thompsa how did you manage to pair it? What's the exact procedure you did to have the S2B to join the network?
I put zigbee2mqtt in paring mode and then just powered up the Xbee again. It found the network and joined it. I had the PanID unset on the Xbee so it will join any network. You can then refresh the operating network parameters in XCTU to ensure AI,OP,OI,CH show its connected and on the right network.
I am using the firmware XBP24-ZB, ZigBee Router API mode, version 23A7
It's great, @thompsa! Realy thanks! I'll try this and back to report! Thanks again!
Unfortunately, I could not use my XBee Pro S2B yet, @thompsa...
With data/configuration.yaml
:
# Home Assistant integration (MQTT discovery)
homeassistant: false
# allow new devices to join
permit_join: true
# MQTT settings
mqtt:
# MQTT base topic for zigbee2mqtt MQTT messages
base_topic: zigbee2mqtt
# MQTT server URL
server: 'mqtt://localhost'
# MQTT server authentication, uncomment if required:
# user: my_user
# password: my_password
# Serial settings
serial:
# Location of CC2531 USB sniffer
port: /dev/ttyACM0
advanced:
rtscts: false
log_level: debug
report: true
When I try start zigbee2mqtt I get some errors:
01:02 in zigbee2mqtt on master [✘!] ➜ DEBUG=* npm start
> zigbee2mqtt@1.5.1 start /home/bernardo/workspaces/bernardolm/zigbee2mqtt
> node index.js
serialport/bindings loading LinuxBinding +0ms
zigbee2mqtt:info 8/29/2019, 1:02:25 AM Logging to directory: '/home/bernardo/workspaces/bernardolm/zigbee2mqtt/data/log/2019-08-29.01-02-25'
zigbee2mqtt:debug 8/29/2019, 1:02:25 AM Removing old log directory '/home/bernardo/workspaces/bernardolm/zigbee2mqtt/data/log/2019-08-29.00-28-49'
zigbee2mqtt:debug 8/29/2019, 1:02:25 AM Loaded state from file /home/bernardo/workspaces/bernardolm/zigbee2mqtt/data/state.json
zigbee2mqtt:debug 8/29/2019, 1:02:25 AM Saving state to file /home/bernardo/workspaces/bernardolm/zigbee2mqtt/data/state.json
zigbee2mqtt:info 8/29/2019, 1:02:25 AM Starting zigbee2mqtt version 1.5.1 (commit #ac3b924)
zigbee2mqtt:info 8/29/2019, 1:02:25 AM Starting zigbee-shepherd
zigbee2mqtt:debug 8/29/2019, 1:02:25 AM Using zigbee-shepherd with settings: '{"net":{"panId":6754,"extPanId":[221,221,221,221,221,221,221,221],"channelList":[11],"precfgkey":"HIDDEN"},"dbPath":"/home/bernardo/workspaces/bernardolm/zigbee2mqtt/data/database.db","coordBackupPath":"/home/bernardo/workspaces/bernardolm/zigbee2mqtt/data/coordinator_backup.json","sp":{"baudRate":115200,"rtscts":false}}'
zigbee-shepherd:init zigbee-shepherd booting... +0ms
cc-znp Initialize, opening serial port +0ms
serialport/stream opening path: /dev/ttyACM0 +0ms
serialport/binding-abstract open +0ms
serialport/stream _read queueing _read for after open +1ms
serialport/bindings/poller Creating poller +0ms
serialport/stream opened path: /dev/ttyACM0 +2ms
serialport/stream _write 1 bytes of data +0ms
serialport/binding-abstract write 1 bytes +3ms
serialport/stream _read reading +0ms
serialport/binding-abstract read +1ms
serialport/bindings/unixWrite Starting write 1 bytes offset 0 bytesToWrite 1 +0ms
serialport/bindings/unixRead Starting read +0ms
serialport/bindings/unixWrite write returned null 1 +1ms
serialport/bindings/unixWrite wrote 1 bytes +0ms
serialport/bindings/unixWrite Finished writing 1 bytes +0ms
serialport/stream binding.write write finished +2ms
serialport/bindings/unixRead waiting for readable because of code: EAGAIN +2ms
serialport/bindings/poller Polling for "readable" +3ms
cc-znp The serialport /dev/ttyACM0 is opened. +1s
zigbee-shepherd:request REQ --> SYS:version +0ms
cc-znp:SREQ --> SYS:version, {} +0ms
unpi:writer --> frame [254,0,33,2,35] +0ms
serialport/stream _write 5 bytes of data +1s
serialport/binding-abstract write 5 bytes +1s
serialport/bindings/unixWrite Starting write 5 bytes offset 0 bytesToWrite 5 +1s
serialport/bindings/unixWrite write returned null 5 +0ms
serialport/bindings/unixWrite wrote 5 bytes +0ms
serialport/bindings/unixWrite Finished writing 5 bytes +0ms
serialport/stream binding.write write finished +0ms
cc-znp:SRSP <-- SYS:version, __timeout__ +0ms
zigbee-shepherd:request RSP <-- SYS:version +3s
zigbee-shepherd:request REQ --> SYS:osalNvRead +2ms
cc-znp:SREQ --> SYS:osalNvRead, { id: 3840, offset: 0, len: 1, value: [ 85 ] } +3s
unpi:writer --> frame [254,3,33,8,0,15,0,37] +3s
serialport/stream _write 8 bytes of data +3s
serialport/binding-abstract write 8 bytes +3s
serialport/bindings/unixWrite Starting write 8 bytes offset 0 bytesToWrite 8 +3s
serialport/bindings/unixWrite write returned null 8 +1ms
serialport/bindings/unixWrite wrote 8 bytes +0ms
serialport/bindings/unixWrite Finished writing 8 bytes +0ms
serialport/stream binding.write write finished +1ms
cc-znp:SRSP <-- SYS:osalNvRead, __timeout__ +3s
zigbee-shepherd:request RSP <-- SYS:osalNvRead +3s
zigbee-shepherd:init Coordinator initialize had an error: Error: request timeout
at CcZnp.<anonymous> (/home/bernardo/workspaces/bernardolm/zigbee2mqtt/node_modules/zigbee-herdsman/dist/cc-znp/index.js:208:22)
at Object.onceWrapper (events.js:286:20)
at CcZnp.emit (events.js:198:13)
at Timeout.<anonymous> (/home/bernardo/workspaces/bernardolm/zigbee2mqtt/node_modules/zigbee-herdsman/dist/cc-znp/index.js:192:18)
at ontimeout (timers.js:436:11)
at tryOnTimeout (timers.js:300:5)
at listOnTimeout (timers.js:263:5)
at Timer.processTimers (timers.js:223:10) +0ms
zigbee2mqtt:info 8/29/2019, 1:02:32 AM Error while starting zigbee-shepherd, attempting to fix... (takes 60 seconds) (Error: request timeout)
serialport/stream #flush +3s
serialport/binding-abstract flush +3s
serialport/stream binding.flush finished +1ms
serialport/stream #close +0ms
serialport/binding-abstract close +1ms
serialport/bindings/poller Stopping poller +7s
serialport/bindings/poller Destroying poller +0ms
serialport/stream binding.read error { Error: Canceled
at Poller.emitCanceled (/home/bernardo/workspaces/bernardolm/zigbee2mqtt/node_modules/zigbee-herdsman/node_modules/@serialport/bindings/lib/poller.js:101:17)
at Poller.stop (/home/bernardo/workspaces/bernardolm/zigbee2mqtt/node_modules/zigbee-herdsman/node_modules/@serialport/bindings/lib/poller.js:91:10)
at close.then (/home/bernardo/workspaces/bernardolm/zigbee2mqtt/node_modules/zigbee-herdsman/node_modules/@serialport/bindings/lib/linux.js:48:19) canceled: true } +2ms
serialport/stream _read queueing _read for after open +0ms
serialport/stream binding.close finished +5ms
cc-znp The serialport /dev/ttyACM0 is closed. +6s
zigbee2mqtt:info 8/29/2019, 1:03:32 AM Starting zigbee-shepherd
zigbee-shepherd:init zigbee-shepherd booting... +1m
cc-znp Initialize, opening serial port +1m
serialport/stream opening path: /dev/ttyACM0 +1m
serialport/binding-abstract open +1m
serialport/bindings/poller Creating poller +1m
serialport/stream opened path: /dev/ttyACM0 +1ms
serialport/stream _write 1 bytes of data +1ms
serialport/binding-abstract write 1 bytes +2ms
serialport/bindings/unixWrite Starting write 1 bytes offset 0 bytesToWrite 1 +1m
serialport/bindings/unixWrite write returned null 1 +0ms
serialport/bindings/unixWrite wrote 1 bytes +0ms
serialport/bindings/unixWrite Finished writing 1 bytes +0ms
serialport/stream binding.write write finished +0ms
cc-znp The serialport /dev/ttyACM0 is opened. +1s
zigbee-shepherd:request REQ --> SYS:version +1m
cc-znp:SREQ --> SYS:version, {} +1m
unpi:writer --> frame [254,0,33,2,35] +1m
cc-znp:SRSP <-- SYS:version, __timeout__ +1m
zigbee-shepherd:request RSP <-- SYS:version +3s
zigbee-shepherd:request REQ --> SYS:osalNvRead +1ms
cc-znp:SREQ --> SYS:osalNvRead, { id: 3840, offset: 0, len: 1, value: [ 85 ] } +3s
unpi:writer --> frame [254,3,33,8,0,15,0,37] +3s
cc-znp:SRSP <-- SYS:osalNvRead, __timeout__ +3s
zigbee-shepherd:request RSP <-- SYS:osalNvRead +3s
zigbee-shepherd:init Coordinator initialize had an error: Error: request timeout
at CcZnp.<anonymous> (/home/bernardo/workspaces/bernardolm/zigbee2mqtt/node_modules/zigbee-herdsman/dist/cc-znp/index.js:208:22)
at Object.onceWrapper (events.js:286:20)
at CcZnp.emit (events.js:198:13)
at Timeout.<anonymous> (/home/bernardo/workspaces/bernardolm/zigbee2mqtt/node_modules/zigbee-herdsman/dist/cc-znp/index.js:192:18)
at ontimeout (timers.js:436:11)
at tryOnTimeout (timers.js:300:5)
at listOnTimeout (timers.js:263:5)
at Timer.processTimers (timers.js:223:10) +1m
zigbee2mqtt:error 8/29/2019, 1:03:39 AM Error while starting zigbee-shepherd! (Error: request timeout)
zigbee2mqtt:error 8/29/2019, 1:03:39 AM Press the reset button on the stick (the one closest to the USB) and start again
zigbee2mqtt:error 8/29/2019, 1:03:39 AM Failed to start
{"message":"request timeout","stack":"Error: request timeout\n at CcZnp.<anonymous> (/home/bernardo/workspaces/bernardolm/zigbee2mqtt/node_modules/zigbee-herdsman/dist/cc-znp/index.js:208:22)\n at Object.onceWrapper (events.js:286:20)\n at CcZnp.emit (events.js:198:13)\n at Timeout.<anonymous> (/home/bernardo/workspaces/bernardolm/zigbee2mqtt/node_modules/zigbee-herdsman/dist/cc-znp/index.js:192:18)\n at ontimeout (timers.js:436:11)\n at tryOnTimeout (timers.js:300:5)\n at listOnTimeout (timers.js:263:5)\n at Timer.processTimers (timers.js:223:10)"}
zigbee2mqtt:error 8/29/2019, 1:03:39 AM Exiting...
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! zigbee2mqtt@1.5.1 start: `node index.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the zigbee2mqtt@1.5.1 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/bernardo/.npm/_logs/2019-08-29T04_03_39_778Z-debug.log
I'm trying achieve with this setup:
Searching on internet I realized that my XBee (XBP24BZ7, XBee Pro S2B) isn't same yours (XBP24-ZB, XBee Pro S2 [without B]) but I can't believe that this is a problem, the firmware version 23A7 is the same.
Do you have any idea? And you are using only zigbee2mqtt or it's together with Hassio, ioBroker, Domoticz...?
Thanks by support!
Oh, You can't use a XBee for the zigbee2mqtt controller. You need to use a CC2531, see here https://www.zigbee2mqtt.io/getting_started/what_do_i_need.html
I am using my XBee-PRO S2B as a router (ie zigbee repeater) to increase the range of the CC2531. If you want to use a XBee as the coordinator then you need to use the zha component on Home Assistant. https://www.home-assistant.io/components/zha/
😞 I understand, @thompsa... I was believing that you and @makuser are using some XBee shield instead CC2531. Now I did understand how is your setup.
So I'll read these links and about how to use XBee as coordinator.
Just one more question, I'll need one XBee as coordinator and another one as router? Or just one as coordinator is enought to connect to my XBee devices like Xiaomi Aqara sensor?
Again, thank you so much by help!
@bernardolm you can not use an XBee as coordinator with zigbee2mqtt. For that if you are using zigbee2mqtt with Home Assistant, you could to use the zha
component directly or some other solution.
One thing is for sure: The XBee platform is not supported by zigbee2mqtt. You'll have to use a software relying on for example https://github.com/zigpy/zigpy-xbee to use the XBee.
What were you planning to use the XBee with? Home Assistant? Domoticz?
Thank you so much, @makuser.
Ok, I did understand about can't use XBee directly with zigbee2mqtt. I will read and try one these another approachs to do that.
About the app I planning to use, I can say that I will use any that this setup works. I don't have preference, today I don't use any of them.
@thompsa : I'm trying to get some XBee Pro S3B to act as router. I installed the latest firmware for those, then I set the CR (Routing/Messaging Mode to standard).
I tried a few things 1) Set the PAN ID to 0 in XCTU, press on the join button on the coordinator, reset the device. 2) Set the ID (Network Id) to the same value as pan_id in my configuration.yaml + set the Encryption Enable (EE) and KY (AES Encyption Key) to the network_key value of configuration.yaml. I also tried to align my settings with yours for those that exist in my version (S3B): NO = 3 SP = 64 SN = AF0 EE = 1
I would appreciate if you have any more insight/idea on why it might not work. Also, on your side, did you provide the PanId or did your Xbee was able to join automatically ?
Thanks!
Make sure you set the KY setting to "5A6967426565416C6C69616E63653039". That was the setting that made everything work for me.
Having an xbee joining the PAN yields this:
I was trying to get a buffer like here: https://github.com/Koenkk/zigbee2mqtt/issues/516#issuecomment-432199639, so I used
DEBUG=* npm start
, to find out why the modelID is undefined.