node-zwave-js icon indicating copy to clipboard operation
node-zwave-js copied to clipboard

[Bug]: zwavejs2mqtt does not reconnect if the TCP (ser2net) serial port was drop

Open dick902 opened this issue 2 years ago • 4 comments

Checklist

  • [X] I am not using Home Assistant. Or: a developer has told me to come here.
  • [X] I have checked the troubleshooting section and my problem is not described there.
  • [X] I have read the changelog and my problem is not mentioned there.

Deploy method

Docker

Zwavejs2Mqtt version

6.10.0

ZwaveJS version

9.3.0

Describe the bug

This is a similar issues as zwave-js/zwavejs2mqtt#1246. Once the TCP serial connection drop, it will nerve reconnect until manual restart zwavejs2mqtt or press the SAVE button in the setting menu (another method to restart) also make the TCP serial port reconnect.

I had tested with v4.3.1 and found the issues was resolved before. But it is happening again on v5.x.x and v6.x.x of zwavejs2mqtt again.

To Reproduce

  1. Connect the Z-Wave dongle via ser2net
  2. Stop ser2net
  3. Wait for the lost connection in zwavejs2mqtt
  4. Restart ser2net

Expected behavior

After 4., the TCP serial port connection should be auto-restored.

Additional context

No response

dick902 avatar May 26 '22 00:05 dick902

@dick902 Could you upload logs please? I need to see the errors that are thrown

robertsLando avatar May 26 '22 06:05 robertsLando

@dick902 Could you upload logs please? I need to see the errors that are thrown zwavejs2mqtt_2022-05-26.log

Pls. find attached file as my log file in debug level. Log file seems show nothing about the TCP serial connection had interrupted. In the control panel at not showing anything the TCP serial connection had interrupted. In this log file, I had restart ser2net service at Line 11779, and the connection had broken here.

dick902 avatar May 26 '22 06:05 dick902

I think the problem so is that zwavejs ins't catching the close event or isn't reconnecting

@dick902 could you also upload zwavejs driver logs please?

cc @AlCalzone

robertsLando avatar May 26 '22 07:05 robertsLando

I think the problem so is that zwavejs ins't catching the close event or isn't reconnecting

@dick902 could you also upload zwavejs driver logs please?

zwavejs_2022-05-26.log zwavejs2mqtt_2022-05-26.log

cc @AlCalzone

Pls. find attached files. Seems also not had anything related TCP serial disconnected

dick902 avatar May 26 '22 07:05 dick902

I'm seeing the same issue - everything works fine, ser2net machine restarts properly but zwavejs never notices it was gone so it never receives anything from the zwave-stick again. Maybe a periodic status-poll from the stick would be enough to trigger a tcp-closed and reconnect (ie. a keepalive function)?

kvs avatar Oct 09 '22 18:10 kvs

We need to wait for @AlCalzone to come back from his parental leave in order to fix this

robertsLando avatar Oct 10 '22 07:10 robertsLando

Having recently moved to a remote zwave stick I am experiencing this same issue. The last comment is that AlCalzone is away - do we know for how long and when this issue might be fixed?

chrish987 avatar Dec 09 '22 00:12 chrish987

👉🏻 https://github.com/zwave-js/node-zwave-js/issues/5129

AlCalzone avatar Dec 09 '22 01:12 AlCalzone

is there any ETA on this one being looked at?

chrish987 avatar Feb 19 '23 02:02 chrish987