Skip to content
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

Crash while pairing Xiaomi MiJia wireless switch (WXKG01LM) #198

Closed
hahrens opened this issue Jul 16, 2018 · 24 comments
Closed

Crash while pairing Xiaomi MiJia wireless switch (WXKG01LM) #198

hahrens opened this issue Jul 16, 2018 · 24 comments
Labels
problem Something isn't working

Comments

@hahrens
Copy link

hahrens commented Jul 16, 2018

I'm unable to pair my first Device with zigbee2mqtt, a MiJia Switch (WXKG01LM). Once i've start the bridge in my console and allow pairing, i've started the button-pairing by pressing the config button on the switch until the led is blinking (~4sec) and continue it by pressing the button every second according to the wiki documentation.

This is a repeatable error, i get it every time i try to pair the button.

~/zigbee2mqtt> sudo node index.js                                                                                                         master!
2018-7-16 11:49:02 DEBUG Using zigbee-shepherd with settings: '{"net":{"panId":6754,"channelList":[11]},"dbPath":"/home/pi/zigbee2mqtt/data/database.db","sp":{"baudrate":115200,"rtscts":true}}'
2018-7-16 11:49:02 INFO Starting zigbee2mqtt version 0.1.0 (commit #ae41b7b)
2018-7-16 11:49:02 INFO Starting zigbee-shepherd
2018-7-16 11:49:03 INFO zigbee-shepherd started
2018-7-16 11:49:03 INFO Currently 0 devices are joined:
2018-7-16 11:49:03 WARN `permit_join` set to  `true` in configuration.yaml.
2018-7-16 11:49:03 WARN Allowing new devices to join.
2018-7-16 11:49:03 WARN Set `permit_join` to `false` once you joined all devices.
2018-7-16 11:49:03 INFO Zigbee: allowing new devices to join.
2018-7-16 11:49:03 INFO Connecting to MQTT server at mqtt://localhost
2018-7-16 11:49:03 INFO zigbee-shepherd ready
2018-7-16 11:49:03 INFO Connected to MQTT server
2018-7-16 11:49:03 INFO MQTT publish, topic: 'zigbee2mqtt/bridge/state', payload: 'online'
spinlock: false []
/home/pi/zigbee2mqtt/node_modules/zcl-packet/lib/foundation.js:297
        dataTypeStr = zclId.dataType(dataType).key;
                                              ^

TypeError: Cannot read property 'key' of undefined
    at ensureDataTypeString (/home/pi/zigbee2mqtt/node_modules/zcl-packet/lib/foundation.js:297:47)
    at getDataType (/home/pi/zigbee2mqtt/node_modules/zcl-packet/lib/foundation.js:307:16)
    at Dissolve.<anonymous> (/home/pi/zigbee2mqtt/node_modules/zcl-packet/lib/foundation.js:689:28)
    at Dissolve._transform (/home/pi/zigbee2mqtt/node_modules/dissolve/index.js:80:16)
    at Dissolve.Transform._read (/home/pi/zigbee2mqtt/node_modules/dissolve/node_modules/readable-stream/lib/_stream_transform.js:184:10)
    at Dissolve.Transform._write (/home/pi/zigbee2mqtt/node_modules/dissolve/node_modules/readable-stream/lib/_stream_transform.js:172:12)
    at doWrite (/home/pi/zigbee2mqtt/node_modules/dissolve/node_modules/readable-stream/lib/_stream_writable.js:279:12)
    at writeOrBuffer (/home/pi/zigbee2mqtt/node_modules/dissolve/node_modules/readable-stream/lib/_stream_writable.js:266:5)
    at Dissolve.Writable.write (/home/pi/zigbee2mqtt/node_modules/dissolve/node_modules/readable-stream/lib/_stream_writable.js:211:11)
    at Dissolve.Writable.end (/home/pi/zigbee2mqtt/node_modules/dissolve/node_modules/readable-stream/lib/_stream_writable.js:426:10)

I've found the issue #107 with the same error message and already tried the commit referenced in this comment - doesn't fix it for me.

Here is my configuration.yml:

# 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:
  log_level: debug
@hahrens hahrens changed the title Unable to Pair Xiaomi MiJia wireless switch (WXKG01LM) Crash while pairing Xiaomi MiJia wireless switch (WXKG01LM) Jul 16, 2018
@tb-killa
Copy link
Contributor

@hahrens see: #199

@Koenkk
Copy link
Owner

Koenkk commented Jul 18, 2018

Can you try running with DEBUG=* npm start?

@hahrens
Copy link
Author

hahrens commented Jul 19, 2018

Sure.

pi@fhem ~/zigbee2mqtt> DEBUG=* node index.js                                                 master
2018-7-19 22:35:47 DEBUG Using zigbee-shepherd with settings: '{"net":{"panId":6754,"channelList":[11]},"dbPath":"/home/pi/zigbee2mqtt/data/database.db","sp":{"baudrate":115200,"rtscts":true}}'
2018-7-19 22:35:47 INFO Starting zigbee2mqtt version 0.1.0 (commit #ae41b7b)
2018-7-19 22:35:47 INFO Starting zigbee-shepherd
  zigbee-shepherd:init zigbee-shepherd booting... +0ms
  cc-znp The serialport /dev/ttyACM0 is opened. +46ms
  zigbee-shepherd:request REQ --> SYS:osalNvRead +9ms
  cc-znp:SREQ --> SYS:osalNvRead, { id: 3840, offset: 0, len: 1, value: [ 85 ] } +7ms
  serialport write 8 bytes of data +32ms
  cc-znp:AREQ <-- AF:incomingMsg, { groupid: 0, clusterid: 0, srcaddr: 51003, srcendpoint: 1, dstendpoint: 1, wasbroadcast: 0, linkquality: 47, securityuse: 0, timestamp: 12524456, transseqnumber: 0, len: 29, data: <Buffer 1c 34 12 57 0a 02 ff 4c 06 00 10 01 21 f6 0b 21 a8 13 24 01 00 00 00 00 21 b1 00 20 57> } +60ms
  zigbee-shepherd:msgHdlr IND <-- AF:incomingMsg, transId: 0 +5ms
  cc-znp:SRSP <-- SYS:osalNvRead, { status: 0, len: 1, value: <Buffer 55> } +2ms
  zigbee-shepherd:request RSP <-- SYS:osalNvRead, status: 0 +3ms
  zigbee-shepherd:request REQ --> SAPI:readConfiguration +21ms
  cc-znp:SREQ --> SAPI:readConfiguration, { configid: 131, len: 2, value: [ 98, 26 ] } +1ms
  serialport write 6 bytes of data +3ms
  cc-znp:SRSP <-- SAPI:readConfiguration, { status: 0, configid: 131, len: 2, value: <Buffer 62 1a> } +13ms
  zigbee-shepherd:request RSP <-- SAPI:readConfiguration, status: 0 +1ms
  zigbee-shepherd:request REQ --> SAPI:readConfiguration +12ms
  cc-znp:SREQ --> SAPI:readConfiguration, { configid: 132, len: 4, value: [ 0, 8, 0, 0 ] } +0ms
  serialport write 6 bytes of data +2ms
  cc-znp:SRSP <-- SAPI:readConfiguration, { status: 0, configid: 132, len: 4, value: <Buffer 00 08 00 00> } +19ms
  zigbee-shepherd:request RSP <-- SAPI:readConfiguration, status: 0 +4ms
  zigbee-shepherd:request REQ --> SAPI:readConfiguration +11ms
  cc-znp:SREQ --> SAPI:readConfiguration, { configid: 98, len: 16, value: [ 1, 3, 5, 7, 9, 11, 13, 15, 0, 2, 4, 6, 8, 10, 12, 13 ] } +3ms
  serialport write 6 bytes of data +8ms
  cc-znp:SRSP <-- SAPI:readConfiguration, { status: 0, configid: 98, len: 16, value: <Buffer 01 03 05 07 09 0b 0d 0f 00 02 04 06 08 0a 0c 0d> } +24ms
  zigbee-shepherd:request RSP <-- SAPI:readConfiguration, status: 0 +1ms
  zigbee-shepherd:request REQ --> SAPI:readConfiguration +12ms
  cc-znp:SREQ --> SAPI:readConfiguration, { configid: 99, len: 1, value: [ 0 ] } +1ms
  serialport write 6 bytes of data +1ms
  cc-znp:SRSP <-- SAPI:readConfiguration, { status: 0, configid: 99, len: 1, value: <Buffer 00> } +18ms
  zigbee-shepherd:request RSP <-- SAPI:readConfiguration, status: 0 +1ms
  zigbee-shepherd:request REQ --> SAPI:getDeviceInfo +14ms
  cc-znp:SREQ --> SAPI:getDeviceInfo, { param: 0 } +0ms
  serialport write 6 bytes of data +2ms
  cc-znp:SRSP <-- SAPI:getDeviceInfo, { param: 0, value: <Buffer 09 01 00 06 00 00 00 2f> } +21ms
  zigbee-shepherd:request RSP <-- SAPI:getDeviceInfo +2ms
  zigbee-shepherd:init Now the ZNP is a coordinator. +2ms
  zigbee-shepherd:request REQ --> SAPI:getDeviceInfo +4ms
  cc-znp:SREQ --> SAPI:getDeviceInfo, { param: 0 } +1ms
  serialport write 6 bytes of data +1ms
  cc-znp:SRSP <-- SAPI:getDeviceInfo, { param: 0, value: <Buffer 09 01 00 06 00 00 00 2f> } +10ms
  zigbee-shepherd:request RSP <-- SAPI:getDeviceInfo +1ms
  zigbee-shepherd:request REQ --> SAPI:getDeviceInfo +3ms
  cc-znp:SREQ --> SAPI:getDeviceInfo, { param: 1 } +1ms
  serialport write 6 bytes of data +1ms
  cc-znp:SRSP <-- SAPI:getDeviceInfo, { param: 1, value: <Buffer be 2d 02 12 00 4b 12 00> } +7ms
  zigbee-shepherd:request RSP <-- SAPI:getDeviceInfo +1ms
  zigbee-shepherd:request REQ --> SAPI:getDeviceInfo +2ms
  cc-znp:SREQ --> SAPI:getDeviceInfo, { param: 2 } +0ms
  serialport write 6 bytes of data +1ms
  cc-znp:SRSP <-- SAPI:getDeviceInfo, { param: 2, value: <Buffer 00 00 02 12 00 4b 12 00> } +10ms
  zigbee-shepherd:request RSP <-- SAPI:getDeviceInfo +1ms
  zigbee-shepherd:request REQ --> SAPI:getDeviceInfo +1ms
  cc-znp:SREQ --> SAPI:getDeviceInfo, { param: 5 } +10ms
  serialport write 6 bytes of data +2ms
  cc-znp:SRSP <-- SAPI:getDeviceInfo, { param: 5, value: <Buffer 0b 00 02 12 00 4b 12 00> } +7ms
  zigbee-shepherd:request RSP <-- SAPI:getDeviceInfo +3ms
  zigbee-shepherd:request REQ --> SAPI:getDeviceInfo +1ms
  cc-znp:SREQ --> SAPI:getDeviceInfo, { param: 6 } +1ms
  serialport write 6 bytes of data +5ms
  cc-znp:SRSP <-- SAPI:getDeviceInfo, { param: 6, value: <Buffer 62 1a 02 12 00 4b 12 00> } +16ms
  zigbee-shepherd:request RSP <-- SAPI:getDeviceInfo +1ms
  zigbee-shepherd:request REQ --> SAPI:getDeviceInfo +3ms
  cc-znp:SREQ --> SAPI:getDeviceInfo, { param: 7 } +0ms
  serialport write 6 bytes of data +2ms
  cc-znp:SRSP <-- SAPI:getDeviceInfo, { param: 7, value: <Buffer dd dd dd dd dd dd dd dd> } +6ms
  zigbee-shepherd:request RSP <-- SAPI:getDeviceInfo +1ms
  zigbee-shepherd:request REQ --> ZDO:nodeDescReq +6ms
  cc-znp:SREQ --> ZDO:nodeDescReq, { dstaddr: 0, nwkaddrofinterest: 0 } +5ms
  serialport write 9 bytes of data +1ms
  cc-znp:SRSP <-- ZDO:nodeDescReq, { status: 0 } +10ms
  cc-znp:AREQ <-- ZDO:nodeDescRsp, { srcaddr: 0, status: 0, nwkaddr: 0, logicaltype_cmplxdescavai_userdescavai: 0, apsflags_freqband: 64, maccapflags: 143, manufacturercode: 0, maxbuffersize: 80, maxintransfersize: 160, servermask: 1, maxouttransfersize: 160, descriptorcap: 0 } +7ms
  zigbee-shepherd:msgHdlr IND <-- ZDO:nodeDescRsp +2ms
  zigbee-shepherd:request REQ --> ZDO:activeEpReq +4ms
  cc-znp:SREQ --> ZDO:activeEpReq, { dstaddr: 0, nwkaddrofinterest: 0 } +2ms
  serialport write 9 bytes of data +1ms
  cc-znp:SRSP <-- ZDO:activeEpReq, { status: 0 } +9ms
  cc-znp:AREQ <-- ZDO:activeEpRsp, { srcaddr: 0, status: 0, nwkaddr: 0, activeepcount: 6, activeeplist: <Buffer 06 05 04 03 02 01> } +10ms
  zigbee-shepherd:msgHdlr IND <-- ZDO:activeEpRsp +2ms
  zigbee-shepherd:request REQ --> ZDO:simpleDescReq +5ms
  cc-znp:SREQ --> ZDO:simpleDescReq, { dstaddr: 0, nwkaddrofinterest: 0, endpoint: 1 } +1ms
  serialport write 10 bytes of data +2ms
  cc-znp:SRSP <-- ZDO:simpleDescReq, { status: 0 } +9ms
  cc-znp:AREQ <-- ZDO:simpleDescRsp, { srcaddr: 0, status: 0, nwkaddr: 0, len: 8, endpoint: 1, profileid: 260, deviceid: 5, deviceversion: 0, numinclusters: 0, inclusterlist: <Buffer >, numoutclusters: 0, outclusterlist: <Buffer > } +8ms
  zigbee-shepherd:msgHdlr IND <-- ZDO:simpleDescRsp +4ms
  zigbee-shepherd:request REQ --> ZDO:simpleDescReq +3ms
  cc-znp:SREQ --> ZDO:simpleDescReq, { dstaddr: 0, nwkaddrofinterest: 0, endpoint: 2 } +1ms
  serialport write 10 bytes of data +3ms
  cc-znp:SRSP <-- ZDO:simpleDescReq, { status: 0 } +8ms
  cc-znp:AREQ <-- ZDO:simpleDescRsp, { srcaddr: 0, status: 0, nwkaddr: 0, len: 8, endpoint: 2, profileid: 257, deviceid: 5, deviceversion: 0, numinclusters: 0, inclusterlist: <Buffer >, numoutclusters: 0, outclusterlist: <Buffer > } +8ms
  zigbee-shepherd:msgHdlr IND <-- ZDO:simpleDescRsp +2ms
  zigbee-shepherd:request REQ --> ZDO:simpleDescReq +1ms
  cc-znp:SREQ --> ZDO:simpleDescReq, { dstaddr: 0, nwkaddrofinterest: 0, endpoint: 3 } +2ms
  serialport write 10 bytes of data +1ms
  cc-znp:SRSP <-- ZDO:simpleDescReq, { status: 0 } +27ms
  cc-znp:AREQ <-- ZDO:simpleDescRsp, { srcaddr: 0, status: 0, nwkaddr: 0, len: 8, endpoint: 3, profileid: 261, deviceid: 5, deviceversion: 0, numinclusters: 0, inclusterlist: <Buffer >, numoutclusters: 0, outclusterlist: <Buffer > } +5ms
  zigbee-shepherd:msgHdlr IND <-- ZDO:simpleDescRsp +5ms
  zigbee-shepherd:request REQ --> ZDO:simpleDescReq +1ms
  cc-znp:SREQ --> ZDO:simpleDescReq, { dstaddr: 0, nwkaddrofinterest: 0, endpoint: 4 } +4ms
  serialport write 10 bytes of data +2ms
  cc-znp:SRSP <-- ZDO:simpleDescReq, { status: 0 } +9ms
  cc-znp:AREQ <-- ZDO:simpleDescRsp, { srcaddr: 0, status: 0, nwkaddr: 0, len: 8, endpoint: 4, profileid: 263, deviceid: 5, deviceversion: 0, numinclusters: 0, inclusterlist: <Buffer >, numoutclusters: 0, outclusterlist: <Buffer > } +6ms
  zigbee-shepherd:msgHdlr IND <-- ZDO:simpleDescRsp +2ms
  zigbee-shepherd:request REQ --> ZDO:simpleDescReq +2ms
  cc-znp:SREQ --> ZDO:simpleDescReq, { dstaddr: 0, nwkaddrofinterest: 0, endpoint: 5 } +1ms
  serialport write 10 bytes of data +3ms
  cc-znp:SRSP <-- ZDO:simpleDescReq, { status: 0 } +8ms
  cc-znp:AREQ <-- ZDO:simpleDescRsp, { srcaddr: 0, status: 0, nwkaddr: 0, len: 8, endpoint: 5, profileid: 264, deviceid: 5, deviceversion: 0, numinclusters: 0, inclusterlist: <Buffer >, numoutclusters: 0, outclusterlist: <Buffer > } +7ms
  zigbee-shepherd:msgHdlr IND <-- ZDO:simpleDescRsp +2ms
  zigbee-shepherd:request REQ --> ZDO:simpleDescReq +3ms
  cc-znp:SREQ --> ZDO:simpleDescReq, { dstaddr: 0, nwkaddrofinterest: 0, endpoint: 6 } +1ms
  serialport write 10 bytes of data +2ms
  cc-znp:SRSP <-- ZDO:simpleDescReq, { status: 0 } +9ms
  cc-znp:AREQ <-- ZDO:simpleDescRsp, { srcaddr: 0, status: 0, nwkaddr: 0, len: 8, endpoint: 6, profileid: 265, deviceid: 5, deviceversion: 0, numinclusters: 0, inclusterlist: <Buffer >, numoutclusters: 0, outclusterlist: <Buffer > } +8ms
  zigbee-shepherd:msgHdlr IND <-- ZDO:simpleDescRsp +1ms
  zigbee-shepherd:request REQ --> ZDO:nodeDescReq +8ms
  cc-znp:SREQ --> ZDO:nodeDescReq, { dstaddr: 0, nwkaddrofinterest: 0 } +1ms
  serialport write 9 bytes of data +2ms
  cc-znp:SRSP <-- ZDO:nodeDescReq, { status: 0 } +8ms
  cc-znp:AREQ <-- ZDO:nodeDescRsp, { srcaddr: 0, status: 0, nwkaddr: 0, logicaltype_cmplxdescavai_userdescavai: 0, apsflags_freqband: 64, maccapflags: 143, manufacturercode: 0, maxbuffersize: 80, maxintransfersize: 160, servermask: 1, maxouttransfersize: 160, descriptorcap: 0 } +6ms
  zigbee-shepherd:msgHdlr IND <-- ZDO:nodeDescRsp +2ms
  zigbee-shepherd:request REQ --> ZDO:activeEpReq +6ms
  cc-znp:SREQ --> ZDO:activeEpReq, { dstaddr: 0, nwkaddrofinterest: 0 } +1ms
  serialport write 9 bytes of data +1ms
  cc-znp:SRSP <-- ZDO:activeEpReq, { status: 0 } +8ms
  cc-znp:AREQ <-- ZDO:activeEpRsp, { srcaddr: 0, status: 0, nwkaddr: 0, activeepcount: 6, activeeplist: <Buffer 06 05 04 03 02 01> } +10ms
  zigbee-shepherd:msgHdlr IND <-- ZDO:activeEpRsp +1ms
  zigbee-shepherd:request REQ --> ZDO:mgmtPermitJoinReq +6ms
  cc-znp:SREQ --> ZDO:mgmtPermitJoinReq, { addrmode: 2, dstaddr: 0, duration: 0, tcsignificance: 0 } +16ms
  serialport write 10 bytes of data +1ms
  cc-znp:SRSP <-- ZDO:mgmtPermitJoinReq, { status: 0 } +10ms
  cc-znp:AREQ <-- ZDO:permitJoinInd, { duration: 0 } +3ms
  zigbee-shepherd:msgHdlr IND <-- ZDO:permitJoinInd +1ms
  cc-znp:AREQ <-- ZDO:mgmtPermitJoinRsp, { srcaddr: 0, status: 0 } +3ms
  zigbee-shepherd:msgHdlr IND <-- ZDO:mgmtPermitJoinRsp +4ms
  zigbee-shepherd:init Loading devices from database done. +48ms
  zigbee-shepherd:init zigbee-shepherd is up and ready. +1ms
  zigbee-shepherd:init Network information: +0ms
  zigbee-shepherd:init  >> State:      Coordinator +1ms
  zigbee-shepherd:init  >> Channel:    11 +0ms
  zigbee-shepherd:init  >> PanId:      0x1a62 +0ms
  zigbee-shepherd:init  >> Nwk Addr:   0 +0ms
  zigbee-shepherd:init  >> Ieee Addr:  0x00124b0012022dbe +0ms
  zigbee-shepherd:init  >> Ext. PanId: 0xdddddddddddddddd +1ms
2018-7-19 22:35:48 INFO zigbee-shepherd started
2018-7-19 22:35:48 INFO Currently 0 devices are joined:
2018-7-19 22:35:48 WARN `permit_join` set to  `true` in configuration.yaml.
2018-7-19 22:35:48 WARN Allowing new devices to join.
2018-7-19 22:35:48 WARN Set `permit_join` to `false` once you joined all devices.
2018-7-19 22:35:48 INFO Zigbee: allowing new devices to join.
2018-7-19 22:35:48 INFO Connecting to MQTT server at mqtt://localhost
  zigbee-shepherd:request REQ --> ZDO:mgmtPermitJoinReq +254ms
  cc-znp:SREQ --> ZDO:mgmtPermitJoinReq, { addrmode: 15, dstaddr: 65532, duration: 255, tcsignificance: 0 } +1ms
  serialport write 10 bytes of data +2ms
2018-7-19 22:35:49 INFO zigbee-shepherd ready
2018-7-19 22:35:49 INFO Connected to MQTT server
2018-7-19 22:35:49 INFO MQTT publish, topic: 'zigbee2mqtt/bridge/state', payload: 'online'
  cc-znp:SRSP <-- ZDO:mgmtPermitJoinReq, { status: 0 } +59ms
  cc-znp:AREQ <-- ZDO:permitJoinInd, { duration: 255 } +1ms
  zigbee-shepherd:msgHdlr IND <-- ZDO:permitJoinInd +1ms
  cc-znp:AREQ <-- ZDO:mgmtPermitJoinRsp, { srcaddr: 0, status: 0 } +1ms
  zigbee-shepherd:msgHdlr IND <-- ZDO:mgmtPermitJoinRsp +1ms


######################################################
### Started pairing here
######################################################


  cc-znp:AREQ <-- AF:incomingMsg, { groupid: 0, clusterid: 6, srcaddr: 403, srcendpoint: 1, dstendpoint: 1, wasbroadcast: 0, linkquality: 34, securityuse: 0, timestamp: 14381144, transseqnumber: 0, len: 7, data: <Buffer 18 59 0a 00 00 10 00> } +27s
  zigbee-shepherd:msgHdlr IND <-- AF:incomingMsg, transId: 0 +5ms
  cc-znp:AREQ <-- ZDO:leaveInd, { srcaddr: 403, extaddr: '0x00158d0001e62858', request: 0, removechildren: 0, rejoin: 0 } +4s
  zigbee-shepherd:msgHdlr IND <-- ZDO:leaveInd +5ms
  cc-znp:AREQ <-- ZDO:tcDeviceInd, { nwkaddr: 13986, extaddr: '0x00158d0001e62858', parentaddr: 0 } +3s
  zigbee-shepherd:msgHdlr IND <-- ZDO:tcDeviceInd +2ms
  cc-znp:AREQ <-- ZDO:endDeviceAnnceInd, { srcaddr: 13986, nwkaddr: 13986, ieeeaddr: '0x00158d0001e62858', capabilities: 128 } +720ms
spinlock: false []
  zigbee-shepherd:request REQ --> ZDO:nodeDescReq +12ms
  cc-znp:SREQ --> ZDO:nodeDescReq, { dstaddr: 13986, nwkaddrofinterest: 13986 } +1ms
  serialport write 9 bytes of data +3ms
  zigbee-shepherd:msgHdlr IND <-- ZDO:endDeviceAnnceInd +3ms
  cc-znp:SRSP <-- ZDO:nodeDescReq, { status: 0 } +26ms
  cc-znp:AREQ <-- AF:incomingMsg, { groupid: 0, clusterid: 0, srcaddr: 13986, srcendpoint: 1, dstendpoint: 1, wasbroadcast: 0, linkquality: 31, securityuse: 0, timestamp: 14406778, transseqnumber: 0, len: 25, data: <Buffer 18 00 0a 05 00 42 12 6c 75 6d 69 2e 73 65 6e 73 6f 72 5f 73 77 69 74 63 68> } +30ms
  zigbee-shepherd:msgHdlr IND <-- AF:incomingMsg, transId: 0 +4ms
  cc-znp:AREQ <-- AF:incomingMsg, { groupid: 0, clusterid: 0, srcaddr: 13986, srcendpoint: 1, dstendpoint: 1, wasbroadcast: 0, linkquality: 31, securityuse: 0, timestamp: 14406791, transseqnumber: 0, len: 7, data: <Buffer 18 01 0a 01 00 20 0a> } +4ms
  zigbee-shepherd:msgHdlr IND <-- AF:incomingMsg, transId: 0 +6ms
  cc-znp:AREQ <-- AF:incomingMsg, { groupid: 0, clusterid: 0, srcaddr: 13986, srcendpoint: 1, dstendpoint: 1, wasbroadcast: 0, linkquality: 28, securityuse: 0, timestamp: 14406819, transseqnumber: 0, len: 29, data: <Buffer 1c 34 12 02 0a 02 ff 4c 06 00 10 00 21 28 0c 21 a8 01 24 00 00 00 00 00 21 52 00 20 51> } +8ms
  zigbee-shepherd:msgHdlr IND <-- AF:incomingMsg, transId: 0 +11ms
  cc-znp:AREQ <-- AF:incomingMsg, { groupid: 0, clusterid: 0, srcaddr: 13986, srcendpoint: 1, dstendpoint: 1, wasbroadcast: 0, linkquality: 28, securityuse: 0, timestamp: 14414403, transseqnumber: 0, len: 25, data: <Buffer 18 03 0a 05 00 42 12 6c 75 6d 69 2e 73 65 6e 73 6f 72 5f 73 77 69 74 63 68> } +2s
  zigbee-shepherd:msgHdlr IND <-- AF:incomingMsg, transId: 0 +5ms
  cc-znp:AREQ <-- ZDO:nodeDescRsp, { srcaddr: 13986, status: 0, nwkaddr: 13986, logicaltype_cmplxdescavai_userdescavai: 2, apsflags_freqband: 64, maccapflags: 128, manufacturercode: 4151, maxbuffersize: 127, maxintransfersize: 100, servermask: 0, maxouttransfersize: 100, descriptorcap: 0 } +636ms
  zigbee-shepherd:msgHdlr IND <-- ZDO:nodeDescRsp +8ms
  zigbee-shepherd:request REQ --> ZDO:activeEpReq +1ms
  cc-znp:SREQ --> ZDO:activeEpReq, { dstaddr: 13986, nwkaddrofinterest: 13986 } +2ms
  serialport write 9 bytes of data +2ms
  cc-znp:SRSP <-- ZDO:activeEpReq, { status: 0 } +33ms
  cc-znp:AREQ <-- AF:incomingMsg, { groupid: 0, clusterid: 0, srcaddr: 13986, srcendpoint: 1, dstendpoint: 1, wasbroadcast: 0, linkquality: 31, securityuse: 0, timestamp: 14423135, transseqnumber: 0, len: 25, data: <Buffer 18 04 0a 05 00 42 12 6c 75 6d 69 2e 73 65 6e 73 6f 72 5f 73 77 69 74 63 68> } +2s
  zigbee-shepherd:msgHdlr IND <-- AF:incomingMsg, transId: 0 +6ms
  cc-znp:AREQ <-- ZDO:activeEpRsp, { srcaddr: 13986, status: 0, nwkaddr: 13986, activeepcount: 1, activeeplist: <Buffer 01> } +2s
  zigbee-shepherd:msgHdlr IND <-- ZDO:activeEpRsp +1ms
  zigbee-shepherd:request REQ --> ZDO:simpleDescReq +2ms
  cc-znp:SREQ --> ZDO:simpleDescReq, { dstaddr: 13986, nwkaddrofinterest: 13986, endpoint: 1 } +5ms
  serialport write 10 bytes of data +4ms
  cc-znp:SRSP <-- ZDO:simpleDescReq, { status: 0 } +25ms
  cc-znp:AREQ <-- AF:incomingMsg, { groupid: 0, clusterid: 0, srcaddr: 13986, srcendpoint: 1, dstendpoint: 1, wasbroadcast: 0, linkquality: 31, securityuse: 0, timestamp: 14436671, transseqnumber: 0, len: 25, data: <Buffer 18 05 0a 05 00 42 12 6c 75 6d 69 2e 73 65 6e 73 6f 72 5f 73 77 69 74 63 68> } +3s
  zigbee-shepherd:msgHdlr IND <-- AF:incomingMsg, transId: 0 +6ms
  cc-znp:AREQ <-- ZDO:simpleDescRsp, { srcaddr: 13986, status: 0, nwkaddr: 13986, len: 30, endpoint: 1, profileid: 260, deviceid: 260, deviceversion: 1, numinclusters: 4, inclusterlist: <Buffer 00 00 03 00 ff ff 19 00>, numoutclusters: 7, outclusterlist: <Buffer 00 00 04 00 03 00 06 00 08 00 05 00 19 00> } +2s
  zigbee-shepherd:msgHdlr IND <-- ZDO:simpleDescRsp +2ms
  zigbee-shepherd:request REQ --> AF:dataRequest, transId: 1 +33ms
  cc-znp:SREQ --> AF:dataRequest, { dstaddr: 13986, destendpoint: 1, srcendpoint: 1, clusterid: 0, transid: 1, options: 48, radius: 30, len: 9, data: <Buffer 00 01 00 04 00 05 00 07 00> } +1ms
  serialport write 24 bytes of data +3ms
  cc-znp:SRSP <-- AF:dataRequest, { status: 0 } +10ms
  zigbee-shepherd:request RSP <-- AF:dataRequest, status: 0 +1ms
  cc-znp:AREQ <-- AF:incomingMsg, { groupid: 0, clusterid: 0, srcaddr: 13986, srcendpoint: 1, dstendpoint: 1, wasbroadcast: 0, linkquality: 28, securityuse: 0, timestamp: 14451139, transseqnumber: 0, len: 25, data: <Buffer 18 06 0a 05 00 42 12 6c 75 6d 69 2e 73 65 6e 73 6f 72 5f 73 77 69 74 63 68> } +3s
/home/pi/zigbee2mqtt/node_modules/zcl-packet/lib/foundation.js:297
        dataTypeStr = zclId.dataType(dataType).key;
                                              ^

TypeError: Cannot read property 'key' of undefined
    at ensureDataTypeString (/home/pi/zigbee2mqtt/node_modules/zcl-packet/lib/foundation.js:297:47)
    at getDataType (/home/pi/zigbee2mqtt/node_modules/zcl-packet/lib/foundation.js:307:16)
    at Dissolve.<anonymous> (/home/pi/zigbee2mqtt/node_modules/zcl-packet/lib/foundation.js:689:28)
    at Dissolve._transform (/home/pi/zigbee2mqtt/node_modules/dissolve/index.js:80:16)
    at Dissolve.Transform._read (/home/pi/zigbee2mqtt/node_modules/dissolve/node_modules/readable-stream/lib/_stream_transform.js:184:10)
    at Dissolve.Transform._write (/home/pi/zigbee2mqtt/node_modules/dissolve/node_modules/readable-stream/lib/_stream_transform.js:172:12)
    at doWrite (/home/pi/zigbee2mqtt/node_modules/dissolve/node_modules/readable-stream/lib/_stream_writable.js:279:12)
    at writeOrBuffer (/home/pi/zigbee2mqtt/node_modules/dissolve/node_modules/readable-stream/lib/_stream_writable.js:266:5)
    at Dissolve.Writable.write (/home/pi/zigbee2mqtt/node_modules/dissolve/node_modules/readable-stream/lib/_stream_writable.js:211:11)
    at Dissolve.Writable.end (/home/pi/zigbee2mqtt/node_modules/dissolve/node_modules/readable-stream/lib/_stream_writable.js:426:10)

The dataType-Value is 117 which could not be found in zclId.dataType.

@kirovilya
Copy link
Contributor

Hmm, last buffer is good, but not parsed:
<Buffer 18 06 0a 05 00 42 12 6c 75 6d 69 2e 73 65 6e 73 6f 72 5f 73 77 69 74 63 68> - it is string 'lumi.sensor_switch'
it is necessary to dig deeper

@kirovilya
Copy link
Contributor

Perhaps this is due to the latest commit in the zcl-packet
Koenkk/zcl-packet@0c23e47
Try to return old code and run.
If it pairing normally, then I'll think what's wrong there :(

@ciotlosm ciotlosm added the problem Something isn't working label Jul 21, 2018
@hahrens
Copy link
Author

hahrens commented Jul 22, 2018

Pairing successful with Koenkk/zcl-packet@3ea8912

@kirovilya
Copy link
Contributor

@hahrens So you used old version? And all working now?

@hahrens
Copy link
Author

hahrens commented Jul 25, 2018

@kirovilya Yes. I've manually cloned the zcl-packet in node_modules after npm install and checked out the Koenkk/zcl-packet@3ea8912 commit. After that the pairing was successful.

@kirovilya
Copy link
Contributor

@hahrens So, you need install/update to last version of zigbee2mqtt with updated version of zcl-packet lib with this changes.

@Koenkk
Copy link
Owner

Koenkk commented Jul 26, 2018

So this means that there is a bug in: Koenkk/zcl-packet@0c23e47?

@kirovilya
Copy link
Contributor

yes, it looks like I was wrong somewhere :(

@kirovilya
Copy link
Contributor

@hahrens I trying to fix kirovilya/zcl-packet@274ac22 can you check?

Also need check smoke sensor battery for @Sonsi79 with #150 Who can?

@Sonsi79
Copy link

Sonsi79 commented Jul 29, 2018

@kirovilya I have check the smoke battery function. It works great again. thnx

Koenkk added a commit that referenced this issue Jul 29, 2018
@Koenkk
Copy link
Owner

Koenkk commented Jul 29, 2018

@hahrens can you check if this issue is still present in the dev branch?

@FrankZZ
Copy link

FrankZZ commented Jul 29, 2018

I see the same error when the RTCGQ01LM pair button is pressed. Just switched to dev branch and testing if it still crashes @Koenkk

@FrankZZ
Copy link

FrankZZ commented Jul 29, 2018

I can confirm that on dev branch 8cf1e60 the crash is fixed for the aqara motion pir

@hahrens
Copy link
Author

hahrens commented Jul 29, 2018

I can confirm fix in dev branch.

@Koenkk
Copy link
Owner

Koenkk commented Jul 30, 2018

Ok, great, thanks all!

@Koenkk Koenkk closed this as completed Jul 30, 2018
Koenkk added a commit that referenced this issue Jul 31, 2018
Koenkk added a commit that referenced this issue Aug 8, 2018
Koenkk added a commit that referenced this issue Aug 8, 2018
@Baseje
Copy link

Baseje commented Aug 9, 2018

I still receive this errors;
2018-8-9 16:49:20 INFO Device incoming...
2018-8-9 16:49:20 INFO MQTT publish, topic: 'zigbee2mqtt/bridge/log', payload: '{"type":"pairing","message":"device incoming"}'
2018-8-9 16:51:08 INFO Zigbee: allowing new devices to join.
spinlock: false []
2018-8-9 16:52:10 ERROR Cannot get the Node Descriptor of the Device: 0x00158d00022435f7 (Error: Timed out after 10000 ms)
spinlock: false []
2018-8-9 16:53:08 ERROR Cannot get the Node Descriptor of the Device: 0x00158d00022435f7 (Error: Timed out after 10000 ms)

@Koenkk
Copy link
Owner

Koenkk commented Aug 9, 2018

@Baseje do you keep pressing the reset button while pairing?

@Baseje
Copy link

Baseje commented Aug 9, 2018 via email

@Baseje
Copy link

Baseje commented Aug 9, 2018

I've tested again and receive the error after holding the small button with the paperclip for 3 seconds.
In the manual they tell its an reset commando.

How did you connect the sensor?
When i push or hold the big button i see no response in zigbee2mqtt..

@Koenkk
Copy link
Owner

Koenkk commented Aug 9, 2018

The procedure is described here: https://github.com/Koenkk/zigbee2mqtt/wiki/Pairing-devices#xiaomi

@Baseje
Copy link

Baseje commented Aug 9, 2018

what a hell to connect, every second push the reset button...
Sorry i didnt read the manual good enough...

Many thanks!

Koenkk added a commit that referenced this issue Aug 13, 2018
Koenkk added a commit that referenced this issue Aug 13, 2018
wilmardo pushed a commit to wilmardo/zigbee2mqtt that referenced this issue Sep 26, 2019
wilmardo pushed a commit to wilmardo/zigbee2mqtt that referenced this issue Sep 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
problem Something isn't working
Projects
None yet
Development

No branches or pull requests

8 participants