ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Could not open symlink to port /dev/ttyACM*

asked 2018-06-29 17:07:13 -0600

trixr4kdz gravatar image

updated 2018-07-05 18:37:32 -0600

Hi,

tl;dr: I am unable to use my symlink to run rosserial since I would always get a message that there is no such file or directory with the symlink I created.

I've created a symlink to my arduino device using the following udev rules:

KERNEL=="ttyACM[0-9]", MODE="0666"
ACTION=="add", SUBSYSTEMS=="usb", ATTRS{serial}=="8563332343035180E191", ATTRS{idProduct}=="0043", ATTRS{idVendor}=="2341", ATTRS{manufacturer}=="Arduino (www.arduino.cc)", SYMLINK+="/tty-arduino-uno"

and I can see that the symbolic link has been created since I would get this output:

$ ls -la /dev/tty-arduino-uno 
lrwxrwxrwx 1 root root 10 Jun 29 14:52 /dev/tty-arduino-uno -> ../ttyACM1

Now I wanted to run rosserial_python with this symlink but I would always get this error message when I run rosrun rosserial_python serial_node.py _port:=/dev/tty-arduino-uno:

[ERROR] [1530309034.478989]: Error opening serial: [Errno 2] could not open port /dev/tty-arduino-uno: [Errno 2] No such file or directory: '/dev/tty-arduino-uno'

However, rosserial_python still works when I do

rosrun rosserial_python serial_node.py _port:=/dev/ttyACM1

I get the following when I run udevadm info -a -n /dev/ttyACM1:

  looking at device '/devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1.1/1-1.1:1.0/tty/ttyACM1':
  KERNEL=="ttyACM1"
  SUBSYSTEM=="tty"
  DRIVER==""

looking at parent device '/devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1.1/1-1.1:1.0':
  KERNELS=="1-1.1: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}=="6"
  ATTRS{supports_autosuspend}=="1"

looking at parent device '/devices/pci0000:00/0000:00:14.0/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}=="02"
  ATTRS{bDeviceProtocol}=="00"
  ATTRS{bDeviceSubClass}=="00"
  ATTRS{bMaxPacketSize0}=="8"
  ATTRS{bMaxPower}=="100mA"
  ATTRS{bNumConfigurations}=="1"
  ATTRS{bNumInterfaces}==" 2"
  ATTRS{bcdDevice}=="0001"
  ATTRS{bmAttributes}=="c0"
  ATTRS{busnum}=="1"
  ATTRS{configuration}==""
  ATTRS{devnum}=="31"
  ATTRS{devpath}=="1.1"
  ATTRS{idProduct}=="0043"
  ATTRS{idVendor}=="2341"
  ATTRS{ltm_capable}=="no"
  ATTRS{manufacturer}=="Arduino (www.arduino.cc)"
  ATTRS{maxchild}=="0"
  ATTRS{quirks}=="0x0"
  ATTRS{removable}=="unknown"
  ATTRS{serial}=="8563332343035180E191"
  ATTRS{speed}=="12"
  ATTRS{urbnum}=="15"
  ATTRS{version}==" 1.10"

looking at parent device '/devices/pci0000:00/0000:00:14.0/usb1/1-1':
  KERNELS=="1-1"
  SUBSYSTEMS=="usb"
  DRIVERS=="usb"
  ATTRS{authorized}=="1"
  ATTRS{avoid_reset_quirk}=="0"
  ATTRS{bConfigurationValue}=="1"
  ATTRS{bDeviceClass}=="09"
  ATTRS{bDeviceProtocol}=="01"
  ATTRS{bDeviceSubClass}=="00"
  ATTRS{bMaxPacketSize0}=="64"
  ATTRS{bMaxPower}=="100mA"
  ATTRS{bNumConfigurations}=="1"
  ATTRS{bNumInterfaces}==" 1"
  ATTRS{bcdDevice}=="0111"
  ATTRS{bmAttributes}=="e0"
  ATTRS{busnum}=="1"
  ATTRS{configuration}==""
  ATTRS{devnum}=="2"
  ATTRS{devpath}=="1"
  ATTRS{idProduct}=="0101"
  ATTRS{idVendor}=="1a40"
  ATTRS{ltm_capable}=="no"
  ATTRS{maxchild}=="4"
  ATTRS{product}=="USB 2.0 Hub"
  ATTRS{quirks}=="0x0"
  ATTRS{removable}=="removable"
  ATTRS{speed}=="480"
  ATTRS{urbnum}=="733"
  ATTRS{version}==" 2.00"

looking at parent device '/devices/pci0000:00/0000:00:14.0/usb1':
  KERNELS=="usb1"
  SUBSYSTEMS=="usb"
  DRIVERS=="usb"
  ATTRS{authorized}=="1"
  ATTRS{authorized_default}=="1"
  ATTRS{avoid_reset_quirk}=="0"
  ATTRS{bConfigurationValue}=="1 ...
(more)
edit retag flag offensive close merge delete

Comments

I notice the symlink points to a relative path. Not sure that matters, but what happens if you create the symlink manually (disable the udev rule for the test) and use the absolute path to /dev/ttyACM1?

gvdhoorn gravatar image gvdhoorn  ( 2018-06-30 01:22:18 -0600 )edit

Sorry for the delay. That works, but the whole point of me creating the symlink is I don't know what port my devices will be assigned to when I boot up. I have at least 2 devices connected through usb and the ports would change so I had the udev to match the device so I can assign a static name

trixr4kdz gravatar image trixr4kdz  ( 2018-07-05 18:25:55 -0600 )edit

Anyways, I found an alternative solution, which is to use the id from /dev/serial/by-id.I didn't have to add udev rules doing it this way. But thanks!

trixr4kdz gravatar image trixr4kdz  ( 2018-07-05 18:27:00 -0600 )edit

The point of the test was to see whether the symlink was actually created correctly, and whether relative symlinks would work. I know what udev is for and why you want to use it.

I would suggest to investigate why relative symlinks are being created and whether they are known to cause issues.

gvdhoorn gravatar image gvdhoorn  ( 2018-07-06 05:11:03 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2018-07-07 13:50:06 -0600

Rick Armstrong gravatar image

You might try SYMLINK+="tty-arduino-uno" (i.e., no leading slash). The symlink gets created in /dev by default. It's worked many times for me, anyhow.

edit flag offensive delete link more

Comments

Agreed. (note that the existing symlink points to the wrong place: ../ttyACM1 instead of just ttyACM1)

ahendrix gravatar image ahendrix  ( 2018-07-07 14:29:34 -0600 )edit

Which was what we were trying to diagnose by creating the symlink manually. But the OP seems to have already disappeared.

gvdhoorn gravatar image gvdhoorn  ( 2018-07-16 07:50:35 -0600 )edit

Sorry about that, I got sidetracked. Yes, this was what was happening and your solution works.

trixr4kdz gravatar image trixr4kdz  ( 2018-08-09 15:10:06 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2018-06-29 17:07:13 -0600

Seen: 1,779 times

Last updated: Jul 07 '18