Re: Foscam 18918W camera setup (Tested AOK)

186 visualizações
Ir para a primeira mensagem não lida

Carlos Jaramillo

não lida,
18/06/2012, 11:50:3918/06/12
para kmotion...@googlegroups.com
Thanks, Dave.

This finally worked by using the url with the snapshot.cgi
I have a few fish-eye lens cameras that I'm planning to undistorted before presenting them in the web interface (but this requires manual calibration with a checkerboard pattern, so it's not really user friendly). 

It would be cool to work out a kmotion (or motion) app. I'm teaching myself iPhone development. I'm using some app only to access the foscam camera and it works great for the pan/tilt. However, I can't seem to get the camera moving with the PT(Z) in Kmotion. Any ideas what to change? I'm choosing the motion driver, but the buttons don't move the camera at all.

My next step will be to get motion working with SSL. Do you have any instructions for that as well?

Thanks for your help. You've been great!

Carlos

On Thu, May 24, 2012 at 5:57 PM, kbmaniac <dave...@gmail.com> wrote:

With port forwarding to the camera I worked out the setup you will
need, its ...

device : network cam
url : http://xxx.xxx.xxx.xxx:<port if not standard>/snapshot.cgi
name : name
pass : password

kbmaniac

não lida,
18/06/2012, 14:23:4518/06/12
para Kmotion support


On Jun 18, 4:50 pm, Carlos Jaramillo <ubuntusl...@gmail.com> wrote:
> Thanks, Dave.
>
> This finally worked by using the url with the snapshot.cgi
> I have a few fish-eye lens cameras that I'm planning to undistorted before
> presenting them in the web interface (but this requires manual calibration
> with a checkerboard pattern, so it's not really user friendly).
>
> It would be cool to work out a kmotion (or motion) app. I'm teaching myself
> iPhone development. I'm using some app only to access the foscam camera and
> it works great for the pan/tilt. However, I can't seem to get the camera
> moving with the PT(Z) in Kmotion. Any ideas what to change? I'm choosing
> the motion driver, but the buttons don't move the camera at all.

See other post, kmotion PTZ control is laggy due to video delays in
motion

> My next step will be to get motion working with SSL. Do you have any
> instructions for that as well?

Well not really, but as a possible help if you look at
kmotion2>www>templates>vhosts_template, this is the template kmotion
uses to generate its vhosts file for apache after a kmotion restart -
this would be a good place to experiment :)

Cheers

Dave

Carlos Jaramillo

não lida,
08/07/2012, 23:52:3508/07/12
para kmotion...@googlegroups.com,dave selby
I'm trying to secure my motion web interface with SSL.

I got this far, but kmotion's web interface gets stuck while attempting the https://my_web/kmotion

STEPS:

1) First, I changed the web interface for the kmotion default root path by modifying the "vhosts_template" file in  /PATH_TO_KMOTION/kmotion/www/templates

    # Added by CARLOS
    ServerPath /kmotion_unsecure

2) $ kmotion restart
NOTE: if you read the /MY_PATH_TO_KMOTION/kmotion/www/vhosts/kmotion file, it should have appropriate generated changes

3) $ sudo service apache2 restart
Now, you could find the web interface at http://WHATEVER_NAME:PORT/kmotion_unsecure instead of the rooted http://WHATEVER_NAME:PORT

4) NEXT, I went to my apache config file for ssl (e.g /etc/apache2/sites-available/default-ssl)
And added the following:
 # KMOTION:
        # Redirect requests to /kmotion/ to /kmotion
        RewriteRule /kmotion?$ /kmotion/ [R=permanent]
        # Necessary redirection in order to be able to use  https://my_website.com/kmotion
        ProxyPass /kmotion http://localhost:8085/kmotion_unsecure
        # Not sure if needed:
        ProxyPassReverse /kmotion http://localhost:8085/kmotion_unsecure

5) And Restart Apache as usual
$ sudo service apache2 restart

6) However, I only see the "Loading motion" message and the grayed-out toolbar menu. 

Any ideas what I'm doing wrong at this point?

Carlos

dave selby

não lida,
09/07/2012, 03:47:0609/07/12
para kmotion...@googlegroups.com,dave selby
mmm ... not totally sure ...

So the HTML loading is AOK, the next thing that kmotion does to 'ungrey' the buttons and come alive is to load the config from the server via an xmlHttp object, sounds like its failing here. Now if the HTML got loaded I would have assumed that this would have worked as well, Only option I can think of is to tail /var/log/apache2 logs while reloading the web page, see if you get a hint of whats going on.

Hope this helps

Dave


KM.get_xmlHttp_obj = function () {

    // A function that generates and returns an appropreate 'xmlHttp' object for
    // the current browser
    //
    // expects :
    //
    // returns :
    // 'xmlHttp' ... 'xmlHttp' object

    var xmlHttp = null;
    try {           // Firefox, Opera 8.0+, Safari
        xmlHttp = new XMLHttpRequest();
    }
    catch (e) {     // Internet Explorer
        try {
            xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
        }
        catch (e) { // Internet Explorer 5.5
            xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
        }
    }
    return xmlHttp;
};


KM.load_settings = function (callback) {

    // a closure that loads the kmotion browser settings from the server
    // 'www_rc' file via an 'xmlHttp' call to 'xmlHttp_settings_rd.py'
   
    function get_settings(callback) {   
   
    // A function that retrieves raw 'www_rc' data from the server using
    // repeated 'xmlHttp' calls to 'xmlHttp_settings_rd.py'
    //
    // expects :
    // 'callback' ... the callback object
    //
    // returns :
    //
   
    // local 'xmlHttp' object to enable multiple instances, one for each
    // function call.
    var xmlHttp = KM.get_xmlHttp_obj();   
    var got_settings = false;
    function request() {
        xmlHttp.onreadystatechange = function () {
        if (xmlHttp.readyState === 4) {
            xmlHttp.onreadystatechange = null; // plug memory leak
            var data = xmlHttp.responseText;
            // final integrity check - if this data gets corrupted we are
            // in a world of hurt ...
            // 'data.substr(data.length - 5)' due to IE bug !
            if (parseInt(data.substr(data.length - 8), 10) === data.length - 13) {
            got_settings = true;
            KM.kill_timeout_ids(KM.GET_DATA);
            set_settings(data, callback);
            }
        }
        };
        xmlHttp.open('GET', '/cgi_bin/xmlHttp_settings_rd.py' + '?rnd=' + new Date().getTime(), true);
        xmlHttp.send(null);
    }
   
    function retry() {
        if (!got_settings) {
        request();
        KM.add_timeout_id(KM.GET_DATA, setTimeout(function () {retry(); }, 1500));
        }
    }
    retry();
    }

nathan.ren...@gmail.com

não lida,
30/05/2013, 09:56:2830/05/13
para kmotion...@googlegroups.com
The problem is: it's using absolute paths for the requests, so they're failing when it's being proxied. Attached patch changes them to relative for v2.51a (overwrite index.js with index.js.full after applying).
kmotion v2.51a relative paths.patch
Responder a todos
Responder ao autor
Reencaminhar
0 mensagens novas