Udev USB rules not taking effect

What is the problem?
So, I'm following along with this tutorial, and for some reason I cannot get the udev rules to work.

What did you already try to solve it?

  • Adding various things to each line int he udev rules
  • Looking at the results of the 'diff' command, and adding more and more things to each line

Additional information about your setup (OctoPrint version, OctoPi version, printer, firmware, octoprint.log, serial.log or output on terminal tab, ...)

Here are my device differences.

--- devInfoUSU0 2018-11-04 00:46:29.022765830 -0400
+++ devInfoUSU1 2018-11-04 00:46:37.423037462 -0400
@@ -5,61 +5,95 @@
 A rule to match, can be composed by the attributes of the device
 and the attributes from one single parent device.

-  looking at device '/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.2/1-1.2:1$
-    KERNEL=="ttyUSB0"
+  looking at device '/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.1/1-1.1.2$
+    KERNEL=="ttyUSB1"
     SUBSYSTEM=="tty"
     DRIVER==""

-  looking at parent device '/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.2/$
-    KERNELS=="ttyUSB0"
+  looking at parent device '/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.1/$
+    KERNELS=="ttyUSB1"
     SUBSYSTEMS=="usb-serial"
-    DRIVERS=="ch341-uart"
+    DRIVERS=="ftdi_sio"
+    ATTRS{latency_timer}=="16"
     ATTRS{port_number}=="0"

-  looking at parent device '/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.2/$
-    KERNELS=="1-1.2:1.0"
+  looking at parent device '/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.1/$
+    KERNELS=="1-1.1.2:1.0"
     SUBSYSTEMS=="usb"
-    DRIVERS=="ch341"
+    DRIVERS=="ftdi_sio"
     ATTRS{authorized}=="1"
     ATTRS{bAlternateSetting}==" 0"
     ATTRS{bInterfaceClass}=="ff"
     ATTRS{bInterfaceNumber}=="00"
-    ATTRS{bInterfaceProtocol}=="02"
-    ATTRS{bInterfaceSubClass}=="01"
-    ATTRS{bNumEndpoints}=="03"
+    ATTRS{bInterfaceProtocol}=="ff"
+    ATTRS{bInterfaceSubClass}=="ff"
+    ATTRS{bNumEndpoints}=="02"
+    ATTRS{interface}=="FT232R USB UART"
     ATTRS{supports_autosuspend}=="1"

-  looking at parent device '/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.2':
-    KERNELS=="1-1.2"
+  looking at parent device '/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.1/$
+    KERNELS=="1-1.1.2"
     SUBSYSTEMS=="usb"
     DRIVERS=="usb"
     ATTRS{authorized}=="1"
     ATTRS{avoid_reset_quirk}=="0"
     ATTRS{bConfigurationValue}=="1"
-    ATTRS{bDeviceClass}=="ff"
+    ATTRS{bDeviceClass}=="00"
     ATTRS{bDeviceProtocol}=="00"
     ATTRS{bDeviceSubClass}=="00"
     ATTRS{bMaxPacketSize0}=="8"
-    ATTRS{bMaxPower}=="96mA"
+    ATTRS{bMaxPower}=="90mA"
     ATTRS{bNumConfigurations}=="1"
     ATTRS{bNumInterfaces}==" 1"
-    ATTRS{bcdDevice}=="0254"
-    ATTRS{bmAttributes}=="80"
+    ATTRS{bcdDevice}=="0600"
+    ATTRS{bmAttributes}=="a0"
     ATTRS{busnum}=="1"
     ATTRS{configuration}==""
-    ATTRS{devnum}=="4"
-    ATTRS{devpath}=="1.2"
+    ATTRS{devnum}=="5"
+    ATTRS{devpath}=="1.1.2"
     ATTRS{devspec}=="  (null)"
-    ATTRS{idProduct}=="7523"
-    ATTRS{idVendor}=="1a86"
+    ATTRS{idProduct}=="6001"
+    ATTRS{idVendor}=="0403"
     ATTRS{ltm_capable}=="no"
+    ATTRS{manufacturer}=="FTDI"
     ATTRS{maxchild}=="0"
-    ATTRS{product}=="USB2.0-Serial"
+    ATTRS{product}=="FT232R USB UART"
     ATTRS{quirks}=="0x0"
     ATTRS{removable}=="removable"
+    ATTRS{serial}=="AK065FIZ"
     ATTRS{speed}=="12"
-    ATTRS{urbnum}=="14"
-    ATTRS{version}==" 1.10"
+    ATTRS{urbnum}=="1957326"
+    ATTRS{version}==" 2.00"
+
+  looking at parent device '/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.1':
+    KERNELS=="1-1.1"
+    SUBSYSTEMS=="usb"
+    DRIVERS=="usb"
+    ATTRS{authorized}=="1"
+    ATTRS{avoid_reset_quirk}=="0"
+    ATTRS{bConfigurationValue}=="1"
+    ATTRS{bDeviceClass}=="09"
+    ATTRS{bDeviceProtocol}=="02"
+    ATTRS{bDeviceSubClass}=="00"
+    ATTRS{bMaxPacketSize0}=="64"
+    ATTRS{bMaxPower}=="2mA"
+    ATTRS{bNumConfigurations}=="1"
+    ATTRS{bNumInterfaces}==" 1"
+    ATTRS{bcdDevice}=="0bb3"
+    ATTRS{bmAttributes}=="e0"
+    ATTRS{busnum}=="1"
+    ATTRS{configuration}==""
+    ATTRS{devnum}=="3"
+    ATTRS{devpath}=="1.1"
+    ATTRS{idProduct}=="2514"
+    ATTRS{idVendor}=="0424"
+    ATTRS{ltm_capable}=="no"
+    ATTRS{maxchild}=="3"
+    ATTRS{quirks}=="0x0"
+    ATTRS{removable}=="fixed"
+    ATTRS{speed}=="480"
+    ATTRS{urbnum}=="60"
+    ATTRS{version}==" 2.00"

   looking at parent device '/devices/platform/soc/3f980000.usb/usb1/1-1':
     KERNELS=="1-1"
@@ -155,7 +189,7 @@
     ATTRS{inv_sel_hsic}=="Invert Select HSIC = 0x0"
     ATTRS{mode}=="Mode = 0x1"
     ATTRS{mode_ch_tim_en}=="Mode Change Ready Timer Enable = 0x0"
-    ATTRS{rd_reg_test}=="Time to read GNPTXFSIZ reg 10000000 times: 920 msecs (92 jiffies)"
+    ATTRS{rd_reg_test}=="Time to read GNPTXFSIZ reg 10000000 times: 870 msecs (87 jiffies)"
     ATTRS{regdump}=="Register Dump"
     ATTRS{regoffset}=="0xffffffff"
     ATTRS{regvalue}=="invalid offset"

Here is my udev 99-usb.rules:

SUBSYSTEM=="tty", DRIVERS=="ch341-uart", ATTRS{interface}=="FT232R USB UART", ATTRS{product}=="FT232R USB UART", SYMLINK+="ttySTARTT"
SUBSYSTEM=="tty", DRIVERS=="ftdi_sio",  ATTRS{product}=="USB2.0-Serial", SYMLINK+="ttyEnder3"

Hi! Did you ever figure this out? I am having the exact same issue trying to run two printers off one Pi.

Hi, I know this is super old, but, for anyone else who stumbles across this - create the rules in a new file /etc/udev/rules.d/10-local.rules. As soon as I did this, using only the {serial} identifier on my two machines, it worked.

2 Likes

Hi just had the same problem on my octroprint installation
added and checked the lines below rebooted but the new devices do not show up in /dev!

I have multiple instances but the entries in the
sudo nano /etc/udev/rules.d/99-usb.rules:
SUBSYSTEM=="tty", ATTRS(idVendor)=="1a86", ATTRS(idProduct)=="7523", SYMLINK+="TTS600"
SUBSYSTEM=="tty", ATTRS(idVendor)=="0403", ATTRS(idProduct)=="6015", SYMLINK+="MosaicPalette2+"
My devices do not have a valid serial so I cannot apply your work arround.
Is there nobobdy else that has the same problem and a solution?

Help highly appreciated, because for what ever reason I have to unplug my Palette and Two Trees plug in first the palette and than the printer connect the pallette and than the printer otherwise it is screwed up or both devices do not connect. (assume usb port is changing)
I have to do this every time and therefore annoying

Hey! Try creating and using /etc/udev/rules.d/10-local.rules and put your entries in the there. I found an article that said something along the lines of you want the Pi to read your reules before the defaults, and using 10-local will put it in front of the defaults ( guess 99-usb is behind them?) Try that with your subsystem entries and let us know if that works.

For what it's worth, today I just used lsusb to get the IDs from two serial devices (PyBoard and Smoothieboard), created the udev rules then to present them as:

  • /dev/smoothieboard
  • /dev/pyboard

And then in OctoPrint -> Settings I added the first one as an additional device to check. This then presents itself in the Connection side panel widget and you can now select this to auto-connect on startup. So no more conflicts when OctoPrint gets confused and tries to connect to the PyBoard.

well, it's almost an old thread, but one hint, if someone comes here.
Actually on a Pi udev reads his setup etc. from ramfs. Check this!
If your system do so, you hafe to execute
sudo update-initramfs -u
and reboot (sudo shutdown -r now) your Pi to activate changed udev rules.

1 Like

You can only refer to a single parent device.
The attribute DRIVERS=="ch341-uart"comes from a second parent and is not needed

#wrong, 2 parents refered from
#SUBSYSTEM=="tty", DRIVERS=="ch341-uart", ATTRS{interface}=="FT232R USB UART", ATTRS{product}=="FT232R USB UART", SYMLINK+="ttySTARTT"

#correct, refering to one parent, DRIVERS=="ch341-uart" comes from 2. parent, not needed
SUBSYSTEM=="tty", ATTRS{interface}=="FT232R USB UART", ATTRS{product}=="FT232R USB UART", SYMLINK+="ttySTARTT"

You take your SUBSYSTEM= from the higest branch, and the rest to correctly identify, like ATTRS{interface} or ATTRS{idVendor}from ONE other parent below.

See although stackexchange.com/questions/91629, or http://reactivated.net/writing_udev_rules.html#udevinfo