danielwelch / hassio-zigbee2mqtt

Hass.io add-on for zigbee2mqtt
Apache License 2.0
565 stars 190 forks source link

Addon will not start with shae.sh RPi4 HASS #536

Closed rutger-s closed 3 years ago

rutger-s commented 3 years ago

Description of problem: The add on cannot start. I get the gateway error if I go to the UI.

I tried different ports, flashing it again, reinstalling the add-on. When I flash the debugging firmware, both LEDs go on. So flashing works.

I see the number it often ttyAM*. With my device, I get ttyUSB0. I use it in combination with a P1 meter. I tried using the long name as well with the same result: /dev/serial/by-id/usb-Silicon_Labs_slae.sh_cc2652rbstick-_slaesh_s_iot_stuff_00_12_4B_00_21_CC_4B_CE-if00-port0

Neither button on the device changes the LEDs. I think I read that the LED should go off when resetting, I don't see that happening.

Did I just miss something very silly?

USB number

~ $ ls -lt /dev/serial/by-id/
total 0
lrwxrwxrwx    1 root     root            13 Feb 10 17:26 usb-Silicon_Labs_slae.sh_cc2652rb_stick_-_slaesh_s_iot_stuff_00_12_4B_00_21_CC_4B_CE-if00-port0 -> ../../ttyUSB0

~ $ ls -lt /dev/ttyUSB0 
crw-rw----    1 root     audio     188,   0 Feb 10 17:42 /dev/ttyUSB0

Your entire configuration from the frontend (with sensitive fields redacted):

data_path: /share/zigbee2mqtt
external_converters: []
devices: devices.yaml
groups: groups.yaml
homeassistant: true
permit_join: true
mqtt:
  base_topic: zigbee2mqtt
  server: 'mqtt://localhost:1883'
  user: redacted
  password: redacted
serial:
  port: /dev/ttyUSB0
  disable_led: true
advanced:
  log_level: debug
  pan_id: 6754
  channel: 11
  network_key:
    redacted, unchanged
  availability_blocklist: []
  availability_passlist: []
device_options: {}
blocklist: []
passlist: []
queue: {}
frontend:
  port: 8099
experimental:
  new_api: true
socat:
  enabled: false
  master: 'pty,raw,echo=0,link=/dev/ttyZ2M,mode=777'
  slave: 'tcp-listen:8485,keepalive,nodelay,reuseaddr,keepidle=1,keepintvl=1,keepcnt=5'
  restartdelay: 1
  initialdelay: 1
  options: '-d -d'
  log: false

Your logs from Home Assistant

 zigbee2mqtt@1.17.1 start: `node index.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the zigbee2mqtt@1.17.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!     /root/.npm/_logs/2021-02-10T16_41_47_759Z-debug.log
2021-02-10T17:41:48: PM2 log: App [npm:0] exited with code [1] via signal [SIGINT]
2021-02-10T17:41:48: PM2 log: App [npm:0] starting in -fork mode-
2021-02-10T17:41:48: PM2 log: App [npm:0] online
> zigbee2mqtt@1.17.1 start /zigbee2mqtt-1.17.1
> node index.js
Zigbee2MQTT:debug 2021-02-10 17:41:52: Can't load state from file /share/zigbee2mqtt/state.json (doesn't exist)
Zigbee2MQTT:info  2021-02-10 17:41:52: Logging to console and directory: '/share/zigbee2mqtt/log/2021-02-10.17-41-50' filename: log.txt
Zigbee2MQTT:debug 2021-02-10 17:41:52: Removing old log directory '/share/zigbee2mqtt/log/2021-02-10.17-37-19'
Zigbee2MQTT:info  2021-02-10 17:41:52: Starting Zigbee2MQTT version 1.17.1 (commit #1.17.1)
Zigbee2MQTT:info  2021-02-10 17:41:52: Starting zigbee-herdsman (0.13.59)
Zigbee2MQTT:debug 2021-02-10 17:41:52: Using zigbee-herdsman with settings: '{"adapter":{"concurrent":null,"delay":null},"backupPath":"/share/zigbee2mqtt/coordinator_backup.json","databaseBackupPath":"/share/zigbee2mqtt/database.db.backup","databasePath":"/share/zigbee2mqtt/database.db","network":{"channelList":[11],"extendedPanID":[221,221,221,221,221,221,221,221],"networkKey":"HIDDEN","panID":6754},"serialPort":{"path":"/dev/ttyUSB0"}}'
Zigbee2MQTT:error 2021-02-10 17:42:12: Error while starting zigbee-herdsman
Zigbee2MQTT:error 2021-02-10 17:42:12: Failed to start zigbee
Zigbee2MQTT:error 2021-02-10 17:42:12: Exiting...
Zigbee2MQTT:error 2021-02-10 17:42:12: Error: Failed to connect to the adapter (Error: SRSP - SYS - ping after 6000ms)
    at ZStackAdapter.<anonymous> (/zigbee2mqtt-1.17.1/node_modules/zigbee-herdsman/dist/adapter/z-stack/adapter/zStackAdapter.js:94:31)
    at Generator.throw (<anonymous>)
    at rejected (/zigbee2mqtt-1.17.1/node_modules/zigbee-herdsman/dist/adapter/z-stack/adapter/zStackAdapter.js:25:65)
npm
 ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR!
 zigbee2mqtt@1.17.1 start: `node index.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the zigbee2mqtt@1.17.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!     /root/.npm/_logs/2021-02-10T16_42_12_222Z-debug.log
2021-02-10T17:42:12: PM2 log: App [npm:0] exited with code [1] via signal [SIGINT]
2021-02-10T17:42:12: PM2 log: App [npm:0] starting in -fork mode-
2021-02-10T17:42:12: PM2 log: App [npm:0] online
> zigbee2mqtt@1.17.1 start /zigbee2mqtt-1.17.1
> node index.js

dmesg output

[ 1603.323625] cp210x ttyUSB0: failed set request 0x7 status: -19
[ 1603.323662] cp210x ttyUSB0: failed set request 0x12 status: -19
[ 1603.323678] cp210x ttyUSB0: failed set request 0x0 status: -19
[ 1603.326259] cp210x ttyUSB0: cp210x converter now disconnected from ttyUSB0
[ 1603.326389] cp210x 1-1.1:1.0: device disconnected
[ 1621.586763] usb 1-1.1: new full-speed USB device number 7 using xhci_hcd
[ 1621.732186] usb 1-1.1: New USB device found, idVendor=10c4, idProduct=ea60, bcdDevice= 1.00
[ 1621.732196] usb 1-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1621.732203] usb 1-1.1: Product: slae.sh cc2652rb stick - slaesh's iot stuff
[ 1621.732210] usb 1-1.1: Manufacturer: Silicon Labs
[ 1621.732217] usb 1-1.1: SerialNumber: 00_12_4B_00_21_CC_4B_CE
[ 1621.736517] cp210x 1-1.1:1.0: cp210x converter detected
[ 1621.744358] usb 1-1.1: cp210x converter now attached to ttyUSB0
[ 2326.874549] kauditd_printk_skb: 8 callbacks suppressed
[ 2326.874553] audit: type=1325 audit(1612975068.051:284): table=nat family=2 entries=29
[ 2326.911835] audit: type=1325 audit(1612975068.091:285): table=filter family=2 entries=37
[ 2326.945928] audit: type=1325 audit(1612975068.121:286): table=nat family=2 entries=28
[ 2326.963893] hassio: port 11(veth044b14c) entered disabled state
[ 2326.964226] veth3031e82: renamed from eth0
[ 2335.985588] hassio: port 11(veth044b14c) entered disabled state
[ 2336.003816] device veth044b14c left promiscuous mode
[ 2336.003843] hassio: port 11(veth044b14c) entered disabled state
[ 2336.004139] audit: type=1700 audit(1612975077.131:287): dev=veth044b14c prom=0 old_prom=256 auid=4294967295 uid=0 gid=0 ses=4294967295
[ 2337.658477] hassio: port 11(veth646f999) entered blocking state
[ 2337.658486] hassio: port 11(veth646f999) entered disabled state
[ 2337.666545] device veth646f999 entered promiscuous mode
[ 2337.666603] audit: type=1700 audit(1612975078.841:288): dev=veth646f999 prom=256 old_prom=0 auid=4294967295 uid=0 gid=0 ses=4294967295
[ 2337.797369] audit: type=1325 audit(1612975078.981:289): table=nat family=2 entries=27
[ 2337.849438] audit: type=1325 audit(1612975079.031:290): table=filter family=2 entries=36
[ 2337.879083] audit: type=1325 audit(1612975079.061:291): table=nat family=2 entries=28
[ 2338.673070] audit: type=1325 audit(1612975079.850:292): table=nat family=2 entries=0
[ 2338.697582] audit: type=1325 audit(1612975079.880:293): table=filter family=2 entries=0
[ 2338.756795] audit: type=1325 audit(1612975079.940:294): table=nat family=2 entries=5
[ 2338.769226] audit: type=1325 audit(1612975079.950:295): table=nat family=2 entries=7
[ 2338.789017] audit: type=1325 audit(1612975079.970:296): table=nat family=2 entries=8
[ 2338.991374] eth0: renamed from veth76de7e1
[ 2339.028481] IPv6: ADDRCONF(NETDEV_CHANGE): veth646f999: link becomes ready
[ 2339.028612] hassio: port 11(veth646f999) entered blocking state
[ 2339.028619] hassio: port 11(veth646f999) entered forwarding state
rutger-s commented 3 years ago

I fixed it.

I suspect the problem was related with another usb device (DSMR smart meter) that used to have USB0 mapping. Perhaps that integration was keeping the antenna occupied. I changed that to USB1 and set the zigbee2mqtt to serial by id and now it works like a charm.