I have testing equipment that is made-up of the following:
- a USB Hub connected to the master PC, the hub is embedded in the test jig and is used so that we have only 1 USB cable running from the jig to the PC.
- an Arduino UNO, connected by USB to the Hub
- a measurement instrument (powermeter) connected to the USB hub through USB
- another measurement device (thermometer) connected to the USB hub by USB
- a Python script that runs the testing procedure from the master PC and communicates to Arduino and both instruments.
All this works well with my first jig but I need now to duplicate the testing setup (3 testing jigs on one PC). I want to assign udev
persistent rules for the devices so the testers later just need to select 1, 2 or 3 depending on which jig they use, so they don't need to fiddle with the port numbers.
Is there a way to do a rule that would basically say:
assign symlink /dev/powermeter01 to the powermeter that is on the same USB hub as the Arduino with the serial xxxxxxx
?
For the Arduino, that is easy as there are proper serial numbers in the udevadm
info, but for the powermeter, the serial number is always the same and for the thermometer, there is simply no serial number (thank you cheap suppliers!!!).
The USB hub also has apparently no serial.
Best Answer
Well, this is not an answer to the question but brings me a solution. so here it is.
I fiddle quite a bit with Udev rules, could not get anything better than my Arduino persistently appear on
/dev/arduino01
(will use/dev/arduino02
,/dev/arduino03
,... for other jigs)My testing script is in Python, I just found out that there is a nice library called pyudev so I decided to have a look at this route.
After just few minutes, I ended up with
This gives me the USB ports of my 3 devices of the test jig, I can now feed it to my testing routine script.
The more savvy between us will then have seen that my temprecorder is through a pl2303 USB-serial and my powermeter through a CP2102 USB-serial.