rubenbe / comfospottwin40

Control your Zehnder ComfoSpot Twin 40
MIT License
8 stars 0 forks source link

Hardware address of waveshare adapter after reboot #9

Open Phi2k opened 3 months ago

Phi2k commented 3 months ago

I run two waveshare adapters on one raspberry pi and noticed that the assignment of the device address after a reboot is random. This is unfortunate as the assigned hardware might get swapped after a reboot.

I have no fix yet but assigning persistent device names on system level might solve this: https://rolfblijleven.blogspot.com/2015/02/howto-persistent-device-names-on.html

Is there an easier way to connect to the serial adapter? e.g. by serial number instead of the device address?

rubenbe commented 3 months ago

That is tricky indeed, I use udev to rename all my serial adapters to a fixed name. But they are different brands which makes it easier. You could use the serial number or the devpath in case they are connected on two different USB hubs.

udevadm info /dev/hass-comfospot
E: ID_USB_SERIAL=FTDI_FT232R_USB_UART_AB0KNUJC
E: ID_USB_SERIAL_SHORT=AB0KNUJC
E: DEVPATH=/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/ttyUSB0/tty/ttyUSB0

You could possibly use one of the symlinks as show in udev info

E: DEVLINKS=/dev/serial/by-id/usb-FTDI_FT232R_USB_UART_AB0KNUJC-if00-port0 /dev/serial/by-path/pci-0000:00:14.0-usb-0:2:1.0-port0 /dev/hass-comfospot

In case that doesn't work:

I've been looking into this: https://www.yepkit.com/products/ykush

That might allow you to power up the adapters in a predefined order.