Guten Morgen,
ich habe gestern Abend die app Cayenne getestet. Ich bin davon ausgegangen, dass ich wenigstens sehen kann was auf dem RaspberryPi installiert und verändert wird - falsch gedacht. Somit bekomme ich die Eingriffe durch diese App auch nicht ohne Backup wieder runter und natürlich habe ich den Klassiker - gestern noch dran gedacht vorher eines zu machen und es gelassen.
Nun mein Problem:
Ich habe eine Raspberry-Remote Lösung über ein php Gerüst laufen, welches mir jetzt Connection refused (111) anzeigt, statt die Datei hier
[code=php]<?php
/*
* Raspberry Remote
* http://xkonni.github.com/raspberry-remote/
*
* webinterface
*
*/
function daemon_send($target, $port, $output)
{
$fp = fsockopen($target, $port, $errno, $errstr, 30) or die("$errstr ($errno)\n");
fwrite($fp, $output);
$state = "";
while(!feof($fp))
{
$state .= fgets($fp, 2);
}
fclose($fp);
return $state;
}
/*
* get configuration
* don't forget to edit config.php
*/
require 'config.php';
/*
* get parameters
*/
if (isset($_GET['group'])) $nGroup=$_GET['group'];
else $nGroup="";
if (isset($_GET['switch'])) $nSwitch=$_GET['switch'];
else $nSwitch="";
if (isset($_GET['action'])) $nAction=$_GET['action'];
else $nAction="";
if (isset($_GET['delay'])) $nDelay=$_GET['delay'];
else $nDelay=0;
/*
* actually send to the daemon
* then reload the webpage without parameters
* except for delay
*/
$output = $nGroup.$nSwitch.$nAction.$nDelay;
if (strlen($output) >=
{
daemon_send($target, $port, $output);
header("Location: index.php?delay=$nDelay");
exit();
}
?>
<html>
<head>
<title>raspberry controls your home</title>
<link rel="stylesheet" href="style.css">
<link rel="icon"
type="image/png"
href="favicon.png">
<meta name="viewport"
content="
height = device-height,
width = device-width,
initial-scale = 1.0,
user-scalable = no ,
target-densitydpi = device-dpi
" />
</head>
<body>
<?php
/*
* links to change the delay
echo "<P>Delay: ";
echo "<A";
if ($nDelay == 0) echo " class=\"bold\"";
echo " HREF=\"index.php?delay=0\">0</A> | ";
echo "<A";
if ($nDelay == 5) echo " class=\"bold\"";
echo " HREF=\"index.php?delay=5\">5</A> | ";
echo "<A";
if ($nDelay == 15) echo " class=\"bold\"";
echo " HREF=\"index.php?delay=15\">15</A> | ";
echo "<A";
if ($nDelay == 30) echo " class=\"bold\"";
echo " HREF=\"index.php?delay=30\">30</A> | ";
echo "<A";
if ($nDelay == 60) echo " class=\"bold\"";
echo " HREF=\"index.php?delay=60\">60</A> ";
echo "</P>";
/*
/*
* table containing all configured sockets
*/
$index=0;
echo "<TABLE BORDER=\"0\">\n";
foreach($config as $current) {
if ($current != "") {
$ig = $current[0];
$is = $current[1];
$id = $current[2];
if ($index%2 == 0) echo "<TR>\n";
$output = $ig.$is."2";
$state = daemon_send($target, $port, $output);
if ($state == 0) {
$color=" BGCOLOR=\"#009999\"";
$ia = 1;
$direction="on";
}
if ($state == 1) {
$color=" BGCOLOR=\"#FF0099\"";
$ia = 0;
$direction="off";
}
echo "<a href=\"?group=".$ig;
echo "&switch=".$is;
echo "&action=".$ia;
echo "&delay=".$nDelay."\">";
echo "<div class=\"entry state" . $state . "\">";
echo "<div class=\"switch\"></div>";
echo "<span class=\"info\">".$id."</span>";
echo "</div>\n";
echo "</a>\n";
socket_close($socket);
}
else {
echo "<TD></TD>\n";
}
if ($index%2 == 1) echo "</TR>\n";
$index++;
}
echo "</TR></TABLE>";
?>
</body>
</html>
[/php]
kann mir jemand einen Tip geben, wie ich aus der Nummer wieder eine laufende Lösung baue?
Vielen Dank