Problems with udev rules

Posted on
  • Hello,

    I'm using the udev rules from here .
    However, the group of /dev/ttyACM0 is not changed to pludev neither are the permissions changed.

    udevadm test /dev/ttyACM0 gives the following:

    [root@herrod ~]# udevadm test /dev/ttyACM0 
    calling: test
    version 231
    This program is for debugging only, it does not run any program
    specified by a RUN key. It may show incorrect results, because
    some values may be different, or not available at a simulation run.
    
    === trie on-disk ===
    tool version:          231
    file size:         7291171 bytes
    header size             80 bytes
    strings            1819099 bytes
    nodes              5471992 bytes
    Load module index
    Found container virtualization none
    timestamp of '/etc/systemd/network' changed
    timestamp of '/usr/lib/systemd/network' changed
    Parsed configuration file /usr/lib/systemd/network/99-default.link­
    Created link configuration context.
    timestamp of '/etc/udev/rules.d' changed
    timestamp of '/usr/lib/udev/rules.d' changed
    Reading rules file: /usr/lib/udev/rules.d/40-usb-media-playe­rs.rules
    Reading rules file: /etc/udev/rules.d/45-espruino.rules
    Reading rules file: /usr/lib/udev/rules.d/49-sane.rules
    rules contain 393216 bytes tokens (32768 * 12 bytes), 32238 bytes strings
    25863 strings (208413 bytes), 22554 de-duplicated (179485 bytes), 3310 trie nodes used
    unable to open device '/sys/dev/ttyACM0'
    Unload module index
    Unloaded link configuration context.
    

    I'm using Arch Linux.
    Any idea why the group is not set?

  • Does arch linux have a plugdev group?

    Maybe you could try restarting? It might be that the rules need reloading... I realise it's not in the Quick Start, but you can do udevadm control --reload-rules to force a reload without restarting.

  • Yes, the group pludev is available and I also use it for another device. Reboot and reload rules doesn't change anything. It seems that the rule is not triggered at all.

    Maybe this is of help, /dev/ttyACM0 does not have productID nor vendorID. It is available one level below.

    udevadm info -a -p $(udevadm info -q path -n /dev/ttyACM0)        
    
    Udevadm info starts with the device specified by the devpath and then
    walks up the chain of parent devices. It prints for every device
    found, all possible attributes in the udev rules key format.
    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/pci0000:00/0000:00:14.0/usb3/3­-2/3-2:1.0/tty/ttyACM0':
        KERNEL=="ttyACM0"
        SUBSYSTEM=="tty"
        DRIVER==""
    
      looking at parent device '/devices/pci0000:00/0000:00:14.0/usb3/3­-2/3-2:1.0':
        KERNELS=="3-2:1.0"
        SUBSYSTEMS=="usb"
        DRIVERS=="cdc_acm"
        ATTRS{authorized}=="1"
        ATTRS{bAlternateSetting}==" 0"
        ATTRS{bInterfaceClass}=="02"
        ATTRS{bInterfaceNumber}=="00"
        ATTRS{bInterfaceProtocol}=="01"
        ATTRS{bInterfaceSubClass}=="02"
        ATTRS{bNumEndpoints}=="01"
        ATTRS{bmCapabilities}=="2"
        ATTRS{supports_autosuspend}=="1"
    
      looking at parent device '/devices/pci0000:00/0000:00:14.0/usb3/3­-2':
        KERNELS=="3-2"
        SUBSYSTEMS=="usb"
        DRIVERS=="usb"
        ATTRS{authorized}=="1"
        ATTRS{avoid_reset_quirk}=="0"
        ATTRS{bConfigurationValue}=="1"
        ATTRS{bDeviceClass}=="02"
        ATTRS{bDeviceProtocol}=="00"
        ATTRS{bDeviceSubClass}=="00"
        ATTRS{bMaxPacketSize0}=="64"
        ATTRS{bMaxPower}=="100mA"
        ATTRS{bNumConfigurations}=="1"
        ATTRS{bNumInterfaces}==" 2"
        ATTRS{bcdDevice}=="0200"
        ATTRS{bmAttributes}=="c0"
        ATTRS{busnum}=="3"
        ATTRS{configuration}==""
        ATTRS{devnum}=="4"
        ATTRS{devpath}=="2"
        ATTRS{idProduct}=="5740"
        ATTRS{idVendor}=="0483"
        ATTRS{ltm_capable}=="no"
        ATTRS{manufacturer}=="STMicroelectronics­"
        ATTRS{maxchild}=="0"
        ATTRS{product}=="STM32 Virtual ComPort"
        ATTRS{quirks}=="0x0"
        ATTRS{removable}=="removable"
        ATTRS{serial}=="00000000001A"
        ATTRS{speed}=="12"
        ATTRS{urbnum}=="211"
        ATTRS{version}==" 2.00"
    ...
    
  • Even the following rule is not working:

    KERNEL=="ttyACM0*", MODE="0666", GROUP="plugdev"
    
  • It might actually be worth looking at what they suggest for Arduino: https://wiki.archlinux.org/index.php/Ard­uino

    Looks like adding your user to uucp and lock groups might be enough, without needing any udev

  • It's just that easy :-) Thanks.

  • Thanks for letting me know - I'll update the Quick Start guide

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Problems with udev rules

Posted by Avatar for avanc @avanc

Actions