WebThingsIO / zigbee-adapter

Zigbee adapter add-on for WebThings Gateway
Mozilla Public License 2.0
46 stars 29 forks source link

no Serial ports found: No Zigbee dongle found (should be ConBee II) #224

Closed hbkoenig closed 3 years ago

hbkoenig commented 4 years ago

after manual installation of zigbee-adapter 0.11.11 packages thanks to Michael Stegeman I'm now trying to get the ConBee II stick working (works with deCONZ, which is not running right now).

log shows no serial ports found, why?

2020-08-03 19:36:50.668 INFO   : zigbee-adapter: Loading add-on zigbee-adapter from /etc/webthings-gateway/addons/zigbee-adapter
2020-08-03 19:36:58.060 INFO   : zigbee-adapter: DEBUG config = ''
2020-08-03 19:37:01.663 INFO   : zigbee-adapter: Serial ports that were found:
2020-08-03 19:37:04.927 ERROR  : zigbee-adapter: Failed to start add-on zigbee-adapter: No Zigbee dongle found

# lsusb 
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 094: ID 1cf1:0030 Dresden Elektronik 

# ls -l /dev/ttyACM0 
crw-rw---- 1 root dialout 166, 0 Aug  3 19:23 /dev/ttyACM0

# groups webthings
webthings : webthings dialout

I see other issues here for ConBee -- but all other reports show /dev/ttyACM0 as serial port being found.

trying to run webthings-gateway as root doesn't make a difference.

strace doesn't show any access to serial devices via /dev/... but webthings-gateway scans /sys/devices/... and opens

/sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.2/1-1.2:1.0/tty/ttyACM0/uevent
/sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.2/1-1.2:1.0/tty/ttyACM0/subsystem

what am I missing to get /dev/ttyACM0 found and probed ?

mrstegeman commented 4 years ago

Are you using the Docker image? Debian (.deb) package?

hbkoenig commented 4 years ago

no docker. this is a RPi 4 running raspian 10 (buster?) where I've installed webthings-gateway-0.12.0-1 (webthings-gateway-raspbian-buster-armhf.deb as of Jul 28 14:34)

mrstegeman commented 4 years ago

Ok, that's what I figured. See here: https://github.com/mozilla-iot/gateway/issues/2562

hbkoenig commented 4 years ago

full ACK:

2020-08-03 22:32:30.229 INFO   : zigbee-adapter: this.driver = DeconzDriver {}
2020-08-03 22:32:30.235 INFO   : zigbee-adapter: DeconzDriver: Using serial port /dev/ttyACM0
2020-08-03 22:32:30.266 INFO   : zigbee-adapter: DeConz Firmware version: 26580700
2020-08-03 22:32:30.327 INFO   : zigbee-adapter: Kicking WatchDog for 3600 seconds
2020-08-03 22:32:30.430 INFO   : zigbee-adapter: Node: undefined 69c4 not found
2020-08-03 22:32:30.448 INFO   : zigbee-adapter: Node: undefined a0b5 not found
2020-08-03 22:32:30.456 INFO   : zigbee-adapter: Node: undefined a0b5 not found

with additional group "gpio" the ConBee II gets detected -- weird (but good;-) THANKS for your great help!!!

but the "Configure zigbee-adapter" now somehow hangs or does nothing when clicking on "Apply". maybe that's because of those errors below? anyway -- I'm very happy for today, will have a look into this tomorrow...

the plan would be that I can "take over" the fully configured/paired network from the current setup with deCONZ if that's possible?!

I notice that PAN ID, MAC, and network key in data/zigbee-adapter/zb-*.json are identical to deCONZ network setup, but I here cannot find the/any "TC Link Key" (deCONZ runs in Security Mode "High - No Master but TC Link Key"). maybe these settings show up once "Configure" for zigbee-adapter works ?!

and here the 1st error msgs:

2020-08-03 22:32:30.530 INFO   : zigbee-adapter: ZigbeeNode created: addr64: 7cb03eaa00ac2a4f addr16: 8f0f
2020-08-03 22:32:30.532 INFO   : zigbee-adapter: ----- Scan Starting -----
2020-08-03 22:32:30.534 INFO   : zigbee-adapter: ----- Nodes -----
2020-08-03 22:32:30.535 INFO   : zigbee-adapter: Node: 0123456789abcdef 0000 Name: zb-0123456789abcdef-Dongle       rebindRequired: true endpoints: []
2020-08-03 22:32:30.535 INFO   : zigbee-adapter: Node: 0123456789abcdef 0000 Name: zb-0123456789abcdef-Dongle       rebindRequired: true endpoints: []
2020-08-03 22:32:30.537 INFO   : zigbee-adapter:   Neighbor: 7cb03eaa00ac2a4f 8f0f DT: Router R: Sibling  PJ: N D:   1 LQI: 252
2020-08-03 22:32:30.539 INFO   : zigbee-adapter: Node: 7cb03eaa00ac2a4f 8f0f Name: undefined                        rebindRequired: true endpoints: []
2020-08-03 22:32:30.541 INFO   : zigbee-adapter: -----------------
2020-08-03 22:32:30.543 INFO   : zigbee-adapter: ----- Scan Complete -----
2020-08-03 22:32:30.924 ERROR  : zigbee-adapter: handleExplicitRx: Caught an exception parsing ZDO frame
2020-08-03 22:32:30.926 ERROR  : zigbee-adapter: TypeError: Cannot read property 'nwkAddr64' of undefined
2020-08-03 22:32:30.928 ERROR  : zigbee-adapter:     at ZigbeeAdapter.handleNetworkAddressResponse (/etc/webthings-gateway/addons/zigbee-adapter/zb-adapter.js:220:67)
2020-08-03 22:32:30.930 ERROR  : zigbee-adapter:     at ZigbeeAdapter.handleIEEEAddressResponse (/etc/webthings-gateway/addons/zigbee-adapter/zb-adapter.js:207:10)
2020-08-03 22:32:30.932 ERROR  : zigbee-adapter:     at ZigbeeAdapter.handleZdoFrame (/etc/webthings-gateway/addons/zigbee-adapter/zb-adapter.js:498:50)
2020-08-03 22:32:30.933 ERROR  : zigbee-adapter:     at DeconzDriver.handleExplicitRx (/etc/webthings-gateway/addons/zigbee-adapter/zb-driver.js:352:22)
2020-08-03 22:32:30.935 ERROR  : zigbee-adapter:     at DeconzDriver.handleApsDataIndication (/etc/webthings-gateway/addons/zigbee-adapter/deconz-driver.js:435:10)
2020-08-03 22:32:30.936 ERROR  : zigbee-adapter:     at DeconzDriver.handleParsedFrame (/etc/webthings-gateway/addons/zigbee-adapter/zb-driver.js:418:20)
2020-08-03 22:32:30.937 ERROR  : zigbee-adapter:     at DeconzDriver.handleFrame (/etc/webthings-gateway/addons/zigbee-adapter/zb-driver.js:382:12)
2020-08-03 22:32:30.939 ERROR  : zigbee-adapter:     at DeconzDriver.handleFrame (/etc/webthings-gateway/addons/zigbee-adapter/deconz-driver.js:477:13)
2020-08-03 22:32:30.940 ERROR  : zigbee-adapter:     at DeconzAPI.DeconzDriver.dc.on (/etc/webthings-gateway/addons/zigbee-adapter/deconz-driver.js:118:16)
2020-08-03 22:32:30.942 ERROR  : zigbee-adapter:     at DeconzAPI.emit (events.js:198:13)
2020-08-03 22:32:30.945 ERROR  : zigbee-adapter: { response: true,
2020-08-03 22:32:30.946 ERROR  : zigbee-adapter:   type: 23,
2020-08-03 22:32:30.948 ERROR  : zigbee-adapter:   seqNum: 41,
2020-08-03 22:32:30.949 ERROR  : zigbee-adapter:   status: 0,
2020-08-03 22:32:30.950 ERROR  : zigbee-adapter:   payloadLen: 35,
2020-08-03 22:32:30.952 ERROR  : zigbee-adapter:   deviceState: 38,
2020-08-03 22:32:30.953 ERROR  : zigbee-adapter:   networkState: 2,
2020-08-03 22:32:30.954 ERROR  : zigbee-adapter:   dataConfirm: true,
mrstegeman commented 4 years ago

@dhylands might know more about that kind of thing.

davehylands commented 4 years ago

That looks like a bug. Line 220 https://github.com/mozilla-iot/zigbee-adapter/blob/14150a8c08d612972713b1541fcbed733c991928/zb-adapter.js#L220 should reference frame.nwAddr64 rather than node.nwAddr64

frederic34 commented 4 years ago

Is it same case at line 213 https://github.com/mozilla-iot/zigbee-adapter/blob/14150a8c08d612972713b1541fcbed733c991928/zb-adapter.js#L213

davehylands commented 4 years ago

It looks like node.addr64 should be frame.nwkAddr64 on line 213 and node.nwkAddr64 should be frame.nwkAddr64 on line 220.

flatsiedatsie commented 4 years ago

@davehylands Would you be willing to propose the change?