I'm running the Home Assistant App on my umbrel on a raspberry pi and it works great.
However, in the Home Assistant community it's pretty common to add a little USB dongle (not a storage medium) to integrate with zigbee or Z-Wave devices in your smart home. I bought the Zooz ZST10 700 and plugged it into my umbrel only to find out that the umbrel finds no USB devices except for the one external hard drive to store the blockchain on.
This is the relevant bit of code:
https://github.com/getumbrel/umbrel/blob/703a5bc9757df631255ec5bd9c9dc773a24d67d4/scripts/umbrel-os/external-storage/mount#L66-L83
It attempts to unbind the external hard drive from the uas
driver and binds it again with the usb-storage
driver. That part actually does make sense cause I've tried to run umbrel with the hard drive bound with the uas
driver and the entire raspberry pi is unresponsive and basically unusable.
However the two lines
https://github.com/getumbrel/umbrel/blob/703a5bc9757df631255ec5bd9c9dc773a24d67d4/scripts/umbrel-os/external-storage/mount#L80-L81
actually unbind everything and for some reason only the hard drive comes back up again in the lsusb
output.
I've tried to shutdown the raspberry pi, unplug the hard drive, plug int the USB dongle and restarting it. That makes the mount
script exit early, because it doesn't find a bulk device. Then when I ssh into the raspberry pi, obviously umbrel is not running because it didn't find the hard drive, but the lsusb
output shows the USB dongle:
# lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 005: ID 10c4:ea60 Cygnal Integrated Products, Inc. CP2102/CP2109 UART Bridge Controller [CP210x family]
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
If I now plug in the hard drive, it shows up as well:
# lsusb
Bus 002 Device 003: ID 152d:0577 JMicron Technology Corp. / JMicron USA Technology Corp.
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 005: ID 10c4:ea60 Cygnal Integrated Products, Inc. CP2102/CP2109 UART Bridge Controller [CP210x family]
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
# lsusb -t
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 5000M
|__ Port 2: Dev 2, If 0, Class=Mass Storage, Driver=uas, 5000M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/1p, 480M
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
|__ Port 3: Dev 3, If 0, Class=Vendor Specific Class, Driver=cp210x, 12M
Now with both, the dongle and the hard drive plugged in, I restart the umbrel, which triggers the run of the mount
script. Once restarted umbrel is running again as normal and the external hard drive is mounted on /mnt/data
. However, the dongle isn't recognized anymore. And for some resaon the VIA Labs, Inc. Hub
entry is also gone:
# lsusb
Bus 002 Device 003: ID 152d:0577 JMicron Technology Corp. / JMicron USA Technology Corp.
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
# lsusb -t
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 5000M
|__ Port 2: Dev 2, If 0, Class=Mass Storage, Driver=usb-storage, 5000M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/1p, 480M
I have experimented with this while the hard drive wasn't plugged in during startup, so that the mount script wouldn't run. I have manually executed the two lines that the mount script would execute:
echo '0000:01:00.0' > '/sys/bus/pci/drivers/xhci_hcd/unbind'
echo '0000:01:00.0' > '/sys/bus/pci/drivers/xhci_hcd/bind'
Before the VIA Labs hub, the dongle and the hard drive are all there, and after only the hard drive is there.
I figured I have two options:
- Either unbind and bind the hard drive during the mount script in a way that doesn't unbind everything, but just the hard drive.
- Leave umbrel untouched and just run my own script that binds the VIA Labs hub and the Dongle back in.
I haven't had success with either of these options. Does anyone have an idea, how umbrel could switch to the external-usb
driver while other non storage USB accessories are still usable?