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

Communication occurs only one way between devices

asked 2019-08-26 05:08:38 -0500

Hemanth gravatar image

updated 2019-08-26 05:23:02 -0500

Hello,

I am using the talker and listener nodes to check that the communication occurs between my raspberry pi and my system. I am running Kinetic in the system and using ubiquity robotics image in the RPi which has ROS pre-installed. I am only able to send data from the RPi to the system but not vice-versa.

Here are the setup lines in my .bashrc files:

In System

export ROS_IP=172.20.10.8
export ROS_HOSTNAME=172.20.10.8
export ROS_MASTER_URI=http://172.20.10.9:11311/

In RPi (Master)

export ROS_IP=172.20.10.9
export ROS_HOSTNAME=172.20.10.9
export ROS_MASTER_URI=http://172.20.10.9:11311/

Here are my etc/hosts files

In System

127.0.0.1   localhost
127.0.1.1   01HW822483
172.20.10.9     172.20.10.9
172.20.10.8     172.20.10.8

::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
172.20.10.9 172.20.10.9

In RPi

127.0.0.1         localhost
::1                  localhost ip6-localhost ip6-lookback
ff02::1            ip6-allnodes
ff02::2            ip6-allrouters

172.20.10.9   172.20.10.9
172.20.10.8   172.20.10.8

I have also included the rqt_graphs. When i run talker on the Pi and listener on the system, i can echo the /chatter topic. But when I do the reverse, i cannot observe anything in the topic.

C:\fakepath\pc2pi.png

C:\fakepath\pi2pc.png

This are the errors I get when i run roswtf

analyzing graph...
... done analyzing graph
running graph rules...
ERROR: Unknown host [my_robot.local] for node [/rosbridge_ws/rosbridge_websocket]
ERROR: Unknown host [my_robot.local] for node [/rosbridge_wss/rosbridge_websocket]
ERROR: Unknown host [my_robot.local] for node [/rosout]
ERROR: Unknown host [my_robot.local] for node [/teleop_twist_joy]
ERROR: connection refused to [http://172.20.10.9:45169/]
ERROR: Unknown host [my_robot.local] for node [/joint_state_publisher]
ERROR: Unknown host [my_robot.local] for node [/motor_node]
ERROR: Unknown host [my_robot.local] for node [/joy_node]
ERROR: Unknown host [my_robot.local] for node [/robot_state_publisher]
ERROR: Unknown host [my_robot.local] for node [/tf2_web_republisher]
ERROR: Unknown host [my_robot.local] for node [/rosbridge_wss/rosapi]
edit retag flag offensive close merge delete

Comments

When trying to communicate from the system to your raspberry, do you have a roscore running on the raspberry ?

Delb gravatar image Delb  ( 2019-08-26 05:31:06 -0500 )edit

Yes, I do have a roscore running on the raspberry

Hemanth gravatar image Hemanth  ( 2019-08-26 05:35:25 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2020-02-03 00:36:52 -0500

Hemanth gravatar image

It was a firewall problem.

Thanks guys.

edit flag offensive delete link more
1

answered 2019-08-26 06:50:36 -0500

prefpkg21 gravatar image

updated 2019-08-26 06:52:18 -0500

the ROS_HOSTNAME should not be the IP address. Use ROS_IP. The HOSTNAME would be the output from /etc/hostname of the machine. you would then set that in the /etc/hosts file on your laptop such as

172.20.10.9 "whatever the RPi hostname is"

edit flag offensive delete link more

Comments

Hi, I have followed what you suggested. I found out the hostname of both the devices in /etc/hostname and changed the ROS_HOSTNAME in both. I have also edited the /etc/hosts file in both, RPi IP and hostname in system and system IP and hostname in RPI.

There still seems to be the same problem, only one way communication.

Hemanth gravatar image Hemanth  ( 2019-08-26 07:29:22 -0500 )edit

are you running the roscaore via a startup service or from a terminal launch file? You shouldn't have to use both ROS_HOSTNAME and ROS_IP; http://wiki.ros.org/ROS/EnvironmentVa...

What is showing for the server for "started roslaunch server http://xxxxxx/" ?

prefpkg21 gravatar image prefpkg21  ( 2019-08-26 08:06:37 -0500 )edit

I am using the roscore command in the terminal to run roscore. It shows "started roslaunch server http://127.20.10.9:39063/"

Hemanth gravatar image Hemanth  ( 2019-08-27 00:53:00 -0500 )edit

did you run sudo systemctl disable magni-base on the Pi image as per Ubiquity's site? I have often found upstart ros jobs have different network settings than what is in your bashrc profile. You could run journalctl -u magni-base to see if it is still running. At the top of the output would show what network settings it is using if it is still running. If it is still running then you could modify its startup setup or use robot_upstart to setup your own job with the network settings you describe. To test you can run sudo killall -9 roscore "or rosmaster" I forget which one and then manually launch on the Pi and then your system to verify your network settings.

prefpkg21 gravatar image prefpkg21  ( 2019-09-03 11:26:36 -0500 )edit

Question Tools

3 followers

Stats

Asked: 2019-08-26 05:08:38 -0500

Seen: 347 times

Last updated: Feb 03 '20