OpenZWave / Zwave2Mqtt

Fully configurable Zwave to MQTT gateway and Control Panel using NodeJS and Vue
MIT License
353 stars 93 forks source link

[question] Possibility to connect to a TCP serial #243

Closed wilmardo closed 4 years ago

wilmardo commented 4 years ago

First of all, thanks for the awesome work on this!

At this moment I am running the software in a Kubernetes cluster with the container pinned on the node where the USB is plugged in. I would love to decouple the Zwave stick from the cluster(node) to be able todo failovers of the container.

I came across this section over at Zigbee2MQTT: https://www.zigbee2mqtt.io/information/connecting_cc2530.html#via-an-esp8266

This inspired me an I ordered a Razberry Zwave module (https://z-wave.me/products/razberry/) and connected it to a esp-link flashed ESP8266 to be able to do serial over the network.

But when I tried to connect with tcp://192.168.1.10:23 as device string it would only error. So I tried searching the codebase how the serial-port library is evoked but had a hard time finding it.

Could you shine some light over this? Should this work out of the box? Is there a code adaption needed, if so where should I start to look?

Thanks for the read! ❤️

robertsLando commented 4 years ago

@wilmardo AFAIK tcp isn't supported. But maybe @Fishwaldo (Openzwave author) can help you with this :) (I'm curious too)

Fishwaldo commented 4 years ago

It wont work. OZW expects a Serial Device...

You could try configuring USB/IP on your kernel

wilmardo commented 4 years ago

@Fishwaldo Thanks for the clarification! USB/IP isn't suitable since it implements it's own protocol.

For future reference the two implementation of RFC2217 I am looking into at the moment are:

If I won't forget I will update the issue when I find on of the solutions viable :)

robertsLando commented 4 years ago

Keep us updated!

wilmardo commented 4 years ago

@robertsLando @Fishwaldo I wrote a blogpost on my progress so far since it was a long road, way to long to explain in a Github issue :) https://lansible.com/2020/03/the-adventure-to-a-remote-z-wave-usb-part-1/

TLDR: I got it somewhat working with a Z-Wave.me RaZberry and ttynvt for the connection to the ESP8266 running jeelabs/esp-link. But I am now running into dropped commands and the Z-Wave devices not switching.

2020-03-19T12:49:30.913Z z2m:Mqtt Message received on homeassistant/2/37/1/0/set
2020-03-19 12:49:32.352 Warning, Node002, WARNING: Checksum incorrect - sending NAK
2020-03-19 12:49:33.353 Warning, Node002, WARNING: Checksum incorrect - sending NAK
2020-03-19 12:49:41.276 Error, Node002, ERROR: Dropping command, expected response not received after 1 attempt(s). Command: "SwitchBinaryCmd_Get (Node=2): 0x01, 0x09, 0x00, 0x13, 0x02, 0x02, 0x25, 0x02, 0x25, 0x33, 0xd4"
2020-03-19T12:49:41.280Z z2m:Zwave Notification from node 2: Notification - TimeOut (1)

See the Hooking it up to Zwave2MQTT, second try heading for just the issues I am having now.

Does one of you have an idea how to troubleshoot this further?

Fishwaldo commented 4 years ago

WARNING: Checksum incorrect - sending NAK

The data that OZW is receiving is corrupt. So it’s still something at your CUSE/ESP level. I’d go back to validating that really is passing packets etc without drops and so on.