Skip to content

Instantly share code, notes, and snippets.

@jimwhitfield
Last active September 13, 2021 22:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jimwhitfield/c8d7b2199e700e8c0b1acf2b2141316d to your computer and use it in GitHub Desktop.
Save jimwhitfield/c8d7b2199e700e8c0b1acf2b2141316d to your computer and use it in GitHub Desktop.
% sudo udevadm monitor
monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
KERNEL - the kernel uevent
KERNEL[101.778427] add /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5 (usb)
KERNEL[101.778735] add /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5/1-1.5:1.0 (usb)
KERNEL[101.778948] add /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5/1-1.5:1.1 (usb)
KERNEL[101.779325] bind /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5 (usb)
UDEV [101.831018] add /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5 (usb)
UDEV [101.845148] add /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5/1-1.5:1.1 (usb)
KERNEL[101.852845] add /module/cdc_acm (module)
UDEV [101.856742] add /module/cdc_acm (module)
KERNEL[101.857030] bind /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5/1-1.5:1.1 (usb)
KERNEL[101.857946] add /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5/1-1.5:1.0/tty/ttyACM0 (tty)
KERNEL[101.858169] bind /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5/1-1.5:1.0 (usb)
KERNEL[101.858404] add /bus/usb/drivers/cdc_acm (drivers)
UDEV [101.858644] add /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5/1-1.5:1.0 (usb)
UDEV [101.863721] add /bus/usb/drivers/cdc_acm (drivers)
UDEV [101.892638] bind /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5 (usb)
UDEV [101.902544] bind /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5/1-1.5:1.1 (usb)
UDEV [101.908721] add /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5/1-1.5:1.0/tty/ttyACM0 (tty)
UDEV [101.916313] bind /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5/1-1.5:1.0 (usb)
KERNEL[106.455999] remove /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5/1-1.5:1.0/tty/ttyACM0 (tty)
KERNEL[106.456278] unbind /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5/1-1.5:1.1 (usb)
KERNEL[106.456497] unbind /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5/1-1.5:1.0 (usb)
KERNEL[106.456711] remove /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5/1-1.5:1.0 (usb)
KERNEL[106.456925] remove /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5/1-1.5:1.1 (usb)
KERNEL[106.457732] unbind /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5 (usb)
KERNEL[106.458161] remove /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5 (usb)
UDEV [106.467289] remove /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5/1-1.5:1.0/tty/ttyACM0 (tty)
UDEV [106.471278] unbind /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5/1-1.5:1.1 (usb)
UDEV [106.478120] remove /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5/1-1.5:1.1 (usb)
UDEV [106.479939] unbind /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5/1-1.5:1.0 (usb)
UDEV [106.484400] remove /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5/1-1.5:1.0 (usb)
UDEV [106.491192] unbind /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5 (usb)
UDEV [106.495379] remove /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5 (usb)
KERNEL[106.891104] add /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5 (usb)
KERNEL[106.893198] add /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5/1-1.5:1.0 (usb)
KERNEL[106.895088] add /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5/1-1.5:1.0/tty/ttyACM0 (tty)
KERNEL[106.895342] bind /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5/1-1.5:1.0 (usb)
KERNEL[106.895556] add /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5/1-1.5:1.1 (usb)
KERNEL[106.895765] bind /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5/1-1.5:1.1 (usb)
KERNEL[106.896054] bind /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5 (usb)
UDEV [106.925142] add /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5 (usb)
UDEV [106.935762] add /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5/1-1.5:1.0 (usb)
UDEV [106.936145] add /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5/1-1.5:1.1 (usb)
UDEV [106.944583] bind /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5/1-1.5:1.1 (usb)
UDEV [106.962718] add /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5/1-1.5:1.0/tty/ttyACM0 (tty)
UDEV [107.005464] bind /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5/1-1.5:1.0 (usb)
UDEV [107.040158] bind /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.5 (usb)
$ sudo udevadm info -a -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/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4:1.0/tty/ttyACM0':
KERNEL=="ttyACM0"
SUBSYSTEM=="tty"
DRIVER==""
looking at parent device '/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4:1.0':
KERNELS=="1-1.4:1.0"
SUBSYSTEMS=="usb"
DRIVERS=="cdc_acm"
ATTRS{authorized}=="1"
ATTRS{bInterfaceNumber}=="00"
ATTRS{bInterfaceSubClass}=="02"
ATTRS{bInterfaceProtocol}=="01"
ATTRS{bInterfaceClass}=="02"
ATTRS{bAlternateSetting}==" 0"
ATTRS{bmCapabilities}=="6"
ATTRS{supports_autosuspend}=="1"
ATTRS{bNumEndpoints}=="01"
looking at parent device '/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4':
KERNELS=="1-1.4"
SUBSYSTEMS=="usb"
DRIVERS=="usb"
ATTRS{avoid_reset_quirk}=="0"
ATTRS{maxchild}=="0"
ATTRS{bmAttributes}=="80"
ATTRS{rx_lanes}=="1"
ATTRS{bDeviceProtocol}=="00"
ATTRS{quirks}=="0x0"
ATTRS{bDeviceClass}=="02"
ATTRS{urbnum}=="175"
ATTRS{removable}=="removable"
ATTRS{devpath}=="1.4"
ATTRS{bNumConfigurations}=="1"
ATTRS{manufacturer}=="Infineon"
ATTRS{bDeviceSubClass}=="00"
ATTRS{busnum}=="1"
ATTRS{configuration}==""
ATTRS{tx_lanes}=="1"
ATTRS{idProduct}=="0058"
ATTRS{product}=="IFX CDC"
ATTRS{speed}=="12"
ATTRS{bMaxPacketSize0}=="64"
ATTRS{bConfigurationValue}=="1"
ATTRS{version}==" 1.10"
ATTRS{bMaxPower}=="100mA"
ATTRS{idVendor}=="058b"
ATTRS{authorized}=="1"
ATTRS{ltm_capable}=="no"
ATTRS{devnum}=="13"
ATTRS{devspec}==" (null)"
ATTRS{bNumInterfaces}==" 2"
ATTRS{bcdDevice}=="0001"
looking at parent device '/devices/platform/soc/3f980000.usb/usb1/1-1':
KERNELS=="1-1"
SUBSYSTEMS=="usb"
DRIVERS=="usb"
ATTRS{devpath}=="1"
ATTRS{tx_lanes}=="1"
ATTRS{busnum}=="1"
ATTRS{maxchild}=="5"
ATTRS{bNumConfigurations}=="1"
ATTRS{configuration}==""
ATTRS{bDeviceClass}=="09"
ATTRS{idVendor}=="0424"
ATTRS{idProduct}=="9514"
ATTRS{bmAttributes}=="e0"
ATTRS{bMaxPower}=="2mA"
ATTRS{rx_lanes}=="1"
ATTRS{urbnum}=="181"
ATTRS{ltm_capable}=="no"
ATTRS{bMaxPacketSize0}=="64"
ATTRS{authorized}=="1"
ATTRS{bDeviceProtocol}=="02"
ATTRS{bConfigurationValue}=="1"
ATTRS{bDeviceSubClass}=="00"
ATTRS{removable}=="unknown"
ATTRS{avoid_reset_quirk}=="0"
ATTRS{speed}=="480"
ATTRS{bNumInterfaces}==" 1"
ATTRS{version}==" 2.00"
ATTRS{bcdDevice}=="0200"
ATTRS{devnum}=="2"
ATTRS{quirks}=="0x0"
looking at parent device '/devices/platform/soc/3f980000.usb/usb1':
KERNELS=="usb1"
SUBSYSTEMS=="usb"
DRIVERS=="usb"
ATTRS{quirks}=="0x0"
ATTRS{version}==" 2.00"
ATTRS{idVendor}=="1d6b"
ATTRS{idProduct}=="0002"
ATTRS{serial}=="3f980000.usb"
ATTRS{busnum}=="1"
ATTRS{product}=="DWC OTG Controller"
ATTRS{bMaxPacketSize0}=="64"
ATTRS{devnum}=="1"
ATTRS{ltm_capable}=="no"
ATTRS{manufacturer}=="Linux 4.19.97-v7+ dwc_otg_hcd"
ATTRS{devpath}=="0"
ATTRS{speed}=="480"
ATTRS{tx_lanes}=="1"
ATTRS{maxchild}=="1"
ATTRS{bmAttributes}=="e0"
ATTRS{removable}=="unknown"
ATTRS{avoid_reset_quirk}=="0"
ATTRS{rx_lanes}=="1"
ATTRS{bNumInterfaces}==" 1"
ATTRS{bDeviceSubClass}=="00"
ATTRS{bMaxPower}=="0mA"
ATTRS{authorized_default}=="1"
ATTRS{configuration}==""
ATTRS{bConfigurationValue}=="1"
ATTRS{interface_authorized_default}=="1"
ATTRS{bDeviceProtocol}=="01"
ATTRS{bcdDevice}=="0419"
ATTRS{bNumConfigurations}=="1"
ATTRS{urbnum}=="26"
ATTRS{bDeviceClass}=="09"
ATTRS{authorized}=="1"
looking at parent device '/devices/platform/soc/3f980000.usb':
KERNELS=="3f980000.usb"
SUBSYSTEMS=="platform"
DRIVERS=="dwc_otg"
ATTRS{hcd_frrem}=="HCD Dump Frame Remaining"
ATTRS{regoffset}=="0xffffffff"
ATTRS{hnpcapable}=="HNPCapable = 0x1"
ATTRS{buspower}=="Bus Power = 0x1"
ATTRS{wr_reg_test}=="Time to write GNPTXFSIZ reg 10000000 times: 380 msecs (38 jiffies)"
ATTRS{bussuspend}=="Bus Suspend = 0x0"
ATTRS{rem_wakeup_pwrdn}==""
ATTRS{busconnected}=="Bus Connected = 0x1"
ATTRS{srpcapable}=="SRPCapable = 0x1"
ATTRS{grxfsiz}=="GRXFSIZ = 0x00000306"
ATTRS{enumspeed}=="Device Enumeration Speed = 0x1"
ATTRS{devspeed}=="Device Speed = 0x0"
ATTRS{gpvndctl}=="GPVNDCTL = 0x00000000"
ATTRS{hnp}=="HstNegScs = 0x0"
ATTRS{remote_wakeup}=="Remote Wakeup Sig = 0 Enabled = 0 LPM Remote Wakeup = 0"
ATTRS{hptxfsiz}=="HPTXFSIZ = 0x02000406"
ATTRS{regvalue}=="invalid offset"
ATTRS{mode_ch_tim_en}=="Mode Change Ready Timer Enable = 0x0"
ATTRS{fr_interval}=="Frame Interval = 0x1d4b"
ATTRS{regdump}=="Register Dump"
ATTRS{mode}=="Mode = 0x1"
ATTRS{spramdump}=="SPRAM Dump"
ATTRS{gnptxfsiz}=="GNPTXFSIZ = 0x01000306"
ATTRS{srp}=="SesReqScs = 0x1"
ATTRS{hsic_connect}=="HSIC Connect = 0x1"
ATTRS{hprt0}=="HPRT0 = 0x00001005"
ATTRS{hcddump}=="HCD Dump"
ATTRS{gusbcfg}=="GUSBCFG = 0x20001700"
ATTRS{rd_reg_test}=="Time to read GNPTXFSIZ reg 10000000 times: 930 msecs (93 jiffies)"
ATTRS{inv_sel_hsic}=="Invert Select HSIC = 0x0"
ATTRS{gsnpsid}=="GSNPSID = 0x4f54280a"
ATTRS{driver_override}=="(null)"
ATTRS{guid}=="GUID = 0x2708a000"
ATTRS{gotgctl}=="GOTGCTL = 0x001c0001"
ATTRS{ggpio}=="GGPIO = 0x00000000"
looking at parent device '/devices/platform/soc':
KERNELS=="soc"
SUBSYSTEMS=="platform"
DRIVERS==""
ATTRS{driver_override}=="(null)"
looking at parent device '/devices/platform':
KERNELS=="platform"
SUBSYSTEMS==""
DRIVERS==""
on plugin:
$ sudo /lib/systemd/systemd-udevd --debug
1-1.4: Device (SEQNUM=1352, ACTION=add) is queued
Validate module index
Check if link configuration needs reloading.
Successfully forked off 'n/a' as PID 917.
1-1.4: Worker [917] is forked for processing SEQNUM=1352.
1-1.4: Processing device (SEQNUM=1352, ACTION=add)
1-1.4:1.0: Device (SEQNUM=1353, ACTION=add) is queued
1-1.4: IMPORT builtin 'usb_id' /lib/udev/rules.d/50-udev-default.rules:13
ttyACM0: Device (SEQNUM=1354, ACTION=add) is queued
1-1.4:1.0: Device (SEQNUM=1355, ACTION=bind) is queued1-1.4: IMPORT builtin 'hwdb' /lib/udev/rules.d/50-udev-default.rules:13
1-1.4: MODE 0664 /lib/udev/rules.d/50-udev-default.rules:45
1-1.4:1.1: Device (SEQNUM=1356, ACTION=add) is queued
1-1.4:1.1: Device (SEQNUM=1357, ACTION=bind) is queued
1-1.4: Device (SEQNUM=1358, ACTION=bind) is queued
1-1.4: PROGRAM 'mtp-probe /sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4 1 6' /lib/udev/rules.d/69-libmtp.rules:2541
Starting 'mtp-probe /sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4 1 6'
Successfully forked off '(spawn)' as PID 918.
'mtp-probe /sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4 1 6'(out) '0'
Process 'mtp-probe /sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4 1 6' succeeded.
1-1.4: Handling device node '/dev/bus/usb/001/006', devnum=c189:5, mode=0664, uid=0, gid=0
1-1.4: Setting permissions /dev/bus/usb/001/006, 020664, uid=0, gid=0
1-1.4: Creating symlink '/dev/char/189:5' to '../bus/usb/001/006'
1-1.4: sd-device: Created db file '/run/udev/data/c189:5' for '/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4'
1-1.4: Device (SEQNUM=1352, ACTION=add) processed
1-1.4: sd-device-monitor: Passed 542 byte to netlink monitor
1-1.4:1.0: sd-device-monitor: Passed 297 byte to netlink monitor
Successfully forked off 'n/a' as PID 920.
1-1.4:1.1: Worker [920] is forked for processing SEQNUM=1356.
1-1.4:1.0: Processing device (SEQNUM=1353, ACTION=add)
1-1.4:1.1: Processing device (SEQNUM=1356, ACTION=add)
1-1.4:1.0: IMPORT builtin 'hwdb' /lib/udev/rules.d/50-udev-default.rules:14
1-1.4:1.0: IMPORT builtin 'usb_id' /lib/udev/rules.d/60-libgphoto2-6.rules:9
1-1.4:1.1: IMPORT builtin 'hwdb' /lib/udev/rules.d/50-udev-default.rules:14
1-1.4:1.1: IMPORT builtin 'usb_id' /lib/udev/rules.d/60-libgphoto2-6.rules:9
1-1.4:1.0: Failed to access usb_interface: No such file or directory
1-1.4:1.0: IMPORT builtin 'usb_id' fails: No such file or directory
1-1.4:1.0: RUN 'kmod load $env{MODALIAS}' /lib/udev/rules.d/80-drivers.rules:5
1-1.4:1.1: Failed to access usb_interface: No such file or directory
1-1.4:1.1: IMPORT builtin 'usb_id' fails: No such file or directory
1-1.4:1.1: RUN 'kmod load $env{MODALIAS}' /lib/udev/rules.d/80-drivers.rules:51-1.4:1.0: sd-device: Created db file '/run/udev/data/+usb:1-1.4:1.0' for '/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4:1.0'
Loading module: usb:v058Bp0058d0001dc02dsc00dp00ic02isc02ip01in00
Module 'cdc_acm' is already loaded
1-1.4:1.0: Device (SEQNUM=1353, ACTION=add) processed
1-1.4:1.1: sd-device: Created db file '/run/udev/data/+usb:1-1.4:1.1' for '/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4:1.1'
Loading module: usb:v058Bp0058d0001dc02dsc00dp00ic0Aisc00ip00in01
1-1.4:1.0: sd-device-monitor: Passed 400 byte to netlink monitor
ttyACM0: sd-device-monitor: Passed 223 byte to netlink monitor
Failed to find module 'usb:v058Bp0058d0001dc02dsc00dp00ic0Aisc00ip00in01'
1-1.4:1.1: Device (SEQNUM=1356, ACTION=add) processed
1-1.4:1.1: sd-device-monitor: Passed 401 byte to netlink monitor
1-1.4:1.1: sd-device-monitor: Passed 314 byte to netlink monitor
ttyACM0: Processing device (SEQNUM=1354, ACTION=add)
1-1.4:1.1: Processing device (SEQNUM=1357, ACTION=bind)
1-1.4:1.1: IMPORT builtin 'hwdb' /lib/udev/rules.d/50-udev-default.rules:14
1-1.4:1.1: IMPORT builtin 'usb_id' /lib/udev/rules.d/60-libgphoto2-6.rules:9
ttyACM0: GROUP 20 /lib/udev/rules.d/50-udev-default.rules:25
1-1.4:1.1: Failed to access usb_interface: No such file or directory
1-1.4:1.1: IMPORT builtin 'usb_id' fails: No such file or directoryttyACM0: IMPORT builtin 'usb_id' /lib/udev/rules.d/60-serial.rules:8
1-1.4:1.0: if_class:2 protocol:0
ttyACM0: IMPORT builtin 'hwdb' /lib/udev/rules.d/60-serial.rules:8
1-1.4:1.1: sd-device: Created db file '/run/udev/data/+usb:1-1.4:1.1' for '/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4:1.1'
1-1.4:1.1: Device (SEQNUM=1357, ACTION=bind) processed
1-1.4:1.1: sd-device-monitor: Passed 402 byte to netlink monitor
ttyACM0: IMPORT builtin 'path_id' /lib/udev/rules.d/60-serial.rules:15
ttyACM0: LINK 'serial/by-path/platform-3f980000.usb-usb-0:1.4:1.0' /lib/udev/rules.d/60-serial.rules:16
ttyACM0: IMPORT builtin skip 'usb_id' /lib/udev/rules.d/60-serial.rules:19
ttyACM0: LINK 'serial/by-id/usb-Infineon_IFX_CDC-if00' /lib/udev/rules.d/60-serial.rules:23
ttyACM0: Handling device node '/dev/ttyACM0', devnum=c166:0, mode=0660, uid=0, gid=20
ttyACM0: Setting permissions /dev/ttyACM0, 020660, uid=0, gid=20
ttyACM0: Creating symlink '/dev/char/166:0' to '../ttyACM0'
ttyACM0: Creating symlink '/dev/serial/by-path/platform-3f980000.usb-usb-0:1.4:1.0' to '../../ttyACM0'
ttyACM0: Creating symlink '/dev/serial/by-id/usb-Infineon_IFX_CDC-if00' to '../../ttyACM0'
ttyACM0: sd-device: Created db file '/run/udev/data/c166:0' for '/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4:1.0/tty/ttyACM0'
ttyACM0: Device (SEQNUM=1354, ACTION=add) processed
ttyACM0: sd-device-monitor: Passed 796 byte to netlink monitor
1-1.4:1.0: sd-device-monitor: Passed 313 byte to netlink monitor
1-1.4:1.0: Processing device (SEQNUM=1355, ACTION=bind)
1-1.4:1.0: IMPORT builtin 'hwdb' /lib/udev/rules.d/50-udev-default.rules:14
1-1.4:1.0: IMPORT builtin 'usb_id' /lib/udev/rules.d/60-libgphoto2-6.rules:9
1-1.4:1.0: Failed to access usb_interface: No such file or directory
1-1.4:1.0: IMPORT builtin 'usb_id' fails: No such file or directory
1-1.4:1.0: sd-device: Created db file '/run/udev/data/+usb:1-1.4:1.0' for '/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4:1.0'
1-1.4:1.0: Device (SEQNUM=1355, ACTION=bind) processed
1-1.4:1.0: sd-device-monitor: Passed 401 byte to netlink monitor
1-1.4: sd-device-monitor: Passed 290 byte to netlink monitor
1-1.4: Processing device (SEQNUM=1358, ACTION=bind)
1-1.4: IMPORT builtin 'usb_id' /lib/udev/rules.d/50-udev-default.rules:13
1-1.4: IMPORT builtin 'hwdb' /lib/udev/rules.d/50-udev-default.rules:13
1-1.4: PROGRAM 'mtp-probe /sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4 1 6' /lib/udev/rules.d/69-libmtp.rules:2541
Starting 'mtp-probe /sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4 1 6'
Successfully forked off '(spawn)' as PID 923.
'mtp-probe /sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4 1 6'(out) '0'
Process 'mtp-probe /sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4 1 6' succeeded.
1-1.4: Handling device node '/dev/bus/usb/001/006', devnum=c189:5, mode=0600, uid=0, gid=0
1-1.4: Preserve already existing symlink '/dev/char/189:5' to '../bus/usb/001/006'
1-1.4: sd-device: Created db file '/run/udev/data/c189:5' for '/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4'
1-1.4: Device (SEQNUM=1358, ACTION=bind) processed
1-1.4: sd-device-monitor: Passed 543 byte to netlink monitor
Failed to unlink /run/udev/queue: No such file or directory
Cleanup idle workers
Unload module index
Unloaded link configuration context.
Unload module index
Unloaded link configuration context.
Worker [920] exited
$ ls -l /dev/serial/by-id/usb-Infineon_IFX_CDC-if00
lrwxrwxrwx 1 root root 13 Sep 7 16:41 /dev/serial/by-id/usb-Infineon_IFX_CDC-if00 -> ../../ttyACM0
from hwdb.d/60-sensor.hwdb
# The device modalias can be seen in the `modalias` file
# of the sensor parent, for example:
$ cat /sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4/1-1.4\:1.0/tty/ttyACM0/device/modalias
usb:v058Bp0058d0001dc02dsc00dp00ic02isc02ip01in00
058B is Infineon and 0058 is the XMC USB
pi@xxx:/sys/devices/platform/soc/3f980000.usb $ systemd-hwdb query usb:v058Bp0058d0001dc02dsc00dp00ic02isc02ip01in0
0
ID_USB_CLASS_FROM_DATABASE=Communications
ID_VENDOR_FROM_DATABASE=Infineon Technologies
Other commands of note (and success) include:
```
sudo udevadm trigger -v --attr-match=idVendor="058b" --attr-match=idProduct="0058"
sudo udevadm test /devices/platform/soc/3f980000.usb/usb1/1-1/1-1.4
sudo udevadm control -l7
```
# Advice!
In "/etc/udev/rules.d/99-com.rules", adding a new rule
SUBSYSTEM=="tty", ATTRS{idVendor}=="058b", ATTRS{idProduct}=="0058", SYMLINK+="RADAR%E{ID_USB_INTERFACE_NUM}"
alone will allow devices to be added as /dev/RADAR00
A further goal is to change the port behavior, like turning off line echo.
This line acomplishes that goal:
```
SUBSYSTEM=="tty", ATTRS{idVendor}=="058b", ATTRS{idProduct}=="0058", SYMLINK+="RADAR%E{ID_USB_INTERFACE_NUM}", RUN+="/bin/stty -F /dev/RADAR%E{ID_USB_INTERFACE_NUM} -echo"
```
Important! This also names the device as /dev/RADAR00 (or 01 for a 2nd sensor, etc)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment