Koenkk / zigbee2mqtt

Zigbee 🐝 to MQTT bridge 🌉, get rid of your proprietary Zigbee bridges 🔨
https://www.zigbee2mqtt.io
GNU General Public License v3.0
12.14k stars 1.68k forks source link

Pair xbee-PRO S2B as router #880

Closed makuser closed 5 years ago

makuser commented 5 years ago

Having an xbee joining the PAN yields this:

  serialport:poller received "readable" +7s
  serialport:bindings read +7s
  serialport:unixRead Starting read +7s
  serialport:unixRead Finished read 17 bytes +0ms
  serialport:main binding.read finished +7s
  cc-znp { sof: 254,
  cc-znp   len: 12,
  cc-znp   type: 'AREQ',
  cc-znp   subsys: 'ZDO',
  cc-znp   cmd: 'tcDeviceInd',
  cc-znp   payload:
  cc-znp    { nwkaddr: 59254, extaddr: '0x0013a20040000001', parentaddr: 0 },
  cc-znp   fcs: 91,
  cc-znp   csum: 91 } +7s
  serialport:main _read reading +8ms
  serialport:bindings read +10ms
  serialport:unixRead Starting read +10ms
  cc-znp:AREQ <-- ZDO:tcDeviceInd, { nwkaddr: 59254, extaddr: '0x0013a20040000001', parentaddr: 0 } +5ms
  zigbee-shepherd:msgHdlr IND <-- ZDO:tcDeviceInd +2ms
  serialport:unixRead waiting for readable because of code: EAGAIN +3ms
  serialport:poller Polling for "readable" +15ms
  serialport:poller received "readable" +33ms
  serialport:bindings read +37ms
  serialport:unixRead Starting read +34ms
  serialport:unixRead Finished read 18 bytes +1ms
  serialport:main binding.read finished +39ms
  cc-znp { sof: 254,
  cc-znp   len: 13,
  cc-znp   type: 'AREQ',
  cc-znp   subsys: 'ZDO',
  cc-znp   cmd: 'endDeviceAnnceInd',
  cc-znp   payload:
  cc-znp    { srcaddr: 59254,
  cc-znp      nwkaddr: 59254,
  cc-znp      ieeeaddr: '0x0013a20040000001',
  cc-znp      capabilities: 142 },
  cc-znp   fcs: 78,
  cc-znp   csum: 78 } +41ms
  serialport:main _read reading +9ms
  serialport:bindings read +11ms
  serialport:unixRead Starting read +10ms
  cc-znp:AREQ <-- ZDO:endDeviceAnnceInd, { srcaddr: 59254, nwkaddr: 59254, ieeeaddr: '0x0013a20040000001', capabilities: 142 } +5ms
  zigbee-shepherd spinlock: false [] +2ms
  zigbee-shepherd:request REQ --> ZDO:nodeDescReq +3ms
  cc-znp:SREQ --> ZDO:nodeDescReq, { dstaddr: 59254, nwkaddrofinterest: 59254 } +1ms
  serialport:main _write 9 bytes of data +11ms
  serialport:bindings write 9 bytes +11ms
  zigbee-shepherd:msgHdlr IND <-- ZDO:endDeviceAnnceInd +5ms
  serialport:unixWrite Starting write 9 bytes offset 0 bytesToWrite 9 +7s
  serialport:unixRead waiting for readable because of code: EAGAIN +14ms
  serialport:poller Polling for "readable" +25ms
  serialport:unixWrite write returned null 9 +2ms
  serialport:unixWrite wrote 9 bytes +0ms
  serialport:unixWrite Finished writing 9 bytes +1ms
  serialport:main binding.write write finished +6ms
  serialport:poller received "readable" +10ms
  serialport:bindings read +13ms
  serialport:unixRead Starting read +11ms
  serialport:unixRead Finished read 6 bytes +0ms
  serialport:main binding.read finished +10ms
  cc-znp { sof: 254,
  cc-znp   len: 1,
  cc-znp   type: 'SRSP',
  cc-znp   subsys: 'ZDO',
  cc-znp   cmd: 'nodeDescReq',
  cc-znp   payload: { status: 0 },
  cc-znp   fcs: 102,
  cc-znp   csum: 102 } +18ms
  serialport:main _read reading +7ms
  serialport:bindings read +10ms
  serialport:unixRead Starting read +9ms
  cc-znp:SRSP <-- ZDO:nodeDescReq, { status: 0 } +5ms
  serialport:unixRead waiting for readable because of code: EAGAIN +2ms
  serialport:poller Polling for "readable" +12ms
  serialport:poller received "readable" +423ms
  serialport:bindings read +425ms
  serialport:unixRead Starting read +424ms
  serialport:unixRead Finished read 8 bytes +1ms
  serialport:main binding.read finished +428ms
  cc-znp { sof: 254,
  cc-znp   len: 3,
  cc-znp   type: 'AREQ',
  cc-znp   subsys: 'ZDO',
  cc-znp   cmd: 'srcRtgInd',
  cc-znp   payload: { dstaddr: 59254, relaycount: 0, relaylist: <Buffer > },
  cc-znp   fcs: 19,
  cc-znp   csum: 19 } +432ms
  serialport:main _read reading +9ms
  serialport:bindings read +12ms
  serialport:unixRead Starting read +10ms
  cc-znp:AREQ <-- ZDO:srcRtgInd, { dstaddr: 59254, relaycount: 0, relaylist: <Buffer > } +5ms
  zigbee-shepherd:msgHdlr IND <-- ZDO:srcRtgInd +1ms
  serialport:unixRead Finished read 23 bytes +3ms
  serialport:main binding.read finished +4ms
  cc-znp { sof: 254,
  cc-znp   len: 18,
  cc-znp   type: 'AREQ',
  cc-znp   subsys: 'ZDO',
  cc-znp   cmd: 'nodeDescRsp',
  cc-znp   payload:
  cc-znp    { srcaddr: 59254,
  cc-znp      status: 0,
  cc-znp      nwkaddr: 59254,
  cc-znp      logicaltype_cmplxdescavai_userdescavai: 1,
  cc-znp      apsflags_freqband: 64,
  cc-znp      maccapflags: 142,
  cc-znp      manufacturercode: 4126,
  cc-znp      maxbuffersize: 82,
  cc-znp      maxintransfersize: 128,
  cc-znp      servermask: 0,
  cc-znp      maxouttransfersize: 128,
  cc-znp      descriptorcap: 0 },
  cc-znp   fcs: 70,
  cc-znp   csum: 70 } +7ms
  serialport:main _read reading +11ms
  serialport:bindings read +15ms
  serialport:unixRead Starting read +12ms
  cc-znp:AREQ <-- ZDO:nodeDescRsp, { srcaddr: 59254, status: 0, nwkaddr: 59254, logicaltype_cmplxdescavai_userdescavai: 1, apsflags_freqband: 64, maccapflags: 142, manufacturercode: 4126, maxbuffersize: 82, maxintransfersize: 128, servermask: 0, maxouttransfersize: 128, descriptorcap: 0 } +7ms
  zigbee-shepherd:msgHdlr IND <-- ZDO:nodeDescRsp +2ms
  zigbee-shepherd:request REQ --> ZDO:activeEpReq +2ms
  cc-znp:SREQ --> ZDO:activeEpReq, { dstaddr: 59254, nwkaddrofinterest: 59254 } +1ms
  serialport:main _write 9 bytes of data +10ms
  serialport:bindings write 9 bytes +9ms
  serialport:unixWrite Starting write 9 bytes offset 0 bytesToWrite 9 +480ms
  serialport:unixRead waiting for readable because of code: EAGAIN +11ms
  serialport:poller Polling for "readable" +39ms
  serialport:unixWrite write returned null 9 +2ms
  serialport:unixWrite wrote 9 bytes +1ms
  serialport:unixWrite Finished writing 9 bytes +0ms
  serialport:main binding.write write finished +4ms
  serialport:poller received "readable" +10ms
  serialport:bindings read +13ms
  serialport:unixRead Starting read +12ms
  serialport:unixRead Finished read 6 bytes +0ms
  serialport:main binding.read finished +11ms
  cc-znp { sof: 254,
  cc-znp   len: 1,
  cc-znp   type: 'SRSP',
  cc-znp   subsys: 'ZDO',
  cc-znp   cmd: 'activeEpReq',
  cc-znp   payload: { status: 0 },
  cc-znp   fcs: 97,
  cc-znp   csum: 97 } +22ms
  serialport:main _read reading +8ms
  serialport:bindings read +10ms
  serialport:unixRead Starting read +9ms
  cc-znp:SRSP <-- ZDO:activeEpReq, { status: 0 } +5ms
  serialport:unixRead waiting for readable because of code: EAGAIN +2ms
  serialport:poller Polling for "readable" +13ms
  serialport:poller received "readable" +6ms
  serialport:bindings read +9ms
  serialport:unixRead Starting read +8ms
  serialport:unixRead Finished read 8 bytes +0ms
  serialport:main binding.read finished +11ms
  cc-znp { sof: 254,
  cc-znp   len: 3,
  cc-znp   type: 'AREQ',
  cc-znp   subsys: 'ZDO',
  cc-znp   cmd: 'srcRtgInd',
  cc-znp   payload: { dstaddr: 59254, relaycount: 0, relaylist: <Buffer > },
  cc-znp   fcs: 19,
  cc-znp   csum: 19 } +15ms
  serialport:main _read reading +9ms
  serialport:bindings read +11ms
  serialport:unixRead Starting read +11ms
  cc-znp:AREQ <-- ZDO:srcRtgInd, { dstaddr: 59254, relaycount: 0, relaylist: <Buffer > } +5ms
  zigbee-shepherd:msgHdlr IND <-- ZDO:srcRtgInd +2ms
  serialport:unixRead waiting for readable because of code: EAGAIN +2ms
  serialport:poller Polling for "readable" +15ms
  serialport:poller received "readable" +31ms
  serialport:bindings read +36ms
  serialport:unixRead Starting read +33ms
  serialport:unixRead Finished read 13 bytes +1ms
  serialport:main binding.read finished +37ms
  cc-znp { sof: 254,
  cc-znp   len: 8,
  cc-znp   type: 'AREQ',
  cc-znp   subsys: 'ZDO',
  cc-znp   cmd: 'activeEpRsp',
  cc-znp   payload:
  cc-znp    { srcaddr: 59254,
  cc-znp      status: 0,
  cc-znp      nwkaddr: 59254,
  cc-znp      activeepcount: 2,
  cc-znp      activeeplist: <Buffer e6 e8> },
  cc-znp   fcs: 196,
  cc-znp   csum: 196 } +40ms
  serialport:main _read reading +10ms
  serialport:bindings read +12ms
  serialport:unixRead Starting read +11ms
  cc-znp:AREQ <-- ZDO:activeEpRsp, { srcaddr: 59254, status: 0, nwkaddr: 59254, activeepcount: 2, activeeplist: <Buffer e6 e8> } +6ms
  zigbee-shepherd:msgHdlr IND <-- ZDO:activeEpRsp +1ms
  zigbee-shepherd:request REQ --> ZDO:simpleDescReq +11ms
  cc-znp:SREQ --> ZDO:simpleDescReq, { dstaddr: 59254, nwkaddrofinterest: 59254, endpoint: 230 } +1ms
  serialport:main _write 10 bytes of data +18ms
  serialport:bindings write 10 bytes +18ms
  serialport:unixWrite Starting write 10 bytes offset 0 bytesToWrite 10 +106ms
  serialport:unixRead waiting for readable because of code: EAGAIN +20ms
  serialport:poller Polling for "readable" +33ms
  serialport:unixWrite write returned null 10 +2ms
  serialport:unixWrite wrote 10 bytes +0ms
  serialport:unixWrite Finished writing 10 bytes +0ms
  serialport:main binding.write write finished +5ms
  serialport:poller received "readable" +10ms
  serialport:bindings read +12ms
  serialport:unixRead Starting read +11ms
  serialport:unixRead Finished read 6 bytes +1ms
  serialport:main binding.read finished +10ms
  cc-znp { sof: 254,
  cc-znp   len: 1,
  cc-znp   type: 'SRSP',
  cc-znp   subsys: 'ZDO',
  cc-znp   cmd: 'simpleDescReq',
  cc-znp   payload: { status: 0 },
  cc-znp   fcs: 96,
  cc-znp   csum: 96 } +35ms
  serialport:main _read reading +29ms
  serialport:bindings read +32ms
  serialport:unixRead Starting read +30ms
  cc-znp:SRSP <-- ZDO:simpleDescReq, { status: 0 } +14ms
  serialport:unixRead Finished read 8 bytes +2ms
  serialport:main binding.read finished +4ms
  cc-znp { sof: 254,
  cc-znp   len: 3,
  cc-znp   type: 'AREQ',
  cc-znp   subsys: 'ZDO',
  cc-znp   cmd: 'srcRtgInd',
  cc-znp   payload: { dstaddr: 59254, relaycount: 0, relaylist: <Buffer > },
  cc-znp   fcs: 19,
  cc-znp   csum: 19 } +8ms
  serialport:main _read reading +10ms
  serialport:bindings read +13ms
  serialport:unixRead Starting read +11ms
  cc-znp:AREQ <-- ZDO:srcRtgInd, { dstaddr: 59254, relaycount: 0, relaylist: <Buffer > } +5ms
  zigbee-shepherd:msgHdlr IND <-- ZDO:srcRtgInd +1ms
  serialport:unixRead waiting for readable because of code: EAGAIN +3ms
  serialport:poller Polling for "readable" +48ms
  serialport:poller received "readable" +17ms
  serialport:bindings read +21ms
  serialport:unixRead Starting read +18ms
  serialport:unixRead Finished read 19 bytes +1ms
  serialport:main binding.read finished +22ms
  cc-znp { sof: 254,
  cc-znp   len: 14,
  cc-znp   type: 'AREQ',
  cc-znp   subsys: 'ZDO',
  cc-znp   cmd: 'simpleDescRsp',
  cc-znp   payload:
  cc-znp    { srcaddr: 59254,
  cc-znp      status: 0,
  cc-znp      nwkaddr: 59254,
  cc-znp      len: 8,
  cc-znp      endpoint: 230,
  cc-znp      profileid: 49413,
  cc-znp      deviceid: 0,
  cc-znp      deviceversion: 0,
  cc-znp      numinclusters: 0,
  cc-znp      inclusterlist: <Buffer >,
  cc-znp      numoutclusters: 0,
  cc-znp      outclusterlist: <Buffer > },
  cc-znp   fcs: 229,
  cc-znp   csum: 229 } +27ms
  serialport:main _read reading +11ms
  serialport:bindings read +12ms
  serialport:unixRead Starting read +11ms
  cc-znp:AREQ <-- ZDO:simpleDescRsp, { srcaddr: 59254, status: 0, nwkaddr: 59254, len: 8, endpoint: 230, profileid: 49413, deviceid: 0, deviceversion: 0, numinclusters: 0, inclusterlist: <Buffer >, numoutclusters: 0, outclusterlist: <Buffer > } +5ms
  zigbee-shepherd:msgHdlr IND <-- ZDO:simpleDescRsp +1ms
  zigbee-shepherd:request REQ --> ZDO:simpleDescReq +2ms
  cc-znp:SREQ --> ZDO:simpleDescReq, { dstaddr: 59254, nwkaddrofinterest: 59254, endpoint: 232 } +1ms
  serialport:main _write 10 bytes of data +8ms
  serialport:bindings write 10 bytes +8ms
  serialport:unixWrite Starting write 10 bytes offset 0 bytesToWrite 10 +96ms
  serialport:unixRead waiting for readable because of code: EAGAIN +10ms
  serialport:poller Polling for "readable" +23ms
  serialport:unixWrite write returned null 10 +2ms
  serialport:unixWrite wrote 10 bytes +0ms
  serialport:unixWrite Finished writing 10 bytes +0ms
  serialport:main binding.write write finished +4ms
  serialport:poller received "readable" +11ms
  serialport:bindings read +13ms
  serialport:unixRead Starting read +12ms
  serialport:unixRead Finished read 6 bytes +0ms
  serialport:main binding.read finished +10ms
  cc-znp { sof: 254,
  cc-znp   len: 1,
  cc-znp   type: 'SRSP',
  cc-znp   subsys: 'ZDO',
  cc-znp   cmd: 'simpleDescReq',
  cc-znp   payload: { status: 0 },
  cc-znp   fcs: 96,
  cc-znp   csum: 96 } +22ms
  serialport:main _read reading +7ms
  serialport:bindings read +8ms
  serialport:unixRead Starting read +8ms
  cc-znp:SRSP <-- ZDO:simpleDescReq, { status: 0 } +3ms
  serialport:unixRead waiting for readable because of code: EAGAIN +1ms
  serialport:poller Polling for "readable" +11ms
  serialport:poller received "readable" +5ms
  serialport:bindings read +9ms
  serialport:unixRead Starting read +7ms
  serialport:unixRead Finished read 8 bytes +0ms
  serialport:main binding.read finished +10ms
  cc-znp { sof: 254,
  cc-znp   len: 3,
  cc-znp   type: 'AREQ',
  cc-znp   subsys: 'ZDO',
  cc-znp   cmd: 'srcRtgInd',
  cc-znp   payload: { dstaddr: 59254, relaycount: 0, relaylist: <Buffer > },
  cc-znp   fcs: 19,
  cc-znp   csum: 19 } +14ms
  serialport:main _read reading +8ms
  serialport:bindings read +9ms
  serialport:unixRead Starting read +9ms
  cc-znp:AREQ <-- ZDO:srcRtgInd, { dstaddr: 59254, relaycount: 0, relaylist: <Buffer > } +4ms
  zigbee-shepherd:msgHdlr IND <-- ZDO:srcRtgInd +1ms
  serialport:unixRead waiting for readable because of code: EAGAIN +2ms
  serialport:poller Polling for "readable" +13ms
  serialport:poller received "readable" +35ms
  serialport:bindings read +38ms
  serialport:unixRead Starting read +37ms
  serialport:unixRead Finished read 19 bytes +0ms
  serialport:main binding.read finished +39ms
  cc-znp { sof: 254,
  cc-znp   len: 14,
  cc-znp   type: 'AREQ',
  cc-znp   subsys: 'ZDO',
  cc-znp   cmd: 'simpleDescRsp',
  cc-znp   payload:
  cc-znp    { srcaddr: 59254,
  cc-znp      status: 0,
  cc-znp      nwkaddr: 59254,
  cc-znp      len: 8,
  cc-znp      endpoint: 232,
  cc-znp      profileid: 49413,
  cc-znp      deviceid: 0,
  cc-znp      deviceversion: 0,
  cc-znp      numinclusters: 0,
  cc-znp      inclusterlist: <Buffer >,
  cc-znp      numoutclusters: 0,
  cc-znp      outclusterlist: <Buffer > },
  cc-znp   fcs: 235,
  cc-znp   csum: 235 } +44ms
  serialport:main _read reading +11ms
  serialport:bindings read +12ms
  serialport:unixRead Starting read +12ms
  cc-znp:AREQ <-- ZDO:simpleDescRsp, { srcaddr: 59254, status: 0, nwkaddr: 59254, len: 8, endpoint: 232, profileid: 49413, deviceid: 0, deviceversion: 0, numinclusters: 0, inclusterlist: <Buffer >, numoutclusters: 0, outclusterlist: <Buffer > } +5ms
  zigbee-shepherd:msgHdlr IND <-- ZDO:simpleDescRsp +1ms
  serialport:unixRead waiting for readable because of code: EAGAIN +9ms
  serialport:poller Polling for "readable" +23ms
  zigbee-shepherd Device: 0x0013a20040000001 join the network. +26ms
  zigbee2mqtt:debug 2019-1-17 23:57:08 Received zigbee message of type 'devIncoming' with data '"0x0013a20040000001"' of device 'undefined' (0x0013a20040000001)
  zigbee2mqtt:info 2019-1-17 23:57:08 Device incoming...
  zigbee2mqtt:info 2019-1-17 23:57:08 MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"type":"pairing","message":"device incoming"}'
  zigbee2mqtt:warn 2019-1-17 23:57:08 Device with modelID 'undefined' is not supported.
  zigbee2mqtt:warn 2019-1-17 23:57:08 Please see: https://koenkk.github.io/zigbee2mqtt/how_tos/how_to_support_new_devices.html
  zigbee2mqtt:debug 2019-1-17 23:57:08 Received zigbee message of type 'devStatus' with data '"online"' of device 'undefined' (0x0013a20040000001)
  zigbee2mqtt:warn 2019-1-17 23:57:08 Device with modelID 'undefined' is not supported.
  zigbee2mqtt:warn 2019-1-17 23:57:08 Please see: https://koenkk.github.io/zigbee2mqtt/how_tos/how_to_support_new_devices.html

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.

stale[bot] commented 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.

bernardolm commented 5 years ago

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!

thompsa commented 5 years ago

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.

image

makuser commented 5 years ago

@thompsa how did you manage to pair it? What's the exact procedure you did to have the S2B to join the network?

thompsa commented 5 years ago

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.

thompsa commented 5 years ago

I am using the firmware XBP24-ZB, ZigBee Router API mode, version 23A7

bernardolm commented 5 years ago

It's great, @thompsa! Realy thanks! I'll try this and back to report! Thanks again!

bernardolm commented 5 years ago

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:

IMG_20190829_005714635

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!

thompsa commented 5 years ago

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/

bernardolm commented 5 years ago

😞 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!

makuser commented 5 years ago

@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?

bernardolm commented 5 years ago

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.

jpjodoin commented 5 years ago

@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!

wvolz commented 3 years ago

Make sure you set the KY setting to "5A6967426565416C6C69616E63653039". That was the setting that made everything work for me.