0

Is it possible to launch ssh connection after starting the raspberry PI using an html file and rosjs? Now the situation is the following: I'm starting my raspberry PI. Then I'm trying to connect my raspberry PI from my laptop using ssh ubuntu@.local I would like to start this communication automatically through my html webpage after launching my raspberry PI. Please help me to resolve this issue! My webpage has been served from raspberry PI. I am accessing it after establishing ssh connection between my laptop and my raspberry PI. Then I'm starting rosbridge_server and http server from my laptop to the raspberry PI. Then it's possible to access the webpage from the Web browser of my laptop. Here is my html code:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<script type="text/javascript" 
src="http://static.robotwebtools.org/roslibjs/current/roslib.min.js"></script>
<script type="text/javascript" type="text/javascript">
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";
});
</script>
</head>
<body>
  <h1>Simple ROS User Interface</h1>
  <p>Connection status: <span id="status"></span></p>
  <p>Last /txt_msg received: <span id="msg"></span></p>
</body>
</html>
tiho_bg
  • 1
  • 1
  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. – Community Sep 19 '22 at 12:57

0 Answers0