Closed botamochi6277 closed 4 years ago
Please try to change the address of ws server to your actual one, I think it should be the address of raspberry pi 4
This simple demo is designed to run the bridge and the web browser on the same machine.
Thank you for replying. I succeed to publish when i run the bridge and the web browser on the same raspberry pi. I fail to do, although, when i run the web browser on another pc with actual address (192.168.4.2).
I fail to do, although, when i run the web browser on another pc with actual address (192.168.4.2).
What's the error log? still net::ERR_CONNECTION_REFUSED
?
I suggest you could create a WebSocket
and try to connect to the address of raspberry pi, thus we could make sure it's reachable. Also, please run the bridge DEBUG=ros2-web-bridge* node bin/rosbridge.js
to enable debug output and get more useful information.
I succeed to publish topics with the web browser from my Mac (external PC).
I edit line 40 in examples/html/publisher.html
as below,
ros.connect('ws://localhost:9090');
-> ros.connect('ws://foxy.local:9090');
.
foxy
is hostname of my rospc running ros2-web-bridge.
Mac may try to connect 'ws://localhost:9090' as 'ws://[mac ip address]:9090'
.
Great! So could we close this issue now?
Yes, Please.
Close this issue, please feel free to reopen it if you still have problems, thanks!
I have connection error to publish from browser.
I logged in my ros pc (raspberry pi 4 installed foxy) with ssh and executed following command.
Terminal 1:
Terminal2:
When I opened
http://foxy.local:3000/html/publisher.html
from my host PC, the following page appeared.foxy
is hostname of the raspberrypi.Google Chrome said "WebSocket connection to 'ws://localhost:9090/' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED Ros.connect @ roslib.js:2224 (anonymous) @ publisher.html:39".