New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
478 Basic ONVIF Support #479
Conversation
Great stuff, but I think you need to update from master first. |
Nice work. This pull request makes changes that I don't believe should change, like some of the deletions in configure.ac for example. Think @connortechnology hit the nail on the head. Also need to modify cmake files so it builds with cmake instead of autotools. |
I had old versions of .gitignore and configure.ac in my working copy. Should be fine now. |
Thank you for all the work you've done @altaroca Maybe it's just me, but I've found cmake to be a lot more intuitive than autotools. Check out the CMakeLists.txt files that are in each folder for examples. If you have any questions, let us know. We are usually online on the #zoneminder freenode irc channel. You are welcome to ask questions there too. |
You are right @knnniggett . It's easier than I thought. I used snippets from existing CMakelists and got a working cmake build. |
Created an ONVIF milestone and grouped all related issues to it. Note that there is an open bounty for this feature: |
I was able to build and test this today, and it seems the rpm package building process sniffed out a few perl module dependency issues:
It seems these specific modules are not defined, but are listed as a requirement in the onvif-control.pm script.
Should these require statements be more specific? e.g. require ONVIF::Media:Some::Module UPDATE: upon closer inspection, perhaps these require statements are not needed at all. |
Please disregard this script onvif-control.pm . It is mostly an empty template. I do not have access to an ONVIF PTZ cam and therefore did not implement this script. |
OK, I understand now. I have opened a pull request against your 478-onvif-support branch that will move the control script into the same place as the other control scripts. I've also added a database entry for it so it shows up in the UI. This will allow others to test it, and at the same time allow a packaged version of zoneminder to install w/o dependency issues. Hope that helps. |
@altaroca Thanks for merging that pull request. Any chance you can merge this one too? All it does is make the rpm packaging scripts aware of the new onvif folders added to the source tree. |
Sure. I did not see that one. This is my first experience with github. |
I have done the changes you proposed. It builds and works on my box. |
Think we regressed a little bit with commit 5ab6298 client.pm is looking for these packages, but they do not appear to be defined:
|
Those are parts of more APIs I am working on. I removed the references to keep things simple for the time being. |
Hmmmm.... now I'm stuck. Clicking "ONVIF" from the UI produces error 255. Here is the full output:
Tracing things back, it seems the sub ProbeOp in WSDiscovery.pm is causing this, but that's as far as I'm able to get at the moment. Thoughts? |
I don't know your setup. So I can only guess: I had hoped there would be no quirks. Sigh. XML parsers can be really bitchy about namespaces. Although the rest of the message is perfectly in order they refuse to understand it. I will figure out how to send and receive messages using both dialects. |
The zmonvif-probe.pl script now scans using both SOAP versions. Please give it another try. I cannot really test it because my camera works fine with SOAP 1.1. |
altaroca, I could try, but do not know how to add Onvif in ZM. Publish the instructions please, and I can test the script on two cameras. |
Great! Thank you for your support @Kanuk. Then build and install as you always do. In the monitor tab in ZoneMinder you should then have a new button "ONVIF". Please see the screenshots in http://altaroca.wordpress.com/2014/07/14/onvif-probing-for-zoneminder/ for a test walkthrough. |
@altaroca I've installed your zoneminder branch, but when i press the ONVIF button I get 'Unable to probe network cameras, status is '2'' |
@dreyks could you try and run |
@altaroca It seems to miss the Class/Std/Fast.pm in INC contains: /etc/perl /usr/local/lib/perl/5.18.2 /usr/local/share/perl/5.18.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.18 /usr/share/perl/5.18 /usr/local/lib/site_perl |
I will have to include this in the package dependencies. Please try to install SOAP::WSDL and have it pull all its dependencies in turn. The rpm should be named "perl-SOAP-WSDL_.rpm" or "libsoap-wsdl_.rpm". |
It's libsoap-wsdl-perl on Ubuntu. Also it was looking for
tried installing sha1 from http://launchpadlibrarian.net/85191944/libdigest-sha1-perl_2.13-2build2_amd64.deb but it is incompatible "Perl API version v5.14.0 of Digest::SHA1 does not match v5.18.0 at /usr/lib/perl/5.18/DynaLoader.pm line 207." |
On my Ubuntu 14.04 workstation, I can see libdigest-sha-perl in the universe repo. |
I've tried libdigest-sha-perl already, it's not the same. cpanm -i Digest::SHA1 did the trick. Proceeding to socket now Ok. everything is ok now, will continue testing later. Thanks |
That's weird. The description says it has SHA-1 in it. Wonder if the hyphen is messing things up. |
Over the weekend I tested the latest change that includes SOAP 1.2 support. A packet capture revealed three cameras responded with ws-discovery packets to zoneminder. The contents of the packets contained xml that included a SOAP 1.2 namespace. I can provide all or part of the packet capture if you think it would help. |
@knnniggett the packets' xml content would surely help. For the next commit I will include a kind of debug mode that prints the received xml content. |
Well, it looks like I saved the packet capture in a place I can't get to from my $dayjob. I'll post the data later this evening. In the meantime, just thought I'd point out the following in case you haven't figured it out already. |
I'll try to make this as readalbe as I can. Here are the details from my packet capture. IP Addresses of server & potential ONVIF devicesZoneMinder - 192.168.1.197 Relevant Packet Info192.168.1.197:3702 -> 239.255.255.250:3702 -> initial UDP multicast to discover devices 192.168.1.175:3702 -> 192.168.1.197:3702 -> UDP response from first device containing the following data: 192.168.1.80:3702 -> 192.168.1.197:3702 -> UDP response from second device containing the following data: 192.168.1.81:3702 -> 239.255.255.250:3702 -> Notice that the response from the third device was different. Instead of a unicast response, it responded with a multicast of its own with the following data: I have not had time to repeat this with verbosity turned on. Looks like I'll try that tomorrow night. |
The script sends first a SOAP 1.1 Probe message, then collects responses for two seconds. And then does the same for SOAP 1.2. I think the third XML message is not part of this conversation. It is a Hello message. Devices send this kind of message typically of their own accord when they are connected to the network or when some internal configuration has changed. |
Here is the output after performing "zmonvif-probe.pl probe -v":
|
@knnniggett you are right of course about ZoneMinder::Logger and GetOpt. As for the messages: I don't think these devices are onvif compliant. Their implementation of WS-Discovery is lacking. The Granstreams say they don't support the "Probe" method and the Foscam seems to reply with a "Hello" message always. The correct answer to a "Probe" message would be a "ProbeMatches" message. I am glad however that all three devices understand our SOAP 1.2 and don't complain about SOAP version mismatches anymore. If we go by the onvif specs then it is correct for the script not to return any matches for these devices. We could argue that the Hello message in this case contains all the necessary information to continue the automatic configuration. Let's try the next step manually for the Foscam. $ zmonvif-probe.pl profiles -v <URI> <SOAP ver> <user> <password> |
Not good. $ zmonvif-probe.pl profiles -v http://192.168.1.176:888/onvif/device_service 1.2 admin mypassword returns: Experimenting a bit. On another note, the Granstream devices are advertised as fully ONVIF compliant, so I have opened a trouble ticket with the mfr and await a response from them. |
$ sudo /usr/bin/zmonvif-probe.pl probe This is the error i get should I wait for complete list of cpan dependencies? |
@ibslkvic |
We are getting ready to release zoneminder 1.28.0, and I am still on the fence as to when we should add ONVIF support. I purchased a new camera from Urban Security Group, and it did not respond to the onvif probes so I am 0 for 3. On the other hand I think we might get more feedback if we merge this into the next release and let others ge their hands on it. With more data I think it would help us determine if we are dealing with manufacturers who don't implement onvif correctly or if there is something in the code we can make more flexible. What I think we ought to do is make ONVIF support optional, label it as experimental, and give a install default of "NO". What do you think? |
What about releasing 1.28 and then merging it into master for testing? |
I think we should be in feature freeze fr 1.28, so my vote is merge after release. Sounds like it needs more work/testing anyways. Not something you want the masses complaining about because it doesn't work. |
Merge after release. My day job has me occupied these weeks. |
@altaroca I created a couple pull requests against your onvif branch. |
Fix build issue with autotools
Make onvif support optional
is it easier to use https://github.com/ltoscano/ponvif as the onvif client library? |
that library supports only a small subset of the onvif specifications. |
Guys, this has been a long time coming, and my apologies for not merging this sooner. |
excellent work. I believe one of my cameras does onvif so I will test. |
TO DO:
|
I added basic onvif support. Please find details here: https://altaroca.wordpress.com
It includes an almost complete ONVIF API. That should explain the huge number of files.