Cannot connect rosbridge by other devices
Hi everyone, I'm trying to send a message using a web interface. Below is the section that connects my rosbridge_server
var ros = new ROSLIB.Ros({
url : 'ws://localhost:9090'
});
ros.on('connection', function() {
document.getElementById("status").innerHTML = "Connected";
});
ros.on('error', function(error) {
document.getElementById("status").innerHTML = "Error";
});
ros.on('close', function() {
document.getElementById("status").innerHTML = "Closed";
});
// Publishing a Topic
var test_button = new ROSLIB.Topic({
ros : ros,
name : "/button",
messageType : 'std_msgs/Byte'
});
function display1() {
var txt = new ROSLIB.Message({
data: 1
});
test_button.publish(txt);
}
After run rosbridge_server, and create a webserver using apache, I open my web interface on browser of my PC, node rosbridge_websocket announces client connected successfuly.
But when I use my smartphone, or other PC, I can still open my web interface, but rosbridge has no response.
I have tried on both ros kinetic and melodic.
Can anyone show me the solution? Sorry for my bad English.