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

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

[program:socatZwave]
command=/usr/bin/socat -d -d pty,link=/dev/ttyZWAVE0,raw,user=openhab,group=dialout,mode=777 tcp:192.168.178.25:3001
autorestart=true
startsecs=3
stopsignal=KILL

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.
TIA

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?

Thanks!

Anyone??

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
2 Likes

Thanks. Yeah ideally i shouldnt have to restart at all but a binding restart helps a little. I have battery devices that need a wake up if thr binding starts again or they fail to work (motion sensor)
Be keen to know what your oh2 instance does…

My Zwave devices never fail if i restart the zwave binding. Devices only go offline is a wake up event in Zwave is missed by Openhab.

So if you restart the zwave binding and a device would send an wake up event during that time… the device most likely goes offline in Openhab. This should recover once the next wake up event is received.

The above should not influence the workings of a battery operated device. motion sensors, temp sensors, door sensors… they all keep sending the on/off events and updates…

Odd. My other sensors work fine after a restart my motion one doesnt . Ill test it a but more anyway

So you’re right, a restart will place the battery device in ‘REQUEST NIF’ until it wakes up but the sensor still operates with the rules etc which is good.

Now to work out why I need to restart to fix the IO ERROR seen in the OpenHab console when socat restarts or ser2net is lost.

Can you shar your rule for doing this please?