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

Given I never got it to work the answer is unfortunately no. I’m not current exposing anything to the outside Internet directly so my need for LetsEnrypt certs has gone away. I’ve bee using OpenVPN to connect to everything instead.

I am running openHAB in a docker container, with certificates from letsEncrypt. The certificates are picked up from the /userdata/etc/keystore file, which I have mounted from outside the container (using the -v option). As such, I didn’t need to get the certificates into the container.

I am looking for the same result with docker. Did you figured it out ? I consider running a service in the docker container but Systemd is a pain to run within a container at least for me. Or with supervisord like suggested in … I am still trying…

Sadly, no I was not able to “solve” it with a general solution to the problem. I found another guy on the docker forums, but he also told me he couldn’t solve it.
For a while I always manually started socat after running the container (really bad solution). The way I “solved” it was to ask the maintainer of the binding to allow tcp connections to the bridge and not just serial connections. Luckily he was super helpful and implemented it in no time flat.
Now I can just add the bridge via an IP address and port and not worry about starting socat at all.
If you are trying to do this for z-wave, I guess opening a ticket for TCP support could be a way to handle this.
Good luck!

Thanks for your answer I will check it. But I needed to do it with Bluetooth as well. For now I just made socat and openhab 2.3.0 amd64 Debian with my own image and supervisord but could not find a Bluetooth binding working with it.

But for zwave I will definitely consider your solution too.

Hey, with the docker image I shared in the previous message and adding some options for the supervisord configurations:

command=/usr/bin/socat -d -d pty,link=/dev/ttyZWAVE0,raw,user=openhab,group=dialout,mode=777 tcp:

I get similar error than you and @Matt77 when socat restart I guess. A soft reset on the zwave bridge brings all back to normal. Do you know what do I miss to make it works ?

Do I need to implement a script like there: Z wave - can openhab control a remote (Rasp Pi) z wave stick

For your information I install fresh installation on my raspberry pi and it is now some hours up without trouble. Let’s see how it is going…

I just had to reboot the VM with OH2 and it looks like le socat did not start on its own.
Anyone can give me advice what is the The Right Way to make it autostart on Ubuntu 16.04 and to do it preferably before the OH2 starts.

As I started it manually I still needed to restart OH2 to make zwave work properly.

For anyone trying to do this using the RFXTRX USB dongle then the settings are like this:

1001:raw:0:/dev/ttyRFXtrx433:38400 NONE 1STOPBIT 8DATABITS

Has anyone done this successfully with a Aeotec Zwave USB Stick Gen6?

I have a Vero 4K Media player which has 2 x USB2.0 ports - it would be perfect I suspect as it already runs debian.

Can’t answer you question wether it work or not but why not just try it out and report back if you were succesfull?

Here’s another topic if socat/ser2net won’t work for you.

1 Like

Thanks, im going to try and extend the Zwave first and see how that goes. Failing that, ill try a second stick and report back!

Hi All

I got this working fine, so i thought id test it by restarting the device that shares the USB and I had to restart everything to get it to work again.
Can someone help me to define where I add restart=always? or help me to ensure that it reconnects upon either OH2 restarting or the host serving the USB?



the restart alway should be located in the socat@.cof. See the other thread where the configuration is more in one article Forwarding of serial ans USB ports …

It is.

The issue is that OH2 has IO errors when it restarts, forcing the restart of OH2.

Hasnt anyone experienced this?

could you post the errors? i do not experiance any problems

It was in the other thread. But this happens when socat restarts. Only way to fix is restart OH2 which isnt ideal

06:44:40.562 [ERROR] [ding.zwave.handler.ZWaveSerialHandler] - Got I/O exception                                                        Input/output error in writeArray during sending. exiting thread.
06:44:42.571 [ERROR] [ding.zwave.handler.ZWaveSerialHandler] - Got I/O exception                                                        Input/output error in writeArray during sending. exiting thread.
06:44:54.572 [ERROR] [ding.zwave.handler.ZWaveSerialHandler] - Got I/O exception                                                        Input/output error in writeArray during sending. exiting thread.
06:44:56.579 [ERROR] [ding.zwave.handler.ZWaveSerialHandler] - Got I/O exception                                                        Input/output error in writeArray during sending. exiting thread.
06:45:08.580 [ERROR] [ding.zwave.handler.ZWaveSerialHandler] - Got I/O exception                                                        Input/output error in writeArray during sending. exiting thread.
06:45:10.490 [INFO ] [smarthome.event.ItemStateChangedEvent] - OpenHAB_Cpu_Load1                                                        changed from 0.1 to 0.3
06:45:10.497 [INFO ] [smarthome.event.ItemStateChangedEvent] - OpenHAB_Cpu_Load5                                                        changed from 0.2 to 0.3
06:45:10.502 [INFO ] [smarthome.event.ItemStateChangedEvent] - OpenHAB_Sensors_C                                                       puTemperature changed from 30.0 to 29.0
06:45:10.507 [INFO ] [smarthome.event.ItemStateChangedEvent] - OpenHAB_Cpu_Load                                                        changed from 2.6 to 2.4
06:45:10.589 [ERROR] [ding.zwave.handler.ZWaveSerialHandler] - Got I/O exception          

Just a quick reply as i’m currently at work, but it should suffice to just restart the Zwave binding instead of Openhab.

I would have to check tonight to be absolutely sure but in my install i can restart the the remote Z-wave node without running into issues in Openhab at all. It does depend on the time it takes to restart though.

Yes, a restart of the Zwave binding does the job, no need to restart OH. I have implemented a command with Exec binding to automate this by logging in to Karaf console and then execute

bundle:restart org.openhab.binding.zwave