rosjava - Subscriber java.net.ConnectException: localhost/127.0.0.1:37172 - Connection refused [closed]
Hello,
I am trying to start a ros Subscriber an android device. My sourcecode look like:
String hostLocal = InetAddressFactory.newNonLoopback().getHostAddress();
String hostMaster = ((EditText)findViewById(R.id.txtHostValue)).getText().toString();
Integer port = Integer.parseInt(((EditText)findViewById(R.id.txtPortValue)).getText().toString());
URI uri = URI.create("http://" + hostMaster + ":" + port);
NodeConfiguration nodeConfiguration = NodeConfiguration.newPublic(hostLocal, uri);
nodeConfiguration.setMasterUri(uri);
nodeConfiguration.setNodeName("nodeName");
nodeRunner.run(new Listener(), nodeConfiguration);
If i start the ros-master local on my android device - it works fine. But if the master is running an my PC (for example: hostMaster = "192.168.178.29"), i get an error:
E/UpdatePublisherRunnable(10630): java.lang.RuntimeException: java.net.ConnectException: localhost/127.0.0.1:37172 - Connection refused
by trying to debug your sourcecode and I have seen in 'MasterClien.java' file a following function:
return Response.fromListChecked(node.registerSubscriber(slave.getName().toString(), subscriber
.getTopicName().toString(), subscriber.getTopicMessageType(), slave.getUri()
.toString()), new UriListResultFactory());
Befor I had called a funciton, I had follwing screen:
But after calling of function I have seen:
You can see, that after calling a funciton it is the uri of client not the same. Is this issue known or not. What can I do?