Instead of waiting for my Raspberry Pi 0 W I tried the setup with my existing Raspberry Pi 3. The good news is I was able to control my Z-Wave and Zigbee lights using this setup. Below are the steps that I took to create this setup. I used Google Cloud for this but I suspect that AWS or another cloud service can be used
Creating the Google Cloud Virtual Machine with openHAB
From the Google Cloud Console I created a new Virtual Machine with the following parameters:
Machine Configuration:Series N1, Machine Type f1-micro
Boot disk:Ubuntu 18.04 LTS Minimal with 30G hard drive
The rest of the settings I pretty much left was is. I did not use a static IP or any other special settings. Given this this is a f1 instance with standard settings it is covered by the always free portion of Google Cloud services
*Note I was using Ubuntu 18.04 has it had the required USB/IP library
Configuring the Virtual Machine
The first think I did with the Virtual Machine was create a swap file. This was done by executing the following commands.
sudo fallocate -l 1G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
sudo sed -i '$ a /swapfile none swap sw 0 0' /etc/fstab
With the swap file created I added this Virtual Machine to my tailscale network. Instructions can be found at tailscale download Ubuntu 18.04.
With tailscale installed I proceeded to install openhab (not openHABian) using the instruction provided on the installation page. I decided to use Zulu Java 8 and I installed it via the instructions provided by Zulu.
With everything installed and running as a service I was able to access my openhab installation via the tailscale IP access that was assigned to my Google Virtual Machine.
I did try to go a backup and restore by my openHABian configuration to my openhab-on-cloud setup but that resulted in the system hanging. I decided not to debug it and just rebuilt my setup on openhab-on-cloud.
Configuration the Raspberry Pi and Google Cloud for USB/IP
I installed the USB utilities on the Google Virtual Machine using the following command.
sudo apt-get install usbutils
After that I configured the USB/IP server (Raspberry Pi) and client (Google Cloud) using the instructions found at Setup a Raspberry Pi as a USB-over-IP server. The instructions are very straight forward and work with Ubuntu 18 (instructions will not work with Ubuntu 20). I was able to identify my Nortel USB Controller and setup a service that made it available. Using my tailscale ip addresses I was able to connect my Google Cloud Virtual Machine to my USB device. These instructions made the device look like it was attached to the Virtual Machine itself.
The Google Virtual Machine did tell me that I had to install two packages along with linux-tools-generic to get everything working. The prompt was straight forward with the names of the packages I just forgot to write them down.
You will also need to make sure that the usbip demon is running on the Raspberry Pi or else you will see connection errors on the Google Virtual Machine.
Rebuilding my openHAB configuration in the Cloud
With everything configured I rebuilt my openHAB setup on my Google Cloud Virtual Machine. I started with the basic setup like location and time and then moved on to my Z-Wave and Zigbee bindings. Finding the right ports was pretty ports was straight forward but did require some trial and error. The other setting were directly from the Z-Wave and Zigbee configurations. Rebuilding the Z-Wave network was extremely easy as that comes over from the USB stick itself. The Zigbee network had to be recreated from scratch with was not a big deal.
I did have to rebuilt the virtual machine a couple of times to get everything just right, but, once I figured everything out I was able to get this configuration working. I did trying breaking it a few times by powering on and off the Raspberry Pi and had no issues. I’m going to try and continue to break it to see what could go wrong.
Overall it wasn’t a bad rainy day project. I’ll try setup it up with the Raspberry Pi 0 W when it comes in. Let me know if you have any questions about this setup. Also interested if you have any comments.
I also installed hwdata on the cloud server. This prevented an error from being displayed when usbip was run.