Hallo,
ich habe ein Problem mit meinem Webinterface und ich hoffe ich finde hier hilfe.
Und zwar habe ich ein Webinterface geschrieben, welches ich bereits bei meinem RaspberryPi 2 in betrieb hatte.
Nun wollte ich das ganze auf mein BananaPi Umlagern.
Die Funkantenne habe ich bereits getestet mit
das funktioniert einwandfrei. Leider wird es nicht ausgeführt wenn ich im Webbrowser den Button meines Webinterfaces drücke.
Ich kann mich bei meinem RaspberryPi erinnern das gleiche Problem gehabt zu haben weiß aber nicht mehr wie ich es genau behoben habe.
Habe bereits so ziemlich alles versucht was die vergabe der Rechte angeht aber evtl. fehlt ja noch etwas anderes.
In Visudo habe ich
eingefügt.
Außerdem habe ich die Rechte für www-Data angepasst:
Mein BananaPi ist nur in meinem Heimnetz in Verwendung, daher ist das Thema Sicherheit nicht so wichtig.
Das Webinterface Steckdosen.php sieht wie folgt aus:
<head>
<title>Funksteuerung</title>
<meta name="viewport" content="width=device-width" />
</head>
<p style="margin-top: 30px;"></p>
<body>
<h1>Funksteuerung</h1> <?php // Überschrift in h1 ?>
<p style="margin-top: 20px;"></p> <?php // Absatz 10px ?>
<h2>Wohnzimmer</h2>
<form method="get" action="Steckdosen.php">
<input
type="submit"
style="cursor: pointer;
font: 12px Verdana,sans-serif;
color: #000000;
background-color: #00FF00;
width: 180px;
padding: 3px;
line-height: 130%;"
type="submit"
value="Wohnzimmerlampe an"
name="lampean">
<form method="get" action="Steckdosen.php">
<input
type="submit"
style="cursor: pointer;
font: 12px Verdana,sans-serif;
color: #000000;
background-color: #FF0000;
width: 180px;
padding: 3px;
line-height: 130%;"
type="submit"
value="Wohnzimmerlampe aus"
name="lampeaus">
</form>
</br>
<form method="get" action="Steckdosen.php">
<input
type="submit"
style="cursor: pointer;
font: 12px Verdana,sans-serif;
color: #000000;
background-color: #00FF00;
width: 180px;
padding: 3px;
line-height: 130%;"
type="submit"
value="Fernseher an"
name="tvan">
<form method="get" action="Steckdosen.php">
<input
type="submit"
style="cursor: pointer;
font: 12px Verdana,sans-serif;
color: #000000;
background-color: #FF0000;
width: 180px;
padding: 3px;
line-height: 130%;"
type="submit"
value="Fernseher aus"
name="tvaus">
</form>
</br>
<form method="get" action="Steckdosen.php">
<input
type="submit"
style="cursor: pointer;
font: 12px Verdana,sans-serif;
color: #000000;
background-color: #00FF00;
width: 180px;
padding: 3px;
line-height: 130%;"
type="submit"
value="Tannenbaum an"
name="tannenbauman">
<form method="get" action="Steckdosen.php">
<input
type="submit"
style="cursor: pointer;
font: 12px Verdana,sans-serif;
color: #000000;
background-color: #FF0000;
width: 180px;
padding: 3px;
line-height: 130%;"
type="submit"
value="Tannenbaum aus"
name="tannenbaumaus">
</form>
</br>
<h2> Küche </h2>
<form method="get" action="Steckdosen.php">
<input
type="submit"
style="cursor: pointer;
font: 12px Verdana,sans-serif;
color: #000000;
background-color: #00FF00;
width: 180px;
padding: 3px;
line-height: 130%;"
type="submit"
value="Küchenlicht an"
name="küchenlichtan">
<form method="get" action="Steckdosen.php">
<input
type="submit"
style="cursor: pointer;
font: 12px Verdana,sans-serif;
color: #000000;
background-color: #FF0000;
width: 180px;
padding: 3px;
line-height: 130%;"
type="submit"
value="Küchenlicht aus"
name="küchenlichtaus">
</form>
</br>
<h2>Schlafzimmer</h2>
<form method="get" action="Steckdosen.php">
<input
type="submit"
style="cursor: pointer;
font: 12px Verdana,sans-serif;
color: #000000;
background-color: #00FF00;
width: 120px;
padding: 3px;
line-height: 130%;"
type="submit"
value=" PC an"
name="pcan">
<form method="get" action="Steckdosen.php">
<input
style="cursor: pointer;
font: 12px Verdana,sans-serif;
color: #000000;
background-color: #FF0000;
width: 120px;
padding: 3px;
line-height: 130%;"
type="submit"
value="PC aus"
name="pcaus">
</form>
</br>
<?php
if(isset($_GET['lampean'])){
exec("sudo /home/pi/raspberry-remote/send 11010 4 1");
}
if(isset($_GET['lampeaus'])){
exec("sudo /home/pi/raspberry-remote/send 11010 4 0");
}
if(isset($_GET['pcan'])){
exec("sudo /home/pi/raspberry-remote/send 11111 1 1");
}
if(isset($_GET['pcaus'])){
exec("sudo /home/pi/raspberry-remote/send 11111 1 0");
}
if(isset($_GET['küchenlichtan'])){
exec("sudo /home/pi/raspberry-remote/send 11010 1 1");
}
if(isset($_GET['küchenlichtaus'])){
exec("sudo /home/pi/raspberry-remote/send 11010 1 0");
}
if(isset($_GET['tannenbauman'])){
exec("sudo /home/pi/raspberry-remote/send 11010 2 1");
}
if(isset($_GET['tannenbaumaus'])){
exec("sudo /home/pi/raspberry-remote/send 11010 2 0");
}
if(isset($_GET['tvan'])){
exec("sudo /home/pi/raspberry-remote/send 11010 3 1");
}
if(isset($_GET['tvaus'])){
exec("sudo /home/pi/raspberry-remote/send 11010 3 0");
}
?>
</body>
</html>
Alles anzeigen
Ich bin absolute Leihe in Sachen Skript schreiben, daher kann es durchaus sein das dort der Fehler liegt.
Über Hilfe bin ich sehr dankbar!
Liebe Grüße