Steering IP-CAM by Scene

Gratis domotica Forums How can I …? Synology NAS Steering IP-CAM by Scene

Dit onderwerp bevat 1 reactie, heeft 1 stem, en is het laatst gewijzigd door  djandib 1 jaar, 7 maanden geleden.

2 berichten aan het bekijken - 1 tot 2 (van in totaal 2)
  • Auteur
    Berichten
  • #4120

    djandib
    Bijdrager

    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
    Bijdrager

    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 berichten aan het bekijken - 1 tot 2 (van in totaal 2)

Je moet ingelogd zijn om een reactie op dit onderwerp te kunnen geven.