Ja das sieht ganz danach aus. Liegt vermutlich an einem Fehler beim Restore des Errorhandlers, denn das findet in der Function applicationPing() nicht statt.
Du kannst mal die Function applicationPing() ersetzen mit:
Wie lange ist Edomi denn bei dir gelaufen bis der Fehler aufgetaucht ist? Bei mir ist der Fehler nämlich bislang nicht aufgetreten, obwohl mein Production System bestimmt auch mal 2 Wochen ohne Restart durchläuft.
Du kannst mal die Function applicationPing() ersetzen mit:
PHP-Code:
function applicationPing()
{
global $id;
static $i = 0, $j = 0;
error_off();
$j ++;
$cmd = '{"id":' . $j . ',"method":"get_prop","params":["power"]}';
$result = fwrite($this->socket, $cmd . "\r\n");
logging($id, "Sent PING: $cmd");
usleep(500000);
while ($line = fgets($this->socket, 1024)) {
logging($id, "Recv PONG: $line");
$read = json_decode($line);
if (isset($read) && is_object($read) && property_exists($read, 'id') && $read->id == $j) {
logging($id, "PING OK");
$i = 0;
logic_setOutput($id, 16, 1);
logic_setOutput($id, 17, date("d.m.Y - H:i:s"));
error_on();
return true;
}
}
$i ++;
logging($id, "PING FAIL ($i)");
if ($i >= 5)
logic_setOutput($id, 16, 0);
error_on();
return false;
}
Kommentar