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

Revision history [back]

Normally I open the shell of Ubuntu and write ssh ubuntu@ubiquityrobot.local. Then I have to write the password and finally I can access my raspberry PI. I would like to make the same procedure with my webpage but without using the shell. Therefore I think that I need this function mainSocket.onopen = ...

I understand. Based on the above information, I need to make the following points:

  1. Do you really need ssh access to the Raspberry PI using a WebSocket? Please think about it!
  2. You are using the same port, i.e., 8080, for two purposes, which is incorrect. By default, rosbridge_server and ssh runs on 9090 and 22 port, respectively. Please check and correct those port numbers.
  3. Lastly, it seems difficult to make an ssh connection using a WebSocket. Moreover, I do not understand why someone would pick a WebSocket to connect to an ssh server. Please read a similar question asked in StackOverflow for further details.

First, you are connecting to rosbridge_server at ws://192.168.100.34:8080, and then you are creating a WebSocket at the same URI. Later you seem to send data to that socket. This is probably the cause of the error. You should not touch the URI for rosbridge_server again. Furthermore, the default port for rosbridge_server is 9090. If I remember correctly, port 8080 was used by tomcat in the past. So, I would not pick this port number for rosbridge_server.

Normally I open the shell of Ubuntu and write ssh ubuntu@ubiquityrobot.local. Then I have to write the password and finally I can access my raspberry PI. I would like to make the same procedure with my webpage but without using the shell. Therefore I think that I need this function mainSocket.onopen = ...

I understand. Based on the above information, I need to make the following points:

  1. Do you really need ssh access to the Raspberry PI using a WebSocket? Please think about it!
  2. You are using the same port, i.e., 8080, for two purposes, which is incorrect. By default, rosbridge_server and ssh runs on 9090 and 22 port, respectively. Please check and correct those port numbers.
  3. Lastly, it seems difficult to make an ssh connection using a WebSocket. Moreover, I do not understand why someone would pick a WebSocket to connect to an ssh server. Please read a similar question asked in StackOverflow for further details.