AlCalzone / ioBroker.zwave2

Z-Wave for ioBroker. Better. Faster. Stronger.
MIT License
23 stars 13 forks source link

How to disable soft reset? #737

Closed Crazyachmed closed 3 years ago

Crazyachmed commented 3 years ago

After the update to 2.3.0 the Z-Wave stick will not initialize anymore. I can not find the option to disable the soft-reset function in the instance configuration.

2021-10-25T14:52:11.534Z DRIVER   ███████╗ ██╗    ██╗  █████╗  ██╗   ██╗ ███████╗             ██╗ ███████╗
                                  ╚══███╔╝ ██║    ██║ ██╔══██╗ ██║   ██║ ██╔════╝             ██║ ██╔════╝
                                    ███╔╝  ██║ █╗ ██║ ███████║ ██║   ██║ █████╗   █████╗      ██║ ███████╗
                                   ███╔╝   ██║███╗██║ ██╔══██║ ╚██╗ ██╔╝ ██╔══╝   ╚════╝ ██   ██║ ╚════██║
                                  ███████╗ ╚███╔███╔╝ ██║  ██║  ╚████╔╝  ███████╗        ╚█████╔╝ ███████║
                                  ╚══════╝  ╚══╝╚══╝  ╚═╝  ╚═╝   ╚═══╝   ╚══════╝         ╚════╝  ╚══════╝
2021-10-25T14:52:11.536Z DRIVER   version 8.6.0
2021-10-25T14:52:11.536Z DRIVER   
2021-10-25T14:52:11.537Z DRIVER   starting driver...
2021-10-25T14:52:11.563Z DRIVER   opening serial port /dev/ttyACM0
2021-10-25T14:52:11.589Z DRIVER   serial port opened
2021-10-25T14:52:11.590Z SERIAL » [NAK]                                                                   (0x15)
2021-10-25T14:52:11.597Z CNTRLR   Performing soft reset...
2021-10-25T14:52:11.741Z SERIAL » 0x01030008f4                                                         (5 bytes)
2021-10-25T14:52:11.744Z DRIVER » [REQ] [SoftReset]
2021-10-25T14:52:11.755Z SERIAL « [ACK]                                                                   (0x06)
2021-10-25T14:52:11.770Z CNTRLR   Waiting for the controller to reconnect...
2021-10-25T14:52:13.273Z CNTRLR   Waiting for the Serial API to start...
2021-10-25T14:52:18.275Z CNTRLR   Did not receive notification that Serial API has started, checking if it respo
                                  nds...
2021-10-25T14:52:18.300Z DRIVER » [REQ] [GetControllerVersion]
2021-10-25T14:52:18.308Z CNTRLR   Failed to execute controller command after 1/3 attempts. Scheduling next try i
                                  n 100 ms.
2021-10-25T14:52:18.411Z DRIVER » [REQ] [GetControllerVersion]
2021-10-25T14:52:18.414Z CNTRLR   Failed to execute controller command after 2/3 attempts. Scheduling next try i
                                  n 1100 ms.
2021-10-25T14:52:19.517Z DRIVER » [REQ] [GetControllerVersion]
2021-10-25T14:52:19.530Z CNTRLR   Serial API did not respond, trying again in 2 seconds...
2021-10-25T14:52:21.545Z DRIVER » [REQ] [GetControllerVersion]
2021-10-25T14:52:21.548Z CNTRLR   Failed to execute controller command after 1/3 attempts. Scheduling next try i
                                  n 100 ms.
2021-10-25T14:52:21.650Z DRIVER » [REQ] [GetControllerVersion]
2021-10-25T14:52:21.653Z CNTRLR   Failed to execute controller command after 2/3 attempts. Scheduling next try i
                                  n 1100 ms.
2021-10-25T14:52:22.757Z DRIVER » [REQ] [GetControllerVersion]
2021-10-25T14:52:22.766Z CNTRLR   Serial API did not respond, trying again in 5 seconds...
2021-10-25T14:52:27.779Z DRIVER » [REQ] [GetControllerVersion]
2021-10-25T14:52:27.782Z CNTRLR   Failed to execute controller command after 1/3 attempts. Scheduling next try i
                                  n 100 ms.
2021-10-25T14:52:27.885Z DRIVER » [REQ] [GetControllerVersion]
2021-10-25T14:52:27.888Z CNTRLR   Failed to execute controller command after 2/3 attempts. Scheduling next try i
                                  n 1100 ms.
2021-10-25T14:52:28.992Z DRIVER » [REQ] [GetControllerVersion]
2021-10-25T14:52:29.005Z CNTRLR   Serial API did not respond, trying again in 10 seconds...
2021-10-25T14:52:29.894Z DRIVER   destroying driver instance...
Crazyachmed commented 3 years ago

After using the GUI to downgrade to 2.2.4 iobroker was still using zwave-js version 8.6.0. I don't have a single clue about using npm, so in the directory /opt/iobroker I used the command "npm install zwave-js@8.5.0" as root. My network works again and I hope that this was a somewhat sensible fix.

peer69 commented 3 years ago

Reverting zwave-js via npm doesnt do the trick for me. Adapter not starting up with 2.3:

Failed to initialize the driver: ZWaveError: The driver is not ready or has been destroyed (ZW0103) at Driver.ensureReady (/opt/iobroker/node_modules/zwave-js/src/lib/driver/Driver.ts:1764:10) at Driver.sendMessage (/opt/iobroker/node_modules/zwave-js/src/lib/driver/Driver.ts:2931:8) at ZWaveController.interview (/opt/iobroker/node_modules/zwave-js/src/lib/controller/Controller.ts:506:22) at Driver.initializeControllerAndNodes (/opt/iobroker/node_modules/zwave-js/src/lib/driver/Driver.ts:932:27) at Immediate. (/opt/iobroker/node_modules/zwave-js/src/lib/driver/Driver.ts:809:16) (ZW0100)

AlCalzone commented 3 years ago

Which sticks/controllers do you guys have? Most tested ones had no issues.

peer69 commented 3 years ago

Aeotec AEOEZW090-C

Crazyachmed commented 3 years ago

ZMEEUZB1

AlCalzone commented 3 years ago

Ok those were both tested and should work. I have a suspicion that the path might change during soft reset. Can you try using a fixed path this way?

ls /dev/serial/by-id

Ths should output one or more USB devices, try to identify yours - on my system this is usb-Silicon_Labs_CP2102N_USB_to_UART_Bridge_Controller_8ad925bd7b84e911a7a7a1d6217343c2-if00-port0

Then enter /dev/serial/by-id/<your-device-name> as the path in the adapter (replace the part after the last slash with your device name). For my example, this would be

/dev/serial/by-id/usb-Silicon_Labs_CP2102N_USB_to_UART_Bridge_Controller_8ad925bd7b84e911a7a7a1d6217343c2-if00-port0
AlCalzone commented 3 years ago

@Crazyachmed

so in the directory /opt/iobroker I used the command "npm install zwave-js@8.5.0"

Bad idea. Never install dependencies directly in /opt/iobroker. This will lead to conflicts in the future. Instead, do that in the directory of the affected adapter, in this case /opt/iobroker/node_modules/iobroker.zwave2.

Crazyachmed commented 3 years ago

The device name never changes, but it does indeed disconnect after the soft-reset. Using /dev/ttyACM0 should be fine...

root@iobroker:~# dmesg | grep ACM
[    8.363548] cdc_acm 1-1.4:1.0: ttyACM0: USB ACM device
[  120.089062] cdc_acm 1-1.4:1.0: ttyACM0: USB ACM device
[  155.157678] cdc_acm 1-1.4:1.0: ttyACM0: USB ACM device
[  191.765539] cdc_acm 1-1.4:1.0: ttyACM0: USB ACM device
[  228.638046] cdc_acm 1-1.4:1.0: ttyACM0: USB ACM device
[  264.746166] cdc_acm 1-1.4:1.0: ttyACM0: USB ACM device
[  301.876455] cdc_acm 1-1.4:1.0: ttyACM0: USB ACM device
[  338.476784] cdc_acm 1-1.4:1.0: ttyACM0: USB ACM device
[  375.606948] cdc_acm 1-1.4:1.0: ttyACM0: USB ACM device
[  411.719612] cdc_acm 1-1.4:1.0: ttyACM0: USB ACM device
[  448.317286] cdc_acm 1-1.4:1.0: ttyACM0: USB ACM device
[  485.442177] cdc_acm 1-1.4:1.0: ttyACM0: USB ACM device
[  521.800410] cdc_acm 1-1.4:1.0: ttyACM0: USB ACM device
[  558.451209] cdc_acm 1-1.4:1.0: ttyACM0: USB ACM device
[  584.528757] cdc_acm 1-1.4:1.0: ttyACM0: USB ACM device
[  620.923298] cdc_acm 1-1.4:1.0: ttyACM0: USB ACM device
[  657.499386] cdc_acm 1-1.4:1.0: ttyACM0: USB ACM device
[ 9268.799476] cdc_acm 1-1.4:1.0: ttyACM0: USB ACM device
[ 9306.207550] cdc_acm 1-1.4:1.0: ttyACM0: USB ACM device
[ 9316.689707] cdc_acm 1-1.4:1.0: ttyACM0: USB ACM device
[ 9353.047843] cdc_acm 1-1.4:1.0: ttyACM0: USB ACM device
[ 9389.400556] cdc_acm 1-1.4:1.0: ttyACM0: USB ACM device
[ 9426.018467] cdc_acm 1-1.4:1.0: ttyACM0: USB ACM device
[ 9462.658812] cdc_acm 1-1.4:1.0: ttyACM0: USB ACM device
[ 9499.239008] cdc_acm 1-1.4:1.0: ttyACM0: USB ACM device
[ 9535.591833] cdc_acm 1-1.4:1.0: ttyACM0: USB ACM device
[ 9572.212009] cdc_acm 1-1.4:1.0: ttyACM0: USB ACM device
[ 9585.259792] cdc_acm 1-1.4:1.0: ttyACM0: USB ACM device
AlCalzone commented 3 years ago

Can you try the by-id approach please? I'm adding an option to disable the soft reset, but I want to mention the "correct" way in the troubleshooting docs.

Crazyachmed commented 3 years ago

Sorry, I did that - it did not make any difference.

AlCalzone commented 3 years ago

ok

AlCalzone commented 3 years ago

v2.3.1 is on the way with an option to disable the soft reset. Don't forget to remove the zwave-js dependency from /opt/iobroker/package.json again.

Crazyachmed commented 3 years ago

Yeah, I already removed the dependancy, thank you! I am already building directly from GitHub

Crazyachmed commented 3 years ago

It works :)

Anywhere we should troubleshoot the Soft-Reset-Issue?

AlCalzone commented 3 years ago

We can continue doing that here, but I'm not too familiar with what needs to be done on the OS side. So far all tests other users and I did worked on these sticks without issues.

AlCalzone commented 3 years ago

@peer69 yours should work if you use the serial/by-id paths.

@Crazyachmed I have another user with the same stick as yours, there it also doesn't work.

blhoward2 commented 3 years ago

Are you all running in docker or on bare metal?

Crazyachmed commented 3 years ago

I am using a bare metal RPI4

peer69 commented 3 years ago

@peer69 yours should work if you use the serial/by-id paths.

Nope. Unfortunately this does not work. Its "/dev/serial/by-id/usb-0658_0200-if00" for me. Only works as long as the box in the adapter settings is ticked to prevent restart. I'm running on Ubuntu 18.04 on an ESXI 6.7 host.

AlCalzone commented 3 years ago

ESXI 6.7 host

That could be the issue - we've tested the ZW090 on bare metal.

DerEmder commented 3 years ago

Worked perfectly fine with 3.2.4 but not 2.3.x - so what's the difference?

Anyway, I keep the option enabled until there is a fix for it.

AlCalzone commented 3 years ago

2.2.x did not use soft reset on startup.