Ask Your Question
0

Rosserial arduino connectivity problem " socket.error: [Errno 111] Connection refused"

asked 2016-11-17 01:39:50 -0500

Wael gravatar image

I am using Ubuntu 14.04LTS with Indigo ROS and an Arduino Mega 2560. When I run the command rosrun rosserial_python serial_node.py _port:=/dev/ttyACM0 _baud:=115200, I faced some connection problems first this command was working normally and the serial connection was connected successfully with the Arduino. suddenly after restart my PC the following Error was appear "socket.error: [Errno 111] Connection refused" and serial connection didn't established.

The following codes i write it by sequence :

> sudo usermod -a -G dialout wael
> sudo chmod a+rw /dev/ttyACM0
> rosrun rosserial_python serial_node.py _port:=/dev/ttyACM0 _baud:=115200

The following error appear

Traceback (most recent call last):
  File "/opt/ros/indigo/lib/rosserial_python/serial_node.py", line 46, in <module>
    rospy.init_node("serial_node")
  File "/opt/ros/indigo/lib/python2.7/dist-packages/rospy/client.py", line 323, in init_node
    _init_node_params(argv, name)
  File "/opt/ros/indigo/lib/python2.7/dist-packages/rospy/client.py", line 186, in _init_node_params
    set_param(rosgraph.names.PRIV_NAME + param_name, param_value)
  File "/opt/ros/indigo/lib/python2.7/dist-packages/rospy/client.py", line 504, in set_param
    _param_server[param_name] = param_value #MasterProxy does all the magic for us
  File "/opt/ros/indigo/lib/python2.7/dist-packages/rospy/msproxy.py", line 148, in __setitem__
    self.target.setParam(rospy.names.get_caller_id(), rospy.names.resolve_name(key), val)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1233, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1587, in __request
    verbose=self.__verbose
  File "/usr/lib/python2.7/xmlrpclib.py", line 1273, in request
    return self.single_request(host, handler, request_body, verbose)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1301, in single_request
    self.send_content(h, request_body)
  File "/usr/lib/python2.7/xmlrpclib.py", line 1448, in send_content
    connection.endheaders(request_body)
  File "/usr/lib/python2.7/httplib.py", line 975, in endheaders
    self._send_output(message_body)
  File "/usr/lib/python2.7/httplib.py", line 835, in _send_output
    self.send(msg)
  File "/usr/lib/python2.7/httplib.py", line 797, in send
    self.connect()
  File "/usr/lib/python2.7/httplib.py", line 778, in connect
    self.timeout, self.source_address)
  File "/usr/lib/python2.7/socket.py", line 571, in create_connection
    raise err
socket.error: [Errno 111] Connection refused

What can i do please to solve this problem?

edit retag flag offensive close merge delete

Comments

1

Have you set ROS_MASTER_URI or ROS_IP or ROS_HOSTNAME to something yourself? Are you on a DHCP network and could your IP have changed?

gvdhoorn gravatar imagegvdhoorn ( 2016-11-17 02:08:04 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2016-11-17 05:10:49 -0500

Wael gravatar image

The problem was in the ROS_MASTER_URI , it was not activated. After activating it the problem solved. Thank you for your support.

edit flag offensive delete link more

Comments

Thanks for your comment, it helps.

shawnysh gravatar imageshawnysh ( 2017-01-12 02:31:22 -0500 )edit

How to activate it?

himS1234 gravatar imagehimS1234 ( 2018-06-12 03:51:48 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2016-11-17 01:39:50 -0500

Seen: 1,707 times

Last updated: Nov 17 '16