codm / cc2652p2-tcp-zigbee

ZigBee CC2652P2 Ethernet Coordinator
30 stars 6 forks source link

Error: Failed to connect to the adapter (Error: SRSP - SYS - ping after 6000ms) #5

Closed ericvb closed 1 year ago

ericvb commented 1 year ago

Just purchased a brand new cod.m CC2652P2 TCP Zigbee Coordinator V0.2 Trying now to get it working with the HA Zigbee2MQTT addon.

data_path: /config/zigbee2mqtt
socat:
  enabled: false
  master: pty,raw,echo=0,link=/tmp/ttyZ2M,mode=777
  slave: tcp-listen:8485,keepalive,nodelay,reuseaddr,keepidle=1,keepintvl=1,keepcnt=5
  options: "-d -d"
  log: false
mqtt:
  server: mqtt://mymqttbroker_IP_address:8883
  user: "!secret mqtt_username"
  password: "!secret mqtt_password"
serial:
  port: tcp://192.168.50.39:20108
advanced:
  log_level: debug
zigbee_herdsman_debug: true

This is the log output:

[11:28:35] INFO: Preparing to start...
[11:28:35] INFO: Socat not enabled
[11:28:35] INFO: Zigbee Herdsman debug logging enabled
[11:28:35] INFO: Starting Zigbee2MQTT...
Zigbee2MQTT:debug 2023-01-05 11:28:36: Can't load state from file /config/zigbee2mqtt/state.json (doesn't exist)
Zigbee2MQTT:info  2023-01-05 11:28:36: Logging to console and directory: '/config/zigbee2mqtt/log/2023-01-05.11-28-36' filename: log.txt
Zigbee2MQTT:debug 2023-01-05 11:28:36: Removing old log directory '/config/zigbee2mqtt/log/2023-01-04.22-39-48'
Zigbee2MQTT:info  2023-01-05 11:28:36: Starting Zigbee2MQTT version 1.29.0 (commit #unknown)
Zigbee2MQTT:info  2023-01-05 11:28:36: Starting zigbee-herdsman (0.14.83)
Zigbee2MQTT:debug 2023-01-05 11:28:36: Using zigbee-herdsman with settings: '{"adapter":{"concurrent":null,"delay":null,"disableLED":false},"backupPath":"/config/zigbee2mqtt/coordinator_backup.json","databaseBackupPath":"/config/zigbee2mqtt/database.db.backup","databasePath":"/config/zigbee2mqtt/database.db","network":{"channelList":[11],"extendedPanID":[221,221,221,221,221,221,221,221],"networkKey":"HIDDEN","panID":6754},"serialPort":{"path":"tcp://192.168.50.39:20108"}}'
2023-01-05T10:28:37.009Z zigbee-herdsman:adapter Failed to validate path: 'Error: spawn udevadm ENOENT'
2023-01-05T10:28:37.009Z zigbee-herdsman:controller:log Starting with options '{"network":{"networkKeyDistribute":false,"networkKey":[1,3,5,7,9,11,13,15,0,2,4,6,8,10,12,13],"panID":6754,"extendedPanID":[221,221,221,221,221,221,221,221],"channelList":[11]},"serialPort":{"path":"tcp://192.168.50.39:20108"},"databasePath":"/config/zigbee2mqtt/database.db","databaseBackupPath":"/config/zigbee2mqtt/database.db.backup","backupPath":"/config/zigbee2mqtt/coordinator_backup.json","adapter":{"disableLED":false,"concurrent":null,"delay":null}}'
2023-01-05T10:28:37.010Z zigbee-herdsman:adapter:zStack:znp:log Opening TCP socket with 192.168.50.39:20108
2023-01-05T10:28:37.015Z zigbee-herdsman:adapter:zStack:znp:log Socket connected
2023-01-05T10:28:37.015Z zigbee-herdsman:adapter:zStack:znp:log Socket ready
2023-01-05T10:28:37.015Z zigbee-herdsman:adapter:zStack:znp:log Writing CC2530/CC2531 skip bootloader payload
2023-01-05T10:28:37.015Z zigbee-herdsman:adapter:zStack:unpi:writer --> buffer [239]
2023-01-05T10:28:38.018Z zigbee-herdsman:adapter:zStack:znp:log Skip bootloader for CC2652/CC1352
2023-01-05T10:28:38.018Z zigbee-herdsman:adapter:zStack:znp:SREQ --> SYS - ping - {"capabilities":1}
2023-01-05T10:28:38.019Z zigbee-herdsman:adapter:zStack:unpi:writer --> frame [254,0,33,1,32]
2023-01-05T10:28:44.020Z zigbee-herdsman:adapter:zStack:znp:SREQ --> SYS - ping - {"capabilities":1}
2023-01-05T10:28:44.020Z zigbee-herdsman:adapter:zStack:unpi:writer --> frame [254,0,33,1,32]
2023-01-05T10:28:50.026Z zigbee-herdsman:adapter:zStack:znp:SREQ --> SYS - ping - {"capabilities":1}
2023-01-05T10:28:50.026Z zigbee-herdsman:adapter:zStack:unpi:writer --> frame [254,0,33,1,32]
Zigbee2MQTT:error 2023-01-05 11:28:56: Error while starting zigbee-herdsman
Zigbee2MQTT:error 2023-01-05 11:28:56: Failed to start zigbee
Zigbee2MQTT:error 2023-01-05 11:28:56: Check https://www.zigbee2mqtt.io/guide/installation/20_zigbee2mqtt-fails-to-start.html for possible solutions
Zigbee2MQTT:error 2023-01-05 11:28:56: Exiting...
Zigbee2MQTT:error 2023-01-05 11:28:56: Error: Failed to connect to the adapter (Error: SRSP - SYS - ping after 6000ms)
    at ZStackAdapter.start (/app/node_modules/zigbee-herdsman/src/adapter/z-stack/adapter/zStackAdapter.ts:103:27)
    at Controller.start (/app/node_modules/zigbee-herdsman/src/controller/controller.ts:132:29)
    at Zigbee.start (/app/lib/zigbee.ts:58:27)
    at Controller.start (/app/lib/controller.ts:101:27)
    at start (/app/index.js:107:5)

Apparently, it can connect to the tcp socket, but then it fails. Any idea how to debug this? Where to search?

codmpm commented 1 year ago

Hey there.

are you on the same network (192.168.50.0) as the coordinator?

Personally never had anything to do with the socat options. Maybe remove these. Here's a working config from a standalone z2m install.

homeassistant: false
permit_join: true
mqtt:
  base_topic: zigbee2mqtt
  server: mqtt://localhost
frontend:
  port: 8080
  host: 0.0.0.0
serial:
  port: tcp://192.168.40.122:20108
ericvb commented 1 year ago

I'm running the Home Assistant OS version in a VM box. The VM box is running in another network 192.168.1.x. A firewall rule is permitting to access the network 192.168.50.0/24 The rule is permitting all services.

The socat options where automatically added to the configuration by the HA Zigbee2MQTT addon. I will test without the socat options. Edit : the HA add-on don't save without these socat options.

ericvb commented 1 year ago

I will try to set the adapter directly into the 192.168.1.x network, to exclude firewall rules problems. If no result, add an issue in the Koenkk github repo?

ericvb commented 1 year ago

No luck in trying to use the adapter in the same 192.168.1.x network. Same log result.

@codmpm, is there a way to test the hardware without using HA?

codmpm commented 1 year ago

Hmm. That's odd. Could you setup a plain zigbee2mqtt intance for testing? https://www.zigbee2mqtt.io/guide/installation/

ericvb commented 1 year ago

I've tested with the latest docker image of zigbee2mqtt using the same configuration

# 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://myipmqttserver:8883'
  # MQTT server authentication, uncomment if required:
  user: xxx
  password: xxx

# Serial settings
serial:
  # Location of CC2531 USB sniffer
  port: tcp://192.168.50.39:20108

advanced:
  log_level: debug
eric@aeolus:~/zigbee2mqtt/data$ sudo docker run \
>    --name zigbee2mqtt \
>    -p 8080:8080 \
>    -v $(pwd):/app/data \
>    -v /run/udev:/run/udev:ro \
>    -e TZ=Europe/Amsterdam \
>    -e DEBUG=zigbee-herdsman* \
>    koenkk/zigbee2mqtt
Using '/app/data' as data directory
Zigbee2MQTT:debug 2023-01-06 12:48:53: Can't load state from file /app/data/state.json (doesn't exist)
Zigbee2MQTT:info  2023-01-06 12:48:53: Logging to console and directory: '/app/data/log/2023-01-06.12-48-53' filename: log.txt
Zigbee2MQTT:info  2023-01-06 12:48:53: Starting Zigbee2MQTT version 1.29.1 (commit #7d67ffc)
Zigbee2MQTT:info  2023-01-06 12:48:53: Starting zigbee-herdsman (0.14.83)
Zigbee2MQTT:debug 2023-01-06 12:48:53: Using zigbee-herdsman with settings: '{"adapter":{"concurrent":null,"delay":null,"disableLED":false},"backupPath":"/app/data/coordinator_backup.json","databaseBackupPath":"/app/data/database.db.backup","databasePath":"/app/data/database.db","network":{"channelList":[11],"extendedPanID":[221,221,221,221,221,221,221,221],"networkKey":"HIDDEN","panID":6754},"serialPort":{"path":"tcp://192.168.50.39:20108"}}'
2023-01-06T11:48:53.781Z zigbee-herdsman:controller:log Starting with options '{"network":{"networkKeyDistribute":false,"networkKey":[1,3,5,7,9,11,13,15,0,2,4,6,8,10,12,13],"panID":6754,"extendedPanID":[221,221,221,221,221,221,221,221],"channelList":[11]},"serialPort":{"path":"tcp://192.168.50.39:20108"},"databasePath":"/app/data/database.db","databaseBackupPath":"/app/data/database.db.backup","backupPath":"/app/data/coordinator_backup.json","adapter":{"disableLED":false,"concurrent":null,"delay":null}}'
2023-01-06T11:48:53.783Z zigbee-herdsman:adapter:zStack:znp:log Opening TCP socket with 192.168.50.39:20108
2023-01-06T11:48:53.789Z zigbee-herdsman:adapter:zStack:znp:log Socket connected
2023-01-06T11:48:53.789Z zigbee-herdsman:adapter:zStack:znp:log Socket ready
2023-01-06T11:48:53.790Z zigbee-herdsman:adapter:zStack:znp:log Writing CC2530/CC2531 skip bootloader payload
2023-01-06T11:48:53.790Z zigbee-herdsman:adapter:zStack:unpi:writer --> buffer [239]
2023-01-06T11:48:54.793Z zigbee-herdsman:adapter:zStack:znp:log Skip bootloader for CC2652/CC1352
2023-01-06T11:48:54.793Z zigbee-herdsman:adapter:zStack:znp:SREQ --> SYS - ping - {"capabilities":1}
2023-01-06T11:48:54.794Z zigbee-herdsman:adapter:zStack:unpi:writer --> frame [254,0,33,1,32]
2023-01-06T11:49:00.801Z zigbee-herdsman:adapter:zStack:znp:SREQ --> SYS - ping - {"capabilities":1}
2023-01-06T11:49:00.801Z zigbee-herdsman:adapter:zStack:unpi:writer --> frame [254,0,33,1,32]
2023-01-06T11:49:06.808Z zigbee-herdsman:adapter:zStack:znp:SREQ --> SYS - ping - {"capabilities":1}
2023-01-06T11:49:06.808Z zigbee-herdsman:adapter:zStack:unpi:writer --> frame [254,0,33,1,32]
Zigbee2MQTT:error 2023-01-06 12:49:12: Error while starting zigbee-herdsman
Zigbee2MQTT:error 2023-01-06 12:49:12: Failed to start zigbee
Zigbee2MQTT:error 2023-01-06 12:49:12: Check https://www.zigbee2mqtt.io/guide/installation/20_zigbee2mqtt-fails-to-start.html for possible solutions
Zigbee2MQTT:error 2023-01-06 12:49:12: Exiting...
Zigbee2MQTT:error 2023-01-06 12:49:12: Error: Failed to connect to the adapter (Error: SRSP - SYS - ping after 6000ms)
    at ZStackAdapter.start (/app/node_modules/zigbee-herdsman/src/adapter/z-stack/adapter/zStackAdapter.ts:103:27)
    at Controller.start (/app/node_modules/zigbee-herdsman/src/controller/controller.ts:132:29)
    at Zigbee.start (/app/lib/zigbee.ts:58:27)
    at Controller.start (/app/lib/controller.ts:101:27)
    at start (/app/index.js:107:5)

I see in the webinterface of the tcp server USR-K6, that I can do a reset. Should I try this?

codmpm commented 1 year ago

Yes, please try that. See here https://github.com/codm/cc2652p2-tcp-zigbee#usr-k6 how it should ne set up.

ericvb commented 1 year ago

I did the reset (= clicked the RESET box in the USR-K6 webinterface and saved and restarted the module) After that no change in behaviour, same error logging.

The hardware CC2652P2 TCP ZigBee Coordinator V0.2 was from the batch from end december 2022. Did you hear anything about simular problems?

I see that with the ZigStar GW Multitool, I can 'Verify' the firmware. I will try that.

codmpm commented 1 year ago

No, no such problems reported.

Using the ZigStar GW Multitool you can update the Z-Stack firmware on the CC2652. This is completely independent from the firmware of the LAN module (USRIOT USR-K6).

If nothing helps we will arange repair in any form.

ericvb commented 1 year ago

I think I know what the problem is. When I opened the box, I saw this

image

There was apparently a problem in soldering the components...

codmpm commented 1 year ago

Woah. Ok. That is definetly not ok. I'll send you a label for sending the coordinator back to us so we can repair it.

Please hit me up on support@codm.de to verify the address.

Sorry for that.

ericvb commented 1 year ago

No problem, this can happen :-)

I've send you an email.

ericvb commented 1 year ago

Hi @codmpm, Thank you for the quick repair of the unit. Everything is working now. Regards,