px-ros-pkg icon indicating copy to clipboard operation
px-ros-pkg copied to clipboard

px-ros-pkg : Could not open serial port /dev/ttyS0 Reason : std::exception

Open ankushSsingh opened this issue 8 years ago • 10 comments

I am an Ubuntu 14.04 LTS user, and I am getting this error with roslaunch px4flow px4flow.launch:

[ERROR] [1498028479.392473155]: Could not open serial port /dev/ttyS0. Reason: std::exception.

the pid goes on in a cycle of starting and restarting.

Please, it would be great if you can help.

ankushSsingh avatar Jun 21 '17 07:06 ankushSsingh

Hi. I'm running on Ubuntu 16.04 and had same error. It seems that px4flow node searches for the sensor in /dev/ttyS0, but the actual px4flow sensor might be connected to /dev/ttyACM[some number.. ex) 0], thus throwing connection error. You can check your device using setserial command

setserial /dev/ttyACM[0123]

Maybe you can make a symbolic link from /dev/ttyACM0(in my case) to /dev/ttyS0 and retry.

ln -s /dev/ttyACM0 /dev/ttyS0

By the way I don't realy know why this node is searching for wrong path.

raysuhyunlee avatar Jul 20 '17 07:07 raysuhyunlee

There is a parameter file, px4flow_parameters.yaml that defines serial_port: /dev/ttyS0. But even if I change this value to /dev/ttyACM0, there still same error.. I don't know why

elton-choi avatar Jul 20 '17 07:07 elton-choi

I had the same problem, i could solve it by changing in the px4flow_node.cc the "/dev/ttyUSB0/" to "/dev/ttyACM3/" (its 3 in my case) and if you use the lounch file change it there in the parameter file, px4flow_parameters.yaml.

fischma3 avatar Jul 26 '17 12:07 fischma3

I have chaged port to "dev/ttyACM0/"(its 0 in my case) in launch file, but it has same problem.

elton-choi avatar Jul 27 '17 07:07 elton-choi

by typing "dmesg" in the console, you can check if the device is correctly identified and on which ttyACM... Make sure that no other program take access to this port (QGroundControl per example) otherwise you can't open this port again.

fischma3 avatar Jul 27 '17 08:07 fischma3

Yeah, I checked port by dmesg and turned off QGroundControl. And I can connect to pixracer using this command in Tools. ./mavlink_shell.py /dev/ttyACM0. But still has problem in px4flow.

elton-choi avatar Jul 28 '17 07:07 elton-choi

find px4flow_parameters.yaml in /src and change serial_port: /dev/ttyS0 to serial_port: /dev/ttyACM0. finally execute catkin_make

ghost avatar Aug 25 '17 09:08 ghost

Hello to every body I have bought a px4flow kit (holybro brand). but unfortunately I cant run it by its ros node. my system : ubuntu 16.04 and ROS kinetic I got : ERROR] [1498028479.392473155]: Could not open serial port /dev/ttyS0. Reason: std::exception. I have done every thing you had said here. but it has not been executed. maybe it is due to the fact that mine is not original (3DR).

any body solved it?

soheil2017 avatar Apr 07 '19 20:04 soheil2017

Hi there, i have the same problems. dmesg is saying /dev/ttyACM0 i fixed everthing on /dev/ttyACM0. (node and launch) But its still throwing the error.

can someone help?

Betzle avatar Jul 25 '19 14:07 Betzle

Before roslaunch try sudo chmod 777 /dev/ttyACM0

animeshshastry avatar Aug 15 '19 20:08 animeshshastry