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

Forum for questions and support relating to 1.33.x development only.
Locked
trungnvl1996
Posts: 8
Joined: Tue Aug 20, 2019 9:36 am

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

Post 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,
User avatar
iconnor
Posts: 3197
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

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

Post 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.
trungnvl1996
Posts: 8
Joined: Tue Aug 20, 2019 9:36 am

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

Post 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
Locked