Robotics StackExchange | Archived questions

How to start ssh automatically after launching raspberry PI?

Hi

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! I'm using rosbridge server. Here's 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>

Asked by tiho_bg on 2022-09-16 15:42:45 UTC

Comments

You are asking how to make your web browser run an application, which is not really a ros question. I suggest you do a search on stackoverflow.com, using keywords like:

browser content_type launch application

Asked by Mike Scheutzow on 2022-09-17 08:49:55 UTC

Answers