Problem: "Call to undefined function" Version: 09.07.15 e22

10:27:02 | 00000 | WARNING | ScriptEngine         | Ergebnis für ScriptID #53646: <br />
<b>Fatal error</b>:  Call to undefined function mb_convert_encoding() in <b>/usr/share/symcon/scripts/FBF_Control.ips.php</b> on line <b>635</b><br />

Lief bisher problemlos:

function GetFBFsid($host, $path, $pw) {    // Login in die Fritzbox versuchen
    $ch = curl_init('http://' . $host . $path);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    $SID = simplexml_load_string(curl_exec($ch));

    if ( @$SID->SID != '0000000000000000' ) {
        curl_close($ch);
        return strval(@$SID->SID);
    } else {
        $Frage = $SID->Challenge;
        $Antw = $Frage . '-' . md5(mb_convert_encoding($Frage . '-' . $pw, "UCS-2LE", "UTF-8"));   //das ist line 635
        curl_setopt($ch, CURLOPT_POSTFIELDS, "response={$Antw}&page=$path");
        $SID = simplexml_load_string(curl_exec($ch));

        if ( $SID->SID != '0000000000000000' ) {
            curl_close($ch);
            return strval($SID->SID);
        } else {
            curl_close($ch);
            return false;
        }
    }
    curl_close($ch);
}

Viele Grüsse
Harald

Moin!

Guckst du hier ab #7 :slight_smile: :wink:

IP-Symcon Community Forum

Grüße,
Chris

10:40:06 | 00000 | WARNING | ScriptEngine         | Ergebnis für ScriptID #32123: <br />
<b>Warning</b>:  Parameter type of ID does not match in <b>/usr/share/symcon/scripts/ObjIDsIPS.ind.inc.php</b> on line <b>233</b><br />
Bluetooth_Scanner.ips.php: Time-Out von Semaphore BluAktiv ()

Lief bisher problemlos (ohne das string-casting, aber auch damit nicht):

function SetIPSsem ($Sem, $Repeat = 100) {
    global $_IPS;
    settype ($Sem, "string");
    $i = 10;
    do {
        $i ++;   // nothing
        if ($i > $Repeat)
            die (IPS_GetScriptFile ($_IPS['SELF']) . ': Time-Out von Semaphore ' . $Sem . " (" . IPS_GetLocation ((string) $Sem) . ")");
    } while (IPS_SemaphoreEnter ((string)$Sem, $i) != true);
}

Fehlermeldung kommt wahrscheinlich wg. dem geänderten Verhalten von IPS: „Zahlen als String nicht erlaubt“

ABER: obwohl in der Ansicht ‚PHP Informationen‘ nichts aufgeführt wird, ist seit gestern abend ein Semaphor gesetzt:
Test

<?
// Test_Semaphoren.ips.php

if (IPS_SemaphoreEnter ('BluAktiv', 1000)) {
    print("
Ablauf: BluAktiv gesetzt");
    if (IPS_SemaphoreEnter ('BluAktiv', 10)) {
        print("
Fehler: BluAktiv doppelt gesetzt");
    } else {
        print("
Ablauf: BluAktiv abgewiesen, weil bereits gesetzt");
    }  // Ende Semaphore-Kreis2
    IPS_SemaphoreLeave ('BluAktiv');       // und freigeben
    print("
Ablauf: BluAktiv zurückgesetzt");

    if (IPS_SemaphoreEnter ('BluAktiv', 10)) {
        print("
Ablauf: BluAktiv wiederholt gesetzt");
    } else {
        print("
Ablauf: BluAktiv abgewiesen, weil bereits zum 2ten mal gesetzt");
    }  // Ende Semaphore-Kreis2
    IPS_SemaphoreLeave ('BluAktiv');       // und freigeben
    print("
Ablauf: BluAktiv wieder zurückgesetzt");
} else {
    print("
Fehler: BluAktiv fremdgesetzt");
}  // Ende Semaphore-Kreis1

?>

bringt


Fehler: BluAktiv fremdgesetzt

Wäre das Semaphor nicht gesetzt, wäre das Ergebnis:


Ablauf: BluAktiv gesetzt
Ablauf: BluAktiv abgewiesen, weil bereits gesetzt
Ablauf: BluAktiv zurückgesetzt
Ablauf: BluAktiv wiederholt gesetzt
Ablauf: BluAktiv wieder zurückgesetzt

Viele Grüsse
Harald

Das sollte doch in der neusten Version bereinigt sein:

-Fix: PHP ist nun mit cURL Support kompiliert

Das soll e22b700a2d43 sein. Verstehe nicht, warum mir trotz Update nur e22b700a angezeigt wird.

Viele Grüsse
Harald