안녕하세요 저는 현재 자신의 소프트웨어를 사용하여 Raspberry Pi로 로봇을 제어하고 있습니다. 나는 HTML 코드에 ssh를 삽입 할 수 있는지 궁금 해서요. 그래서 사용자가 Pi의 IP 주소를 입력하면 ssh를 통해 pi에 연결됩니다.웹 사이트에서 SSH를 사용하십시오.
그러면 버튼을 클릭 할 때 ssh를 통해 명령을 보내고 싶습니다. E.G. 뒤로.
그러면 데이터를 가져올 수 있다면 GPI 핀을 파이썬 코드를 통해 라즈베리 파이에서 제어 할 수 있습니다. 아래 그림과 같이
내가 제어 코드의 일부를 썼다 :
<html>
<head>
<style type="text/css">
#commands{
text-align: center;
color: FF8300;
font-size: 100px;
}
.controllbox{
width: 610px;
margin: 0 auto;
}
#arrowUp{
text-align: center;
position: static;
}
#arrowRight{
text-align: right;
position: static;
margin-top: 0;
}
#arrowDown{
text-align: center;
position: static;
}
#arrowLeft{
text-align: left;
position: static;
margin-top: -200px;
}
#stop{
width: 120px;
height: auto;
margin: 0 auto;
margin-top: -65%;
margin-left: 34%;
text-align: center;
position: static;
}
</style>
</head>
<body>
<h1 id="commands">Controll Me!!</h1>
<div class="controllBox">
<div id="arrowUp"><img src="arrowUp.jpg" class="controll" id="button1"></div>
<div id="arrowRight"><img src="arrowRight.jpg" class="controll" id="button2"></div>
<div id="arrowLeft"><img src="arrowLeft.jpg" class="controll" id="button3"></div>
<div id="arrowDown"><img src="arrowDown.jpg" class="controll" id="button4"></div>
<div id="stop"><img src="stop.jpg" class="controll" id="button5"></div>
</div>
<script type="text/javascript">
document.getElementById('button1').onclick = function(){
document.getElementById('commands').innerHTML = 'Foward'
}
document.getElementById('button2').onclick = function(){
document.getElementById('commands').innerHTML = 'Right'
}
document.getElementById('button3').onclick = function(){
document.getElementById('commands').innerHTML = 'Left'
}
document.getElementById('button4').onclick = function(){
document.getElementById('commands').innerHTML = 'Backwards'
}
document.getElementById('button5').onclick = function(){
document.getElementById('commands').innerHTML = 'Stop'
}
</script>
</body>
당신이나 내가 내 머리를 철수하고 같은 비슷한이 작업을 수행하는 방법을 알고 있다면 그것은 크게 감사합니다
, 내가 어떻게하는지 알아 내려고.
여러분의 도움에 많은 감사드립니다. James.
https://en.wikipedia.org/wiki/Web- 그것을 실행하는 명령 문자열을 포맷합니다 based_SSH – CBroe
https://github.com/aluzzardi/wssh – Bergi
또는 https://chrome.google.com/webstore/detail/secure-shell/pnhechapfaindjhompbnflcldabbghjo?hl=ko –