Share Z-wave dongle over IP (USB over IP using ser2net / socat ) guide

Ill get the Zensys tool tomorrow, but without resolution of the errors Ive posted above relating to the controller functioning only, I doubt much will work.

So please why do you not just connect ONLY your second controller to OH for testing, After this step you will know for sure if the second controller works and has nodes inlcuded.

1 Like

Ive connected the controller to the PC but before i did, i factory reset a node (Aeotec dimmer) and the Aeotec Zstick.

Now I see this.

I plugged the stick back in and it just crashed the whole server, it automatically reset.

Ive reset the server, connected it again and nothing shows up under PaperUI inbox with the controller but the server sees it as ACM0


kris@openhab2:~$ ls /dev/tty*
/dev/tty    /dev/tty23  /dev/tty39  /dev/tty54      /dev/ttyS1   /dev/ttyS25
/dev/tty0   /dev/tty24  /dev/tty4   /dev/tty55      /dev/ttyS10  /dev/ttyS26
/dev/tty1   /dev/tty25  /dev/tty40  /dev/tty56      /dev/ttyS11  /dev/ttyS27
/dev/tty10  /dev/tty26  /dev/tty41  /dev/tty57      /dev/ttyS12  /dev/ttyS28
/dev/tty11  /dev/tty27  /dev/tty42  /dev/tty58      /dev/ttyS13  /dev/ttyS29
/dev/tty12  /dev/tty28  /dev/tty43  /dev/tty59      /dev/ttyS14  /dev/ttyS3
/dev/tty13  /dev/tty29  /dev/tty44  /dev/tty6       /dev/ttyS15  /dev/ttyS30
/dev/tty14  /dev/tty3   /dev/tty45  /dev/tty60      /dev/ttyS16  /dev/ttyS31
/dev/tty15  /dev/tty30  /dev/tty46  /dev/tty61      /dev/ttyS17  /dev/ttyS4
/dev/tty16  /dev/tty31  /dev/tty47  /dev/tty62      /dev/ttyS18  /dev/ttyS5
/dev/tty17  /dev/tty32  /dev/tty48  /dev/tty63      /dev/ttyS19  /dev/ttyS6
/dev/tty18  /dev/tty33  /dev/tty49  /dev/tty7       /dev/ttyS2   /dev/ttyS7
/dev/tty19  /dev/tty34  /dev/tty5   /dev/tty8       /dev/ttyS20  /dev/ttyS8
/dev/tty2   /dev/tty35  /dev/tty50  /dev/tty9       /dev/ttyS21  /dev/ttyS9
/dev/tty20  /dev/tty36  /dev/tty51  /dev/ttyACM0    /dev/ttyS22  /dev/ttyUSB0
/dev/tty21  /dev/tty37  /dev/tty52  /dev/ttyprintk  /dev/ttyS23
/dev/tty22  /dev/tty38  /dev/tty53  /dev/ttyS0      /dev/ttyS24

So did you add the stick manually in PaperUI or Habmin? A Z-Wave controller stick is never detected automatically but needs to be added manually and you have to specify the Com Port of the controller in the thing definition. After that your node 2 should be discovered automatically.

I will connect the stick again and try to add it manually and change the COM port. I’ve done this in the past but its failed to find the nodes. Ill try again.

Gave this a shot, worked fine, except any network disconnect requires restarting the zwave binding:

[ERROR] [ding.zwave.handler.ZWaveSerialHandler] - Got I/O exception Input/output error in writeArray during sending. exiting thread.

Tried the usbip method instead (needed to install linux-tools-raspi2 or linux-tools-generic, depending on architecture). Interesting to note, that this generates a lot of smaller network packets, versus the larger ones for just the serial commands. The ser2net/socat appears to be more efficient. May matter to some if using wifi or whatnot. I use a zwave/zigbee combo stick (two serial ports), though, so I think the usbip flavor is more straightforward for me, as well as configuration like baud rate and flow control remaining on the openhab machine.

However, moved the Pi that is hosting the USB stick, and it still barfed out the I/O errors until restarting zwave. That’s a separate issue I’ll try to address in another thread. Mainly wanted to share my feedback on the usbip alternative method.

Yep I get the same issue, IO errors and it does not automatically reconnect which means restarting the Zwave binding. Highly frustrating :frowning:
It appears that OH2 has been updated to allow for a remote serial connection but the binding needs to be updated to allow for this. @chris knows about it but has alot of work on.

Have you found a work around?

Hi Kevin,
Do you mean to say that the current z wave 2.4 binding does not yet support the usbip method fully?
Can you share exactly which version of linux tools raspi2 /generic u use for the usbip method? which raspbian version is the usb zwave/zigbee combo stick raspberry pi on? is a rpi3?

As soon as the ZWave binding is updated to support remote COM ports life will be alot easier

Hi Danny

Has anyone work begun on this? that is implementing the ESH serial driver inside the ZWave Binding??

Regards
Kris

The binding just doesn’t tolerate the /dev/ttyUSB0 etc going away. It seems to not attempt to reopen the device when it comes back. It works just fine as long as the link to the remote usb stays good. Same issue for usbip or socat method.

For those on Windows, I created this back then to bridge an alarm decoder USB (COM port) through TCP.

What exactly is the functionality of your solution? I am using OH on Windows and use a lot of USB connections over TCP/IP, at the moment based on dedicated hardware from Silex. How would your solution look like? Is it software for the client or the USB device server? Sorry for this maybe silly question but I cannot really follow the documentation you provide on GitHub. Thank you for your help!

It allows you to share a USB (COM port) over tcp/ip. Basically the host where the USB is becomes a server. Clients can connect to it via tcp and interact with that COM port (USB, etc). It is software based so you don’t need to purchase anything extra. It’s basically what ser2sock/ser2net does but it’s for Windows. A lot of Windows users from AlarmDecoder is using this and this is the preferred solution as AlarmDecoder recommends their Windows users to use my code: https://github.com/nutechsoftware/ser2sock

Thank you very much for clarifying! So i Install the software on the host/server and the client? Both need to be Windows machines? And I can use it for any kind of USB-Stick (e.g. Z-Wave, Zigbee, Bluetooth etc.? )

Hi

I used the tutorial in the first post to connect to an alarm system wirelessly via serial and it all works well. The only issue I am having is getting live updates.

When connected via direct serial connection, openHAB is instantly aware of any updates the alarm system gives, ie door open, zone tripped etc.

Using this method, while openHAB can interface with the alarm it no longer receives instant updates regarding doors and zones etc.

Is there anything I can configure in ser2net or socat to start passing through the live data?

Hope that makes sense,

Thanks

Would be helpful if you mention what alarm system you have. I use Vista20P and exposed it to OH via TCP/AlarmDecoder. An orange pi is connected to the panel through its rs232 terminals.

Hi

Sorry it is a PowerMax+ alarm, currently connected to a pi2 via a usb serial adapter (cp2102).

Edit: should also mention that I am using the PowerMax binding to interface with OH2.

Thanks

Hey Chris! great job, I am really very impressive from your answer. I have also problem into hp accelerometer windows 10 could you solve this problem.

Waiting for this, too. 'Cause I run OpenHAB inside a LXC running inside a proxmox cluster, I use the ser2net/socat variant. As such I’m plagued of this disconnect problem as well.

Funny enough, my RFLink binding is not showing any problem even though it sees those rare disconnects, too. Wouldn’t it be easier to just implement a tiny watchdog inside the binding as it’s done in the RFLink?