How to start ssh automatically after launching raspberry PI?

asked 2022-09-16 15:42:45 -0500

tiho_bg gravatar image

updated 2022-09-17 01:46:01 -0500

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@<hostname raspberry="" pi="">.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>
edit retag flag offensive close merge delete

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

Mike Scheutzow gravatar image Mike Scheutzow  ( 2022-09-17 08:49:55 -0500 )edit