Steering IP-CAM by Scene

Domotica gratuit Forums How can I …? Synology NAS Steering IP-CAM by Scene

Ce sujet a 1 réponse, 1 participant et a été mis à jour par  djandib, il y a 5 mois et 3 semaines.

2 sujets de 1 à 2 (sur un total de 2)
  • Auteur
    Messages
  • #4120

    djandib
    Participant

    Hi,
    I hope someone can help me…
    My goal is to move my cam to position 1 if there is alarm 1, position 2 if alarm 2, and so on.
    Therefor I made a working php (Took about 2 weeks…)
    Inside php I use curl and I put the php to the servers of a webhoster with curl support.
    The php runs perfect, if I call it directly within the browser!!!
    BUT…
    If I use the php in a simply blocky rule nothing happens 🙁

    How du YOU control your IPCams?

    scene

    The php-code:
    <?php
    $username = ‘USER’;
    $password = ‘12345’;
    $url = ‘http://DDNS-Adress:Port/cgi-bin/hi3510/param.cgi?cmd=setimageattr&-brightness=0’;
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    ‘Accept text/html’, ‘Content-Type text/html’
    ));
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_USERPWD, $username.”:”.$password);
    curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
    curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 90);
    $output = curl_exec($ch);
    $info = curl_getinfo($ch);
    curl_close($ch);
    echo $output;
    ?>

    #4127

    djandib
    Participant

    No you who can help?

    I found the right way for the another Cam:

    <?php
    $username = ‘USERNAME’;
    $password = ‘PASSWORD’;
    $url = ‘http://DDNS/cgi-bin/hi3510/param.cgi?cmd=setimageattr&-brightness=0’;
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    ‘Accept text/html’, ‘Content-Type text/html’
    ));
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_USERPWD, $username.”:”.$password);
    curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
    curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 90);
    $output = curl_exec($ch);
    $info = curl_getinfo($ch);
    curl_close($ch);
    echo $output;
    ?>

    With a cam using “/hy-cgi/av.cgi?cmd” inside I always get an “500 Server Error”….
    Any idea?

    Andi

2 sujets de 1 à 2 (sur un total de 2)

Vous devez être connecté pour répondre à ce sujet.