Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hardware address of waveshare adapter after reboot #9

Open
Phi2k opened this issue Mar 26, 2024 · 1 comment
Open

Hardware address of waveshare adapter after reboot #9

Phi2k opened this issue Mar 26, 2024 · 1 comment

Comments

@Phi2k
Copy link

Phi2k commented Mar 26, 2024

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?

@Phi2k Phi2k changed the title Hardware address of wave share adapter after reboot Hardware address of waveshare adapter after reboot Mar 26, 2024
@rubenbe
Copy link
Owner

rubenbe commented Mar 27, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants