0

I have a problem with a Linux/Ubuntu Desktop machine. The machine is used as a part of a larger setup (a autonomous boat) that relies on four USB-Devices. Three of them are plugged into an USB Hub and one is plugged directly into the machine.

Every time we reconnect the Device or restart the computer the devices may get a different device number. That is a big problem for us because to initialize those devices from our software we need their location.

Is there a solution from the side of the operating system to assign certain numbers to them or use a link or something to make sure they are always accessible in the same way from the software?

If there is only a programmatic solution maybe the question can be moved to stackoverflow.com

Janusz
  • 103
  • 4

2 Answers2

3

You should write udev rules that assign a persistent symlink to the device when they are connected. See this tutorial for writing udev rules for more information.

Joe
  • 1,535
  • 1
  • 10
  • 15
0

I don't know about Ubuntu, but Red Hat has a symbolic link: /dev/disk/by-label/ that points to the actual device file.

You might also want to look into udev; that can also do what you're looking to do.

Kevin M
  • 2,302
  • 1
  • 16
  • 21