So this isn’t exactly a standard issue but I figured I’d post here and see if anyone has thoughts.
Background:
After my 3rd dead SD card I’ve been starting to lay the groundwork for migrating from the Pi to a VM using Docker (not Hass.io). I’ve made some decent progress overall (excluding LetsEncrypt, that shit is a pain) but have hit a stopping point with Z-Wave. My host system doesn’t pass through USB all that well so I’ve decided to give USB over IP a shot using ser2net and socat, leaving the Z-stick in my Pi for now. (Guide here is for openhab, but a lot of the steps translate well. https://community.openhab.org/t/share-z-wave-dongle-over-ip-usb-over-ip-using-ser2net-socat-guide/34895/14 )
I’ve actually made some decent progress. On the Pi I have ser2net running and serving up ttyACM0 over port 3333. On the VM itself I have socat running and connecting just fine. Here is the socat.log:
2018/03/23 11:01:14 socat[63841] I setting option "group" to 1001
2018/03/23 11:01:14 socat[63841] I setting option "perm" to 511
2018/03/23 11:01:14 socat[63841] I openpty({6}, {7}, {"/dev/pts/1"},,) -> 0
2018/03/23 11:01:14 socat[63841] N PTY is /dev/pts/1
2018/03/23 11:01:14 socat[63841] N opening connection to AF=2 192.168.1.5:3333
2018/03/23 11:01:14 socat[63841] I starting connect loop
2018/03/23 11:01:14 socat[63841] I socket(2, 1, 6) -> 8
2018/03/23 11:01:14 socat[63841] N successfully connected from local address AF=2 192.168.1.18:50776
2018/03/23 11:01:14 socat[63841] I resolved and opened all sock addresses
2018/03/23 11:01:14 socat[63841] N starting data transfer loop with FDs [6,6] and [8,8]
And ls /dev/tty* output:
tino@ubuntu:~$ ls /dev/tty*
/dev/tty /dev/tty17 /dev/tty26 /dev/tty35 /dev/tty44 /dev/tty53 /dev/tty62 /dev/ttyS12 /dev/ttyS21 /dev/ttyS30
/dev/tty0 /dev/tty18 /dev/tty27 /dev/tty36 /dev/tty45 /dev/tty54 /dev/tty63 /dev/ttyS13 /dev/ttyS22 /dev/ttyS31
/dev/tty1 /dev/tty19 /dev/tty28 /dev/tty37 /dev/tty46 /dev/tty55 /dev/tty7 /dev/ttyS14 /dev/ttyS23 /dev/ttyS4
/dev/tty10 /dev/tty2 /dev/tty29 /dev/tty38 /dev/tty47 /dev/tty56 /dev/tty8 /dev/ttyS15 /dev/ttyS24 /dev/ttyS5
/dev/tty11 /dev/tty20 /dev/tty3 /dev/tty39 /dev/tty48 /dev/tty57 /dev/tty9 /dev/ttyS16 /dev/ttyS25 /dev/ttyS6
/dev/tty12 /dev/tty21 /dev/tty30 /dev/tty4 /dev/tty49 /dev/tty58 /dev/ttyprintk /dev/ttyS17 /dev/ttyS26 /dev/ttyS7
/dev/tty13 /dev/tty22 /dev/tty31 /dev/tty40 /dev/tty5 /dev/tty59 /dev/ttyS0 /dev/ttyS18 /dev/ttyS27 /dev/ttyS8
/dev/tty14 /dev/tty23 /dev/tty32 /dev/tty41 /dev/tty50 /dev/tty6 /dev/ttyS1 /dev/ttyS19 /dev/ttyS28 /dev/ttyS9
/dev/tty15 /dev/tty24 /dev/tty33 /dev/tty42 /dev/tty51 /dev/tty60 /dev/ttyS10 /dev/ttyS2 /dev/ttyS29 /dev/ttyUSB0
/dev/tty16 /dev/tty25 /dev/tty34 /dev/tty43 /dev/tty52 /dev/tty61 /dev/ttyS11 /dev/ttyS20 /dev/ttyS3
tino@ubuntu:~$
What the copy-paste doesn’t show is that it creates /dev/ttyUSB0 as a symbolic link pointing to /dev/pts/1 .
Here is the relevant portion of my docker-compose file:
homeassistant:
container_name: home-assistant
restart: unless-stopped
image: homeassistant/home-assistant
depends_on:
- "influxdb"
volumes:
- /srv/docker/hass-config:/config
- /etc/localtime:/etc/localtime:ro
devices:
- /dev/ttyUSB0:/dev/ttyUSB0
network_mode: host
privileged: true
However, once everything is up and running I go into the home-assistant container and run ls /dev/tty* I don’t get any USB devices listed.
So, folks that are smarter/more experienced than me with this, am I doing something obviously wrong?