ZWave and a virtual com port

Firstly this is almost certainly just an issue with my linux understanding!

My ZWave USB controller is plugged into a server, and it’s com port is exposed via TCP. I’m using socat to create a virtual com port on my ubuntu install, and then pointing openhab to that. However the logs show that the port does not exist.

It is mounted as /dev/pts/9, but it creates a sym link (I think) called /dev/VPort. I have changed the permissions to ensure openhab can access it (but I might have that wrong).

I can run the command “cat /dev/VPort” and I can see what looks like junk coming in every so often so I assume it’s probably working.

Any ideas?

Ok, I got this working :smiley: so happy!

The issue was the port name! It had to be named /dev/ttyUSBxx for java to be happy that it was a serial port, and I had to chown it to the correct group.

Now to actually deal with z-wave!

You can let java know about ports to use, edit the openhab startup script and add
-Dgnu.io.rxtx.SerialPorts=/dev/something:/dev/somethingelse

Thanks. TBH I’m having a lot of reliability issues with this approach. If the com port drops for any reason then openhab crashes.

I’m going to see if I can make it a little more reliable.

This is the issue I’m having If I stop the server com->tcp application (because perhaps I’m unplugging the stick to include more nodes) then on my openhab server I get this error:

2016/01/27 11:42:47 socat[46396] E connect(4, AF=2 192.168.1.10:8000, 16): Connection refused

so I stop socat, and restart it:

 socat pty,link=/dev/ttyUSB01,raw,echo=0,waitslave tcp:192.168.1.10:8000;

Then I get this error with openhab:

2016-01-27 11:43:24.649 [ERROR] [b.z.i.protocol.ZWaveController] - Serial Error: Port /dev/ttyUSB01 in use.

If I just restart openhab I get this error

2016-01-27 11:55:01.133 [ERROR] [WaveController$ZWaveSendThread] - Got I/O exception Input/output error in writeArray during sending. exiting thread.

because I need to chmod 666 /dev/ttyUSB01.

I’m so far out of my depth here! This works, but I can’t really think of a good way to automate it.

I would like to integrate nice Nodon Soft Remote and Z-Wave seems to be more promising than Enocean to me. But still, my openHAB server is running in the basement of my house and I guess the RF won’t make it down there from the 1st floor. Therefore I would like to plug a Z-Wave USB stick somewhere else in my house and “socat” the serial port over Ethernet to my openHAB server.

Is this solution stable enough to be used “in production”?

well, it works but to be honest I would just buy an extra z-wave device to put on the ground floor - they act as repeaters so it should be fine!

Thank you. Looks like a range extender would do the job. Well, I could try first with the stick and if the range is too short, I can add a repeater somewhere. I don’t have (yet) a use case besides the Soft Remote for another “fixed” Z-Wave device (I think only non-battery powered devices participate in the routing) since my KNX system is handling most of my home automation.

Don’t bother with a range extender, just buy a z-wave socket. As long as it on mains power it will act like a relay, and at least this way you get a useful thing!

Take a look at the following:

https://www.virtualhere.com/

I have been using this for 3 weeks now and am very impressed by the flexibility and more importantly stability. I have it running on a RPi 2 with an AEON z stick. Ultimately i can locate this near to all my z-wave devices.