Blue Iris PTZ presets execute HTTP command for dahua camera

ronan

Young grasshopper
Joined
Jul 21, 2015
Messages
33
Reaction score
14
Hey all,

I'd like to use a preset in blue iris to make my dahua SD-59230s-hn go into "pan" mode.

This command works when i paste it into my browser (taken from the dahua HTTP API and something posted by bp2008):

http://192.168.1.92/cgi-bin/ptz.cgi?action=start&channel=0&code=AutoPanOn&arg1=0&arg2=0&arg3=0

It turns on the function you find in the webUI under PTZ - Function - Pan. The camera slowly rotates to the left horizontally. Good for wide open spaces.

I think I should be able to set this to preset 20 by right clicking my cam, hitting PTZ/control, going to edit presets, selecting preset 20, entering value "20", description "pan" and putting in the http:// command as above.

ptz.png

However it doesn't work (tried with and without the http:// prepended). The go button just gets greyed out, and after pressing ok and checking the preset list - nothing new is added.

Appreciate if someone can help!



I used the find/inspect method on this camera if that helps...

Opening port 80...
HTTP Get / request...
OK
ONVIF GetSystemDateAndTime
2016-09-23T12:19:00.000Z
Requesting device information...
Manufacturer: General
Model: SD59230S-HN
FirmwareVersion: 2.210.General 04.0.R, build: 2015-02-13
GetCapabilities...
Querying services
Has Imaging services: /onvif/imaging_service
Has media services: /onvif/media_service
Has RTP_RTSP_TCP, requesting profiles
first profile is MediaProfile000
first source is 000
requesting URI for profile MediaProfile000
RTSP URI: /cam/realmonitor?channel=1&subtype=0&unicast=true&proto=Onvif
Has Event services: /onvif/event_service
RelayOutputs: 1
RelayOutput: 000/Monostable/closed
InputConnectors: 2
Has Device IO services: /onvif/deviceIO_service
AudioOutputs: 1
Has PTZ service: /onvif/ptz_service
Preset: 1=Preset1
Preset: 2=Preset2
Preset: 3=Preset3
Preset: 4=Preset4
Preset: 5=Preset5
Preset: 6=Preset6
Preset: 7=Preset7
Preset: 8=Preset8
Preset: 9=Preset9
Preset: 10=Preset10
Preset: 11=Preset11
Preset: 12=Preset12
Preset: 13=Preset13
Preset: 14=Preset14
Preset: 15=Preset15
Preset: 16=Preset16
Preset: 17=Preset17
Preset: 18=Preset18
Done
 

bp2008

Staff member
Joined
Mar 10, 2014
Messages
12,666
Reaction score
14,006
Location
USA
Indeed, I also see the Go button get grayed out if I type anything in the URL box. It is unclear how this is supposed to work. You may want to contact the Blue Iris developer and ask, then report back with what you find.
 

ronan

Young grasshopper
Joined
Jul 21, 2015
Messages
33
Reaction score
14
Yep, did that, got an answer!
okay, so Ken said

"it is not currently using the camera's ID/password for this request ... can you put that at the beginning of the URL with

user@password@192.168.1.92/ etc


I will change this so if there's no authentication provided, it falls back to the camera's"



I was also trying to get the preset button to start a script. Just in case anyone is wondering about that, heres how to make it work...

Note: errors with your script are reported in status - messages (eg "PTZ:script error: 2/2"). Most of the time I had no error messages, but my scripts still didn't run. You have to do some tricks to make it work.

Heres an example:


Create a batch file called test.bat (open notepad and just save as test.bat)


edit test.bat and put something like "start PING 8.8.8.8" inside and save it. At this point you can double click your batch file to check it works.


In camera properties - PTZ - presets, in the "http:// or script:" box put the path to the bat file eg. \\computername\media\test.bat or D:\data\Media\test.bat

Now you can click the preset button from BI on the PC or from your mobile device, and the script will run on your PC.


If trying to run a python script or something i just put "start c:\python27\python.exe C:\Users\username\Desktop\hello.py" inside the .bat file
 
Top