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

CC2530+CC2591 adapter works only the fist time but needs a power cycle to work again #9865

Closed
damocles-dev opened this issue Nov 27, 2021 · 2 comments
Labels
problem Something isn't working

Comments

@damocles-dev
Copy link

damocles-dev commented Nov 27, 2021

What happened

Using a CC2530+CC2591 adapter works perfectly the first time it starts up but if you try to start it again it will no longer be able to start.

This problem begun from v1.21.x onwards, the last time it worked was v1.20.0.

How to reproduce it (minimal and precise)

Until v1.20.0 it always works so I did several tests with v1.21 and v1.22 and these were the results:

Intel Nuc + pl2303 usb/ttl adapter + CC2530+CC2591 adapter : second boot fails
raspberry pi 4 / raspberry pi zero v2 integrated uart + CC2530+CC2591 adapter: second boot fails

Intel Nuc + CC2531 USB adapter : second boot woks
raspberry pi 4 / raspberry pi zero v2 + CC2531 USB adapter: second boot works

Debug info

Zigbee2MQTT version: the last working version that worked was 1.20.0 and fails with 1.21.x and 1.22.0
Adapter hardware: CC2530+CC2591
Adapter firmware version: zStack12 / 20201127

Failed second boot:

$ DEBUG="zigbee-herdsman*" npm start

> [email protected] start
> node index.js

Zigbee2MQTT:info  2021-11-27 12:09:19: Logging to console and directory: '/opt/zigbee2mqtt/data/log/2021-11-27.12-09-15' filename: log.txt
Zigbee2MQTT:info  2021-11-27 12:09:20: Starting Zigbee2MQTT version 1.22.0 (commit #0a1fccf6)
Zigbee2MQTT:info  2021-11-27 12:09:20: Starting zigbee-herdsman (0.13.164)
  zigbee-herdsman:controller:log Starting with options '{"network":{"networkKeyDistribute":false,"networkKey":[,"panID":6754,"extendedPanID":[221,221,221,221,221,221,221,221],"channelList":[11]},"serialPort":{"path":"/dev/ttyAMA0"},"databasePath":"/opt/zigbee2mqtt/data/database.db","databaseBackupPath":"/opt/zigbee2mqtt/data/database.db.backup","backupPath":"/opt/zigbee2mqtt/data/coordinator_backup.json","adapter":{"disableLED":false,"concurrent":null,"delay":null}}' +0ms
  zigbee-herdsman:adapter:zStack:znp:log Opening SerialPort with /dev/ttyAMA0 and {"baudRate":115200,"rtscts":false,"autoOpen":false} +0ms
  zigbee-herdsman:adapter:zStack:znp:log Serialport opened +19ms
  zigbee-herdsman:adapter:zStack:znp:SREQ --> SYS - ping - {"capabilities":1} +0ms
  zigbee-herdsman:adapter:zStack:unpi:writer --> frame [254,0,33,1,32] +0ms
  zigbee-herdsman:adapter:zStack:znp:log Writing CC2530/CC2531 skip bootloader payload +271ms
  zigbee-herdsman:adapter:zStack:unpi:writer --> buffer [239] +260ms
  zigbee-herdsman:adapter:zStack:znp:SREQ --> SYS - ping - {"capabilities":1} +1s
  zigbee-herdsman:adapter:zStack:unpi:writer --> frame [254,0,33,1,32] +1s
  zigbee-herdsman:adapter:zStack:znp:log Skip bootloader for CC2652/CC1352 +1s
  zigbee-herdsman:adapter:zStack:znp:SREQ --> SYS - ping - {"capabilities":1} +713ms
  zigbee-herdsman:adapter:zStack:unpi:writer --> frame [254,0,33,1,32] +713ms
  zigbee-herdsman:adapter:zStack:znp:SREQ --> SYS - ping - {"capabilities":1} +6s
  zigbee-herdsman:adapter:zStack:unpi:writer --> frame [254,0,33,1,32] +6s
  zigbee-herdsman:adapter:zStack:znp:SREQ --> SYS - ping - {"capabilities":1} +6s
  zigbee-herdsman:adapter:zStack:unpi:writer --> frame [254,0,33,1,32] +6s
Zigbee2MQTT:error 2021-11-27 12:09:41: Error while starting zigbee-herdsman
Zigbee2MQTT:error 2021-11-27 12:09:41: Failed to start zigbee
Zigbee2MQTT:error 2021-11-27 12:09:41: Check https://www.zigbee2mqtt.io/information/FAQ.html#help-zigbee2mqtt-fails-to-start for possible solutions
Zigbee2MQTT:error 2021-11-27 12:09:41: Exiting...
Zigbee2MQTT:error 2021-11-27 12:09:42: Error: Failed to connect to the adapter (Error: SRSP - SYS - ping after 6000ms)
    at ZStackAdapter.start (/opt/zigbee2mqtt/node_modules/zigbee-herdsman/src/adapter/z-stack/adapter/zStackAdapter.ts:102:27)
npm ERR! code 1
npm ERR! path /opt/zigbee2mqtt
npm ERR! command failed
npm ERR! command sh -c node index.js

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/pi/.npm/_logs/2021-11-27T11_09_42_365Z-debug.log

First boot:

$ DEBUG="zigbee-herdsman*" npm start

> [email protected] start
> node index.js

Zigbee2MQTT:info  2021-11-27 12:21:52: Logging to console and directory: '/opt/zigbee2mqtt/data/log/2021-11-27.12-21-47' filename: log.txt
Zigbee2MQTT:info  2021-11-27 12:21:52: Starting Zigbee2MQTT version 1.22.0 (commit #0a1fccf6)
Zigbee2MQTT:info  2021-11-27 12:21:52: Starting zigbee-herdsman (0.13.164)
  zigbee-herdsman:controller:log Starting with options '{"network":{"networkKeyDistribute":false,"networkKey":[],"panID":6754,"extendedPanID":[221,221,221,221,221,221,221,221],"channelList":[11]},"serialPort":{"path":"/dev/ttyAMA0"},"databasePath":"/opt/zigbee2mqtt/data/database.db","databaseBackupPath":"/opt/zigbee2mqtt/data/database.db.backup","backupPath":"/opt/zigbee2mqtt/data/coordinator_backup.json","adapter":{"disableLED":false,"concurrent":null,"delay":null}}' +0ms
  zigbee-herdsman:adapter:zStack:znp:log Opening SerialPort with /dev/ttyAMA0 and {"baudRate":115200,"rtscts":false,"autoOpen":false} +0ms
  zigbee-herdsman:adapter:zStack:znp:log Serialport opened +17ms
  zigbee-herdsman:adapter:zStack:znp:SREQ --> SYS - ping - {"capabilities":1} +0ms
  zigbee-herdsman:adapter:zStack:unpi:writer --> frame [254,0,33,1,32] +0ms
  zigbee-herdsman:adapter:zStack:unpi:parser <-- [254,2,97,1,121,1,26] +0ms
  zigbee-herdsman:adapter:zStack:unpi:parser --- parseNext [254,2,97,1,121,1,26] +2ms
  zigbee-herdsman:adapter:zStack:unpi:parser --> parsed 2 - 3 - 1 - 1 - [121,1] - 26 +2ms
  zigbee-herdsman:adapter:zStack:znp:SRSP <-- SYS - ping - {"capabilities":377} +0ms
  zigbee-herdsman:adapter:zStack:unpi:parser --- parseNext [] +10ms
  zigbee-herdsman:adapter:zStack:znp:SREQ --> SYS - ping - {"capabilities":1} +36ms
  zigbee-herdsman:adapter:zStack:unpi:writer --> frame [254,0,33,1,32] +33ms
  zigbee-herdsman:adapter:zStack:unpi:parser <-- [254,2,97,1,121,1,26] +9ms
  zigbee-herdsman:adapter:zStack:unpi:parser --- parseNext [254,2,97,1,121,1,26] +0ms
  zigbee-herdsman:adapter:zStack:unpi:parser --> parsed 2 - 3 - 1 - 1 - [121,1] - 26 +1ms
  zigbee-herdsman:adapter:zStack:znp:SRSP <-- SYS - ping - {"capabilities":377} +16ms
  zigbee-herdsman:adapter:zStack:unpi:parser --- parseNext [] +1ms
  zigbee-herdsman:adapter:zStack:znp:SREQ --> SYS - version - {} +10ms
  zigbee-herdsman:adapter:zStack:unpi:writer --> frame [254,0,33,2,35] +10ms
  zigbee-herdsman:adapter:zStack:unpi:parser <-- [254,14,97,2,2,0,2,6] +8ms
  zigbee-herdsman:adapter:zStack:unpi:parser --- parseNext [254,14,97,2,2,0,2,6] +1ms
  zigbee-herdsman:adapter:zStack:unpi:parser <-- [3,167,62,52,1,2,0,0,0,0,198] +1ms
  zigbee-herdsman:adapter:zStack:unpi:parser --- parseNext [254,14,97,2,2,0,2,6,3,167,62,52,1,2,0,0,0,0,198] +1ms
  zigbee-herdsman:adapter:zStack:unpi:parser --> parsed 14 - 3 - 1 - 2 - [2,0,2,6,3,167,62,52,1,2,0,0,0,0] - 198 +1ms
  zigbee-herdsman:adapter:zStack:znp:SRSP <-- SYS - version - {"transportrev":2,"product":0,"majorrel":2,"minorrel":6,"maintrel":3,"revision":20201127} +14ms
  zigbee-herdsman:adapter:zStack:unpi:parser --- parseNext [] +2ms
  zigbee-herdsman:adapter:zStack:adapter Adapter concurrent: 2 +0ms
  zigbee-herdsman:adapter:zStack:adapter Detected znp version 'zStack12' ({"transportrev":2,"product":0,"majorrel":2,"minorrel":6,"maintrel":3,"revision":20201127}) +0ms
  zigbee-herdsman:adapter:zStack:startup beginning znp startup +0ms

[...]

  zigbee-herdsman:adapter:zStack:startup:backup fetched adapter pre-configured key +29ms
  zigbee-herdsman:adapter:zStack:znp:SREQ --> SYS - osalNvLength - {"id":35} +17ms
  zigbee-herdsman:adapter:zStack:unpi:writer --> frame [254,2,33,19,35,0,19] +17ms
  zigbee-herdsman:adapter:zStack:unpi:parser <-- [254,2,97,19,209,0,161] +14ms
  zigbee-herdsman:adapter:zStack:unpi:parser --- parseNext [254,2,97,19,209,0,161] +1ms
  zigbee-herdsman:adapter:zStack:unpi:parser --> parsed 2 - 3 - 1 - 19 - [209,0] - 161 +0ms
  zigbee-herdsman:adapter:zStack:znp:SRSP <-- SYS - osalNvLength - {"length":209} +16ms
  zigbee-herdsman:adapter:zStack:unpi:parser --- parseNext [] +1ms
  zigbee-herdsman:adapter:zStack:znp:SREQ --> SYS - osalNvReadExt - {"id":35,"offset":0} +15ms
  zigbee-herdsman:adapter:zStack:unpi:writer --> frame [254,4,33,28,35,0,0,0,26] +15ms
  zigbee-herdsman:adapter:zStack:znp:SREQ --> SYS - osalNvReadExt - {"id":35,"offset":0} +6s
  zigbee-herdsman:adapter:zStack:unpi:writer --> frame [254,4,33,28,35,0,0,0,26] +6s
  zigbee-herdsman:adapter:zStack:znp:SREQ --> SYS - osalNvReadExt - {"id":35,"offset":0} +6s
  zigbee-herdsman:adapter:zStack:unpi:writer --> frame [254,4,33,28,35,0,0,0,26] +6s
  zigbee-herdsman:adapter:zStack:startup:backup fetched adapter address manager table (capacity=0, used=0) +18s
  zigbee-herdsman:adapter:zStack:znp:SREQ --> SYS - osalNvLength - {"id":76} +6s
  zigbee-herdsman:adapter:zStack:unpi:writer --> frame [254,2,33,19,76,0,124] +6s
  zigbee-herdsman:adapter:zStack:znp:SREQ --> SYS - osalNvLength - {"id":76} +6s
  zigbee-herdsman:adapter:zStack:unpi:writer --> frame [254,2,33,19,76,0,124] +6s
  zigbee-herdsman:adapter:zStack:znp:SREQ --> SYS - osalNvLength - {"id":76} +6s
  zigbee-herdsman:adapter:zStack:unpi:writer --> frame [254,2,33,19,76,0,124] +6s
  zigbee-herdsman:adapter:zStack:startup:backup fetched adapter security manager table (capacity=0, used=0) +18s
  zigbee-herdsman:adapter:zStack:znp:SREQ --> SYS - osalNvLength - {"id":513} +6s
  zigbee-herdsman:adapter:zStack:unpi:writer --> frame [254,2,33,19,1,2,51] +6s
  zigbee-herdsman:adapter:zStack:znp:SREQ --> SYS - osalNvLength - {"id":513} +6s
  zigbee-herdsman:adapter:zStack:unpi:writer --> frame [254,2,33,19,1,2,51] +6s
  zigbee-herdsman:adapter:zStack:znp:SREQ --> SYS - osalNvLength - {"id":513} +6s
  zigbee-herdsman:adapter:zStack:unpi:writer --> frame [254,2,33,19,1,2,51] +6s
  zigbee-herdsman:adapter:zStack:startup:backup fetched adapter aps link key data table (capacity=0, used=0) +18s
  zigbee-herdsman:adapter:zStack:startup:backup fetched adapter tclk seed +0ms
  zigbee-herdsman:adapter:zStack:znp:SREQ --> SYS - osalNvLength - {"id":273} +6s
  zigbee-herdsman:adapter:zStack:unpi:writer --> frame [254,2,33,19,17,1,32] +6s
  zigbee-herdsman:adapter:zStack:znp:SREQ --> SYS - osalNvLength - {"id":273} +6s
  zigbee-herdsman:adapter:zStack:unpi:writer --> frame [254,2,33,19,17,1,32] +6s
  zigbee-herdsman:adapter:zStack:znp:SREQ --> SYS - osalNvLength - {"id":273} +6s
  zigbee-herdsman:adapter:zStack:unpi:writer --> frame [254,2,33,19,17,1,32] +6s
  zigbee-herdsman:adapter:zStack:startup:backup fetched adapter tclk table (capacity=0, used=0) +18s
  zigbee-herdsman:adapter:zStack:znp:SREQ --> SYS - osalNvLength 
@damocles-dev damocles-dev added the problem Something isn't working label Nov 27, 2021
@Koenkk
Copy link
Owner

Koenkk commented Nov 28, 2021

@damocles-dev
Copy link
Author

Thanks Koen, I missed that update. Now it works.

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

2 participants