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

robot_upstart: could not open port /dev/ttyUSB0

asked 2015-04-25 15:12:28 -0500

dennn66 gravatar image

Hi all,

I use turtlebot roomba with indigo version. I try to use robot_upstart package to run turtlebot_bringup minimal.launch from an upstrat:

rosrun robot_upstart install --job turtlebot --interface wlan0 --user myuser --setup /home/myuser/turtlebot/devel/setup.bash --rosdistro indigo --master http://192.168.1.2:11311 --logdir /home/myuser/.ros/log turtlebot_bringup/launch/minimal.launch

All work properly except serial connection:

Failed to open port /dev/ttyUSB0. Error: could not open port /dev/ttyUSB0: [Errno 13] Permission denied: '/dev/ttyUSB0' Please make sure the Create cable is plugged into the computer.

'myuser' is in the 'dialout' group. If I start roslaunch turtlebot_bringup minimal.launch in a terminal it works.

If I start sudo service turtlebot start it doesn't work.

If I manually change port permission sudo chmod 777 /dev/ttyUSB0 service start without errors.

Anyone having an idea what could be wrong?

Thanks in advance.

edit retag flag offensive close merge delete

Comments

hi dennn666, did you figure this issue out? Also do you know how to determine the Network interface to bring ROS up with, which is wlan0 in your case. Thanks so much

crazymumu gravatar image crazymumu  ( 2015-11-03 21:58:01 -0500 )edit

2 Answers

Sort by » oldest newest most voted
1

answered 2015-09-01 14:12:49 -0500

gvdhoorn gravatar image

updated 2016-11-11 09:24:45 -0500

This is some additional clarification for what @Rasoul wrote.

'myuser' is in the 'dialout' group.

That is normally all that is required, but robot_upstart works a bit different. From the robot_upstart 0.2.0 documentation » The install script - permissions:

It’s important to understand how permissions work robot_upstart:

  1. The upstart job invokes its jobname-start bash script as root.

  2. The script sets up environment variables, and then uses setuidgid to execute roslaunch as an unprivileged user. This is by default the user who ran the install script, but it can also be specified explicitly via a flag.

  3. The roslaunch which executes does not have its user’s group memberships. This means that it will not have access to serial ports with the dialout group, or locations in /var/log owned by root, etc. Any filesystem resources needed by your ROS nodes should be chowned to the same unprivileged user which will run ROS, or should set to world readable/writeable, for example using udev.

So jobname-start starts out as user root, but then quickly drops all privileges and continues as a regular user (that is not a member of the dialout group). That is why some more configuration is required.

edit flag offensive delete link more

Comments

Hi What user would that be? the script uses setuidgid and sets to the user myuser, which is in the dialout group. When I do the same thing in my case and look at the processes run in htop the user is myuser. So how can the process run as myuser but not have the permissions of myuser?

borgcons gravatar image borgcons  ( 2017-12-06 13:38:54 -0500 )edit
4

answered 2015-09-01 13:40:15 -0500

Rasoul gravatar image

In order to solve the problem, perform the following steps:

sudo gedit /etc/udev/rules.d/my-usbaccess.rules

Write the following into the file

KERNEL=="ttyUSB0", MODE="0666" into the file

Save the file and reboot.

edit flag offensive delete link more

Comments

Is it possible for udev rules in /lib/udev/rules.d/ to override rules you create in /etc/udev/rules.d/ ?

Waron gravatar image Waron  ( 2016-01-27 13:45:30 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2015-04-25 15:12:28 -0500

Seen: 6,141 times

Last updated: Nov 11 '16