In case someone wants to add PTZ control for a new Dahua IP Camera through ONVIF or API. In my case, am using a model P3AE-PV.
a) API: The camera responds to most API as per described in the "DAHUA IPC HTTP API" V1.00 that can be downloaded somewhere.
But it responds "Bad Request" when PTZ APIs are sent. I emailed Dahua tech support for possible new correct PTZ APIs but I have not received any response yet. So for now, the "Dahua" control script (file Dahua.pm) does not work for this model.
b) ONVIF: Using the "Onvif Viewer" ubuntu linux program, I was able to view the SOAP messages when PTZ commands are sent from the "onvif viewer". The messages are very similar to the ones created in the "Netcat Onvif" control script (file Netcat.pm). However, a few changes needs to be changed.
Under the Monitor Control Tab:
Control Type is "Netcat ONVIF". (can possibly create new control script named "Dahua ONVIF"?)
Control Device is "Profile000" (Profile001 may work?)
Control Address is "onvifusername:onvifpassword@ipaddress:port
note, the perl script parses and looks for a port after a ":" colon in the Control Address field. Can possibly add default port 80?
Autostop Timeout is "0.5" as suggested in almost all post.
In order for the control script to work, a few lines needs to be changed in the Netcat.pm file (or create a new dahua_onvif.pm file?)
line 121: programatically correct but seems written incorrectly in perl-language ?
< my $nonce = chr(int(rand(254))) for (0 .. 20);
---
> my @n; my $i = 0; while ($i < 20) { $n[$i] = chr(int(rand(254))); $i = $i + 1; } my $nonce = join("",@n);
(credit to user jef737 in https://github.com/ZoneMinder/zoneminder/issues/3412; my C/C++ knowledge does not carry over to perl).
line 128: (comparing the SOAP messages with that in the Netcat.pm)
< <UsernameToken xmlns="http://docs.oasis-open.org/wss/2004/01/ ... xt-1.0.xsd">
---
> <UsernameToken>
line 206 and in all the other perl function for each PTZ commands,
< my $cmd = 'onvif/PTZ';
---
> my $cmd = 'onvif/ptz_service';
Hope this helps somebody.
Have good day.
PTZ Dahua P3AE-PV
Discussions related to the 1.36.x series of ZoneMinder
Jump to
- General
- ↳ Announcements
- ↳ Website Issues
- Support
- ↳ ZoneMinder 1.36.x
- ↳ ZoneMinder 1.34.x
- ↳ Mobile Apps and Event Server
- ↳ Docker
- ↳ ZoneMinder Distributions
- ↳ ZoneMinder Translations
- ↳ Archive [End of Life Versions]
- ↳ ZoneMinder 1.35.x Development Branch
- ↳ ZoneMinder 1.33.x Development Branch
- ↳ ZoneMinder 1.32.x
- ↳ ZoneMinder 1.31.x
- ↳ ZoneMinder 1.30.x
- ↳ ZoneMinder 1.29.x
- ↳ ZoneMinder 1.28.x
- ↳ ZoneMinder 1.27.x
- ↳ ZoneMinder 1.26.x
- ↳ ZoneMinder 1.25.x
- ↳ ZoneMinder 1.24.x
- ↳ ZoneMinder Previous Versions
- Development
- ↳ ZoneMinder 1.37.x Development Branch
- ↳ Feature Requests
- ↳ User Contributions
- Miscellaneous
- ↳ ZoneMinder Hints & Tips
- ↳ Non-ZoneMinder Chat
- ↳ Jobs / For Sale / Wanted / Exchange
- ↳ Hardware Compatibility List
- ↳ Hardware Queries