[APP][Pro] Support for ONVIF compatible cameras (Release 2.0.41)

Adrian, I bought a new camera a Dahua DH-SD22204t-GN-W. your App found this camera in version 006 but no longer in version 010 and also not in version 011 for the last two I sent you an error report. I can’t enter a username or passwd anywhere. The Camera works with the Dahua app.

I have reinstalled version 006 and the camera is found again

in 006 the snapshot does not work because there is an incorrect SnapShot URL in the error log

Hi @Octo
Thanks for sending the reports. That has tested that feature for me and hopefully helped me find the cause of the problem. It seems that camera returns a null port which was causing an issue in the latest versions.

A new test version (0.0.12) is now available that should fix that.

Oops, I have just read the last bit of your message. I will guess that is also an issue with the null port so I will investigate.

Adrian, 012 sees the camera again, an error report has been sent. good luck :slightly_smiling_face:

This one is not so obvious so I have created a new test version (0.0.13) that puts some extra log messages through the suspect section of the code to narrow down the problem area.
Thanks for your patience and testing.

Adrian 013 installed. Snapshot window now appears but no Snapshot, invalid_content_type. New error log sent.

I tested the URL http://xxx.xxx.xxx.xx/onvifsnapshot/media_service/snapshot?channel=1&subtype=0 in my brouser and that works after entering username and password

I test the new version 0.0.9 and i have the same problem. i didn’t have the screen with motion event and change it to NOW nothing. Even the Has Motion i changed from yes to no and no to yes. Nothing changed.The screen Motion Event didn’t apear.

I installed 0.0.13 Motion event screen works now but i got the message “object response” on the screen. Even the log Works again. I have send you the log.

Could you try entering in your browser:
http://xxx.xxx.xxx.xx/onvifsnapshot/media_service/snapshot?channel=1&subtype=0&usr=admin&pwd=YOUR_PASSWORD
Obviously replace xx… with the camera IP and YOUR_PASSWORD with the password for the camera.
Normally the call to getSnapshotURI returns the full URL but it appears on your camera it is not including the user name and password.
If it works in the browser with the username and password on the end of the URL then I can try and detect when it is missing and add it to the returned string.

The log shows (assuming I am looking at the correct log) your camera is dropping off the network a lot so I’m not sure if that is causing the problems.

I have now ordered a Hikvision camera to try so hopefully that will help get to the bottom of the issues.

tested and t works :grinning:

That’s good. I will try to detect if the login details are missing from the snapshot URL and append them when required.
Life would be much easier if all the cameras were consistent :slight_smile:

It is already difficult to choose the right camera. Onvif on Chinese cameras is also strange

in the Brouser on my PC the link works but on my Ipad I still have to enter username and password, this in Siri and also in Google Chrome

This URL works immediately in Siri on the Ipad
http://xxx.xxx.xxx.xx/cgi-bin/snapshot.cgi?chn=0&u=username&p=paswd

not always, I don’t understand anymore :crazy_face: :upside_down_face:

in google crome on the Ipad the link works, in siri a username and passwd must be entered

OK, new test version (0.0.14) available. This adds the user name and password on the end of the URI if it was not found.
Hopefully it won’t break it for others as I have found that my three types of camera come back with various combinations of pwd or password and usr or user.
I have also added the full URL object to the log as it contains other information on my cameras, nothng useful, but maybe yours has something I can more reliably detect to know it requires the credentials appended.

Adrian, update to 0.0.14 snapshot scean in the app is gone, log sent.
app reinstalled still no snapshot screan, log sent again

New test version (0.0.15).
Improved error reporting and fixed a typo that might have been the problem you experienced.

Adrian, updated to 0.0.15 snapshot screen is back. error message unauthorized. app and error log is empty. reinstalled the app, error message remains. an error log that I have forwarded to you. what I find strange is that since testing this camera I have to login to the homey forum again and again.

Hmm, Interesting! The getSnapshotURL function is returning:

2020-04-26T07:36:30.827Z: Snap URL: {
“uri”: “http://192.168.192.24/onvifsnapshot/media_service/snapshot?channel=1&subtype=0”,
“invalidAfterConnect”: true,
“invalidAfterReboot”: true,
“timeout”: “PT0S”
}

I found this online for another camera:

Everfocus has some other peculiar behavior with their GetUri responses. They return with both invalidAfterConnect and invalidAfterReboot flags set to true, which ONVIF says should always be set to false. This means that you need to call GetUri for every snapshot you request, even though it returns the same uri. If you don’t you get a 404.

So there maybe something in that which explains the problem. I will try changing the mechanism to get the URI just before each snapshot to see if that works.

Great and good luck :slightly_smiling_face:

OK a new test version is available. I’m not sure if it will fix the issue as the camera is not complying to the standards so the fix is also ‘non-standard’ :wink:

Hi @Adrian_Rockall do you know why motion detection does not work? I have this camera and it is a real bummer the motion trigger doesnt work on onvif.