Steering IP-CAM by Scene

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

This topic contains 1 reply, has 1 voice, and was last updated by  djandib 9 months, 3 weeks ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #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

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.