Config query - USB by-id

Just asking in case any one can help please. I am using a m-bus reader connected from my heat meter to my Pi and my config is using dev/tty USB0. The standard config for my sdm120 also wants to use USB0, so I had to find a different one from the search bar. It worked but then had a power cut and and when everything booted back up it won’t read my sdm120. Does anyone know a work around to this please.

If it’s a *nix-based operating system, you can tie the device to a port:

You can also use the device by id method

sudo ls -la /dev/serial/by-id/

There’s a possible “gotcha” associated with that.

It works as long as the manufacturer gives every device they make a unique ID.
It’s not uncommon to find devices made in China, with the same ID.

Otherwise, the device-by-id is another viable solution.

Ref:

Hi all
Here we go I can’t copy and paste this but here is my result from

sSudo ls - la /dev/ serial/by-id/
Total 0
Drwxr-xr-x 2 root root 80 mar 5 22.17
Drwxr-xr-x 4 root root 80 mar 5 22.17
Lrwxrwxrwx 1 toot root 13 mar 5 22.17 usb-la86_USB_Single_serial_54d2042900-if00 -> ../../ttyACM0
Lrwxrwxrwx 1 root root 13 mar 5 22.17 usb- Prolific_Technology_inc._USB-serial_Controller_Eoclt114j20-if00-port0 -> ../..ttyUsb0

So do the 2 lines starting lrwx indicate the 2 usb devices and does the ttyACM0 and ttyUSB0 need to be added in the config.
Thanks
Mike

If you use (beware copy directly as it looks like the spill chocker got involved)

/dev/serial/by-id/usb-la86_USB_Single_serial_54d2042900-if00

and

/dev/serial/by-id/usb-Prolific_Technology_inc._USB-serial_Controller_Eoclt114j20-if00-port0

instead of ttyACM0 & ttyUSB0 for the device address.

Hi Brian
I have tried all combinations of these and none work, the m-bus to usb reader is the one from the shop here M-Bus to USB Converter., but this will not work unless it is ttyUSB0 and then the rs485 to usb will not read and config says cannot connect.

Did you copy the device ID directly from an SSH session (not from above)?

The tty version is just a simplified symbolic link, so no reason not to work.

Try it from the command line e.g.

python -m serial.tools.miniterm /dev/serial/by-id/usb-Silicon_Labs_xxxxxxxx 115200

Yes from SSh but did not include the end bit _> …/… ttyACM0 on either line do i need this in as well?
Thanks
Mike

Try ‘ls’ the path and check it is right e.g. (as an example)

$ ls -la /dev/serial/by-id/usb-Silicon_Labs_CP2102N_USB_to_UART_Bridge_Controller_380f3fc25587ec119d85e53719c2d21c-if00-port0
lrwxrwxrwx 1 root root 13 Feb 27 21:04 /dev/serial/by-id/usb-Silicon_Labs_CP2102N_USB_to_UART_Bridge_Controller_380f3fc25587ec119d85e53719c2d21c-if00-port0 -> ../../ttyUSB0

Then connect using miniterm (as above).

If that doesn’t work, try connecting with sudo - if that works it is a permission issue.

Brian
Can’t thank you enough, all sorted and working a treat.

1 Like