Page 1 of 1

How to test command curl 'http://localhost:4000/setcameraparam'

Posted: Wed Aug 28, 2019 8:21 am
by trungnvl1996
Hi,

My camera is PTZ with protocol : curl 'http://localhost:4000/setcameraparam'.
Could me test command with this protocol in Zoneminder.
I have seen another Camera use HTTP with api : ptzcontrol.cgi?, decoder_control.cgi?command=0&.

In my case, please give me a advise.

Thanks adn Best Regards,

Re: How to test command curl 'http://localhost:4000/setcameraparam'

Posted: Wed Aug 28, 2019 1:28 pm
by iconnor
You need to take one of the existing control scripts and modify it to use your urls.

This is not entirely easy. It might be in your interest to provide access to your camera and pay someone to do it for you, and include it in the official ZM dist.

Re: How to test command curl 'http://localhost:4000/setcameraparam'

Posted: Thu Aug 29, 2019 6:41 am
by trungnvl1996
Dear iconnor ,

I have FI8918W.pm.
Can I modify my $req = HTTP::Request->new( GET=>"http://".$self->{Monitor}->{ControlAddress}."/$cmd"."&".$self->{Monitor}->{ControlDevice});
to
curl 'http://localhost:4000/stopcamera' -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' -H 'Accept: application/json, text/javascript, */*; q=0.01' -H 'X-Requested-With: XMLHttpRequest' -H 'Connection: keep-alive' --data "camera_id=0" -i

I have tried my $req = "http://localhost:4000/stopcamera' -H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' -H 'Accept: application/json, text/javascript, */*; q=0.01' -H 'X-Requested-With: XMLHttpRequest' -H 'Connection: keep-alive' --data "camera_id=0" -i"

and add moveConRight to easy debug. I click right button and see log Sending http://... but not stop camera as expected