1

I have two EXACT same uvc unity cameras that have no serial number so I have abandoned mounting them via some unique attribute. Instead I specifically looking to mount it via the usb port I have plugged them into

  • Camera 1 PLUGS ONLY INTO USB Port 1
  • Camera 2 PLUGS ONLY INTO USB Port 2

I wrote the udev rule like so

SUBSYSTEM=="usb", KERNELS=="2-2.2", ATTR{idVendor}=="0000", ATTR{idProduct}=="0001", NAME="video0", MODE="0666", SYMLINK+="video0"
SUBSYSTEM=="usb", KERNELS=="2-2.3", ATTR{idVendor}=="0000", ATTR{idProduct}=="0001", NAME="video1", MODE="0666", SYMLINK+="video1"

However, this still does not work they get crossed it only depends on which device gets recognized first

test123
  • 21
  • 1
  • You could run a script by adding `RUN+="/home/username/yourscript1.sh"` on one rule and `RUN+="/home/username/yourscript2.sh"` on the other rule. – stumblebee Mar 29 '18 at 04:03
  • Sorry how does that guarantee that the camera I've plugged into port 1 will be video0 and camera plugged into port 2 will be video1? – test123 Mar 29 '18 at 19:35
  • because KERNELS=="2-2.2" and KERNELS=="2-2.3" is associated with USB port 1 and USB 2 respectively. You can run a different script for each to configure as you need. – stumblebee Mar 29 '18 at 19:46
  • Hmm, any documentation on this? Can I utilize a c executable inside that RUN parameter? Although I am still not sure this will work as I am specifically looking for video0 for port 2-2.2 in my code? – test123 Mar 29 '18 at 20:06
  • I will look up some documentation on this and post a comment. Also what version of Ubuntu are you using? – stumblebee Mar 29 '18 at 20:19
  • ubuntu 16.01 Although I am still not sure this will work as I am specifically looking for video0 for port 2-2.2 in my code? – test123 Mar 29 '18 at 21:11
  • I found [This answer](https://askubuntu.com/a/50412/767056) which shows how to distinguish between USB devices and has 2 links to guides on udev rule writing. That may work better for you rather than using RUN+ to trigger a event like I had suggested. – stumblebee Mar 29 '18 at 23:11
  • No use for `NAME` so better to create `SYMLINK` on higher number example `video10` as kernel on regular use no more than 1-2 cam's. – user.dz Apr 02 '18 at 23:51

0 Answers0