Solved Access USD Drive on another PC as /dev/cuaU0

Hello,
How can one access a Zwave gen5 USB stick on a home PC from a VPS? The stick works well with the home instance of OpenHab2. However, we prefer having the stick(gateway) identified in a VPS somewhere running OpenHab2 as the usual "/dev/cuaU0". We don't want the Openhab2 instance at home and don't want to remotely connect to it via dyndns/no-ip/etc. Understandably, it might be advisable to access the montoring system via a VPN.
 
I haven't used these things in a very long time now, but the Z-Wave stick exposes a serial interface over USB, right? If the problem is simply exposing that serial interface over the network, perhaps something like net/socat is close to what you need? Alternatively, maybe this mailing list thread might have some useful starting points?

Either way, though, I'm not sure how Openhab would react to any of this wizardry. If what it wants is to do raw writes to a file that you claim to be a serial port, then piping socat instances (file on VPS filesystem -> TCP port on VPS -> TCP port on home PC -> /dev/cuaU0) might be worth trying, but it's a long shot. I'd try it and see where it fails, at least. The security of this approach is also close to non-existent, but if it works, it's probably a decent base to start building on.

Also, it sounds like you will need a way to reliably get to the home PC, too. If you don't want to use a dynamic DNS service, I think a VPN-based approach is the only reasonably straightforward option.

But why not run OpenHab on the home PC? Is this not an option for deployment, or do you have other concerns about it?

(Legit question; I never used OpenHab, in fact I had to google to figure out what it is; I just wrote Z-Wave related software a very long time ago...)
 
Thanks adunr for your contributions. Socat has always been on my mind. And there are a few other options - e.g. USB-to_IP and Samba. And the standard approach is always to have a gateway [i.e. an embedded system] at the premises. There is no one existing solution to above scenario than to make a custom solution.

W.r.t. why I don't want to run an instance of it at home, it is just a matter of choice. In a case that I want to replicate the system for other users, I reckon a system easily accessible on the Internet will win. And that is what all makers of smart home systems are doing with their gateways.

Interestingly, my question reveals a lot of information about my level of proficiency in the use of the Internet & its technologies/protocols. For some people, every PC hooked to the Internet is already accessible to the private ORGs & the public ( and if one is worried about security, they could consider the measures mentioned above - VPN, DMZ, etc). And for others, their home PCs, phones and other Internet-aware devices are, in their minds, to be protected from the menace on the Internet.
 
No matter how you do this; the usb stick will need to be connected to a local computer of some kind, and this local computer has to be reachable from the Internet (so that your OpenHAB instance on the VPS can reach it).
One way to do this is to use MQTT. I haven't used OpenHAB, but it looks like it supports MQTT client via MQTT Binding. This means that you must install an MQTT server (= "MQTT broker") somewhere, configure OpenHAB for that, and configure the local computer with the usb stick so that it also connects to the MQTT broker for sending and receiving of Z-wave commands and data.
 
Thanks tingo for your input. I have found an alternative approach. It is using the Openhab Cloud connector. I cannot but run the home instance of Openhab2. I however now need to try come up with a custom solution with the above pointers.
 
Back
Top