1x Pi, 2x Printer, 2x Webcam

Hello friends,

my Name is Stefan, i am coming from Germany/Bavaria. Sorry for my bad English.

I built an Octoprint Dual Cube with 4x CH Relais. My first Octoprint Cube works with 1x Pi4 and 2x Octoprint Server and 2x Webcam!
now I'm building a new one and have the following problem:
I would like to permanently assign the USB regardless of what a webcam or printer is connected to.
USB 3.0 1 = printer 1
USB 3.0 2 = printer 2
USB 2.0 3 = CAM 1
USB 2.0 4 = CAM 2

at the moment I have it like that and that's crap because it only works for this hardware

SUBSYSTEM=="tty", ATTRS{idVendor}=="1d50", ATTRS{idProduct}=="602", ATTRS{devpath}=="1.2", SYMLINK+="Drucker1"

SUBSYSTEM=="tty", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", ATTRS{devpath}=="1.1", SYMLINK+="Drucker2"

SUBSYSTEM=="video4linux", ATTRS{idVendor}=="045e", ATTRS{idProduct}=="076f", ATTR{index}=="0", ATTRS{devpath}=="1.4", SYMLINK+="CAM1"

SUBSYSTEM=="video4linux", ATTRS{idVendor}=="045e", ATTRS{idProduct}=="076f", ATTR{index}=="0", ATTRS{devpath}=="1.3", SYMLINK+="CAM2"

and sorry. i'm more of the designer than the programmer! I hope someone can help me because the cube turned out to be really great.

Pictures you can find here: Octoprint Cube Dual – 1xPi, 2x Drucker, 2x CAMs – Forum – drucktipps3d.de

Hallo Stefan,

congrats to the case and from what I can see you've come pretty close to completing the project. Hope I can find it on thingiverse once you upload it.

For that sort of more generic rule that you wan't you may need an udev artist of sorts and I guess your chances of finding those talents are better on raspberrypi.org/forums or stackexchange
I might be completely off and the next poster has exactly what you need but still, searching those places may be worth the effort.

Good luck and make sure to post the links to github and t-verse once you've reached the stage.

I find it much easier to user serial numbers if your device(s) have them. You can use the printer_udev.sh from my octoprint_deploy repository (GitHub - paukstelis/octoprint_deploy: Bash script for rapid deployment of multiple octoprint instance on a single machine) to generate automatic udev rules. If your printer doesn't have a serial number, it will use the USB physical address.

If all you want is to setup udev rules so that a printer plugged into the same physical USB port is always named 'Drucker1' and a camera in the same port is always 'CAM1', and so on, you really only need the ATTRS{devpath}=="N.N" bit.

This is the opposite of what most people are going for, so it may be a bit confusing at first.

For example, based on your examples, your first printer would be:
SUBSYSTEM=="tty",ATTRS{devpath}=="1.2",SYMLINK+="Drucker1"

And the first camera:
SUBSYSTEM=="video4linux",ATTR{index}=="0",ATTRS{devpath}=="1.4",SYMPATH+="CAM1"

2 Likes

And the first camera:
SUBSYSTEM=="video4linux",ATTR{index}=="0",ATTRS{devpath}=="1.4",SYM*PATH*+="CAM1"

!!! SYMLINK+="CAM1 !!!

so it works! Thank You :slight_smile:

Oops, that is indeed a typo. Glad you figured that out and it worked, though.