ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

PubSub tutorial: Android device doesn't receive messages published by PC [solved]

asked 2017-10-20 09:04:46 -0600

aurora18 gravatar image

updated 2017-10-20 10:35:39 -0600

Hey Dear ROS Community, I'm currently building a custom App to control my robot. Therefore I'm testing the PubSub tutorial provided by the android_core package:

Now if I connect my Android device to the ROS Master running on my PC and listen to the /chatter topic on my PC I receive the incoming "Hello World" messages sent by the talker node on my android device. However, if I publish a String message on my PC to the same topic it gets only displayed on the terminal running "rostopic echo /chatter" while the RosTextView on the android device only displays the messages published by the talker node but not what is published by my PC.

Running "~ rostopic info /chatter" delivers

Type: std_msgs/String 

* /rosjava_tutorial_pubsub/talker ( 

* /android_gingerbread/ros_text_view (

Running ~ rosnode ping /android_gingerbread/ros_text_view  delivers

rosnode: node is [/android_gingerbread/ros_text_view] 
pinging /android_gingerbread/ros_text_view with a timeout of 3.0s 
xmlrpc reply from   time=358.101130ms 
xmlrpc reply from   time=124.948978ms 
xmlrpc reply from   time=329.936981ms

So everything seems to be setup fine however the the RosTextView node doesn't react to messages published by my PC. It seems like a network issue.

Related posts suggested to create a publicly accessible nodeConfiguration via

NodeConfiguration nodeConfiguration = NodeConfiguration.newPublic(InetAddressFactory.newNonLoopback().getHostAddress().toString(), masterUri);

which is already the case in the current pubsub tutorial.

Does somebody of you know how to fix this problem?

Thanks in advance!

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2017-10-20 09:27:09 -0600

gvdhoorn gravatar image

I'm not sure, but try setting ROS_IP=ip.of.your.pc on your PC as an environment variable. It might be that the Android device is trying to resolve the hostname of your PC and is failing, hence cannot make a connection to the PC.

But it's just a guess/stab in the dark.

edit flag offensive delete link more


Thank you so much!! Setting the ROS_IP solved my Problem! I tried that before but obviously changed to another terminal when publishing to /chatter where the environment variables weren't exported yet. Thanks!

aurora18 gravatar image aurora18  ( 2017-10-20 10:35:01 -0600 )edit

You could either make sure you have a properly working DNS setup for all involved hosts, or add the export ROS_IP=... to your .bashrc. Or use a tool such as ifdata from the moreutils Ubuntu package.

gvdhoorn gravatar image gvdhoorn  ( 2017-10-20 10:41:13 -0600 )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

1 follower


Asked: 2017-10-20 09:04:46 -0600

Seen: 273 times

Last updated: Oct 20 '17