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

The error suggests the camera is not returning all the information. It could be that a video source is not selected or maybe the camera is not fully compliant. I will need to look closer but it looks like that part is irrelevant for just capturing a still image so I might be able to skip that part of the library. I will check it tomorrow morning and post an update if I can.

Where can I find the test version?
I will give it a try and send you new logfile

Log ID: 2020-05-16T21:42:45.127Z
App version 0.0.29

+0:0:0.0: ==== Discovery Starting ====
+0:0:0.374: Reply from {
“protocol”: “http:”,
“slashes”: true,
“auth”: null,
“host”: “192.168.1.196”,
“port”: null,
“hostname”: “192.168.1.196”,
“hash”: null,
“search”: null,
“query”: null,
“pathname”: “/onvif/device_service”,
“path”: “/onvif/device_service”,
“href”: “http://192.168.1.196/onvif/device_service
}
+0:0:4.665: ==== Discovery Finished ====
+0:0:0.4: Discovered: [
{
“name”: “192.168.1.196”,
“data”: {
“id”: “192.168.1.196”,
“port”: null
},
“settings”: {
“username”: “”,
“password”: “”,
“ip”: “192.168.1.196”,
“port”: “”
}
}
]
+0:0:20.16: Testing connection credentials
+0:0:0.5: --------------------------
+0:0:0.2: Connect to Camera 192.168.1.196: - Admin
+0:0:0.686: Connection Failed for 192.168.1.196 Port: Username: Admin
+0:0:0.19: Failed: TypeError: Cannot read property ‘width’ of undefined
at Cam. (/lib/onvif/lib/cam.js:687:74)
at Array.forEach ()
at Cam.getActiveSources (/lib/onvif/lib/cam.js:656:20)
at Cam. (/lib/onvif/lib/cam.js:200:14)
at Cam. (/lib/onvif/lib/media.js:930:14)
at /lib/onvif/lib/utils.js:103:6
at Parser. (/node_modules/xml2js/lib/parser.js:304:18)
at emitOne (events.js:116:13)
at Parser.emit (events.js:211:7)
at SAXParser.onclosetag (/node_modules/xml2js/lib/parser.js:262:26)

I’ve your same imou cam … Same problem.

I have published another test version (0.0.30) that:

  • Has extra diagnostics sent to the log,
  • Checks fir the presence of valid data

Could you try this and send me the log, even if it fixes the problem. I would like to understand why the data is not valid as there might be a better way to fix it other than the way that I have done it.

Thank you for persevering and helping me get to the bottom of this.

It fixes the problem,
Picture is seen!
Thanks!

Here is the log

Log ID: 2020-05-17T10:20:14.559Z
App version 0.0.30

+0:0:0.0: ==== Discovery Starting ====
+0:0:0.334: Reply from {
“protocol”: “http:”,
“slashes”: true,
“auth”: null,
“host”: “192.168.1.196”,
“port”: null,
“hostname”: “192.168.1.196”,
“hash”: null,
“search”: null,
“query”: null,
“pathname”: “/onvif/device_service”,
“path”: “/onvif/device_service”,
“href”: “http://192.168.1.196/onvif/device_service
}
+0:0:4.719: ==== Discovery Finished ====
+0:0:0.7: Discovered: [
{
“name”: “192.168.1.196”,
“data”: {
“id”: “192.168.1.196”,
“port”: null
},
“settings”: {
“username”: “”,
“password”: “”,
“ip”: “192.168.1.196”,
“port”: “”
}
}
]
+0:0:10.930: Testing connection credentials
+0:0:0.4: --------------------------
+0:0:0.1: Connect to Camera 192.168.1.196: - Admin
+0:0:0.573: VideoSources: [
{
": { "token": "000" }, "framerate": 25, "resolution": { "width": 1920, "height": 1080 } } ] +0:0:0.4: ActiveSource [0] = { "”: {
“token”: “000”
},
“name”: “VideoEncoderConfig_Channel1_MainStream”,
“useCount”: 1
}
+0:0:0.6: CONNECTED to 192.168.1.196
+0:0:0.5: Valid
+0:0:1.637: Initialising CameraDevice (192.168.1.196)
+0:0:0.15: CameraDevice has been added (" + this.id + ")
+0:0:2.75: Saved Credentials
+0:0:0.6: --------------------------
+0:0:0.2: Connect to Camera 192.168.1.196: - Admin
+0:0:0.268: VideoSources: [
{
": { "token": "000" }, "framerate": 25, "resolution": { "width": 1920, "height": 1080 } } ] +0:0:0.7: ActiveSource [0] = { "”: {
“token”: “000”
},
“name”: “VideoEncoderConfig_Channel1_MainStream”,
“useCount”: 1
}
+0:0:0.3: CONNECTED to 192.168.1.196
+0:0:0.64: ** PushEvent supported on 192.168.1.196
+0:0:0.42: Camera Information (192.168.1.196): {
“manufacturer”: “Lechange”,
“model”: “IPC-G22”,
“firmwareVersion”: “2.680.0000000.16.R, Build Date 2019-11-25”,
“serialNumber”: “5K01318PAJ15249”,
“hardwareId”: 1
}
+0:0:0.86: Camera (192.168.1.196) supports PullPoint
+0:0:0.424: Supported Events(192.168.1.196): MOTION,TAMPER,CROSSED,OBJECTSINSIDE,OBJECTSABANDONED,OBJECTSMISSING,FACE,SCENETEMPERATURE,FIREALARM,MOTIONALARM,ANALYTICSSERVICE,VIDEOENCODERCONFIGURATION,AUDIOENCODERCONFIGURATION,DETECTEDSOUND,IPCONFLICT,PROFILECHANGED,CONFIGURATIONCHANGED
+0:0:0.140: Snapshot URL: http://192.168.1.196/onvifsnapshot/media_service/snapshot?channel=1&subtype=0
+0:0:0.3: SnapShot save file (192.168.1.196) = eventimage192_168_1_196.jpg
+0:0:0.3: Initialising event image (192.168.1.196)
+0:0:0.7: Fetching event image (192.168.1.196)
+0:0:0.66: Fetching (192.168.1.196) Motion Event image from: http://192.168.1.196/onvifsnapshot/media_service/snapshot?channel=1&subtype=0
+0:0:1.74: Event Image Updated (192.168.1.196)
+0:0:1.815: Registering event image (192.168.1.196)
+0:0:0.5: Registering now image (192.168.1.196)
+0:0:0.4: Camera (192.168.1.196) is ready
+0:0:0.134: registered event image (192.168.1.196)
+0:0:0.7: registered now image (192.168.1.196)
+0:0:7.999: Switch motion detection On (192.168.1.196)
+0:0:0.12:

Waiting for Push events (192.168.1.196)

+0:0:0.4: Setting up Push events (192.168.1.196) on: http://192.168.1.159:9998/onvif/events?deviceId=192.168.1.196
+0:0:0.107: Subscribe response (192.168.1.196): 192.168.1.196Info: http://192.168.1.196/onvif/Subscription?Idx=0
+0:0:0.66: Push Event found Device: 192.168.1.196
+0:0:0.6:
– Event detected (192.168.1.196) –
+0:0:0.4: Event data: (192.168.1.196) RuleEngine/CellMotionDetector/Motion: IsMotion = false
+0:0:0.6: Ignoring unchanged event (192.168.1.196) IsMotion = false
+0:0:0.30: Push Event found Device: 192.168.1.196
+0:0:0.23:
– Event detected (192.168.1.196) –
+0:0:0.14: Event data: (192.168.1.196) VideoSource/MotionAlarm: State = false
+0:0:0.6: Ignoring event type (192.168.1.196) VideoSource/MotionAlarm: State = false
+0:0:0.86: Push Event found Device: 192.168.1.196
+0:0:0.12:
– Event detected (192.168.1.196) –
+0:0:0.13: Event data: (192.168.1.196) VideoSource/GlobalSceneChange/AnalyticsService: State = false
+0:0:0.12: Ignoring event type (192.168.1.196) VideoSource/GlobalSceneChange/AnalyticsService: State = false
+0:0:0.27: Push Event found Device: 192.168.1.196
+0:0:0.12:
– Event detected (192.168.1.196) –
+0:0:0.13: Event data: (192.168.1.196) Monitoring/ProcessorUsage: Value = 0.36
+0:0:0.12: Ignoring event type (192.168.1.196) Monitoring/ProcessorUsage: Value = 0.36
+0:0:0.26: Push Event found Device: 192.168.1.196
+0:0:0.18:
– Event detected (192.168.1.196) –
+0:0:0.14: Event data: (192.168.1.196) Monitoring/OperatingTime/LastReboot: Status = 16-05-2020T13:59:33Z
+0:0:0.14: Ignoring event type (192.168.1.196) Monitoring/OperatingTime/LastReboot: Status = 16-05-2020T13:59:33Z
+0:0:0.25: Push Event found Device: 192.168.1.196
+0:0:0.12:
– Event detected (192.168.1.196) –
+0:0:0.14: Event data: (192.168.1.196) Monitoring/OperatingTime/LastReset: Status = Thu Jan 01 1970 01:00:00 GMT+0100 (CET)
+0:0:0.12: Ignoring event type (192.168.1.196) Monitoring/OperatingTime/LastReset: Status = Thu Jan 01 1970 01:00:00 GMT+0100 (CET)
+0:0:0.16: Push Event found Device: 192.168.1.196
+0:0:0.3:
– Event detected (192.168.1.196) –
+0:0:0.3: Event data: (192.168.1.196) Monitoring/OperatingTime/LastClockSynchronization: Status = Thu Jan 01 1970 01:00:00 GMT+0100 (CET)
+0:0:0.7: Ignoring event type (192.168.1.196) Monitoring/OperatingTime/LastClockSynchronization: Status = Thu Jan 01 1970 01:00:00 GMT+0100 (CET)
+0:0:0.528: Switch motion detection Off (192.168.1.196)
+0:0:0.10: Unsubscribe push event (192.168.1.196): http://192.168.1.196/onvif/Subscription?Idx=0

Hi Adrian,

I think you had seen it before. There are some screenshots, too. It’s working with all devices of class CAMERA and the link set in the device.
If your device offers the url property, it can be used in Homeydash. You have to add the code in a self hosted version because I think Dannee didn’t include it in his online version.

Excellent, I’m happy it’s fixed it.
Thanks for the log, I can ponder on that later to see if I can figure out why the information is not coming back as expected.

1 Like

Yep, I did find the information in the homeydash topic. I have also asked if the feature can be added as standard as I think it is pretty cool.

Translation Help
I am still hoping I can get some help with translation for the app.
I have created a spreadsheet with the text in ONVIF texts.xlsx.
If you would be so kind to help I will obviously name you in the app translators section (if you want to be named).
I would just use Google but I am aware that it doesn’t always get the correct context like a human does.
Thanks,

Hi Adrian, ITALIAN translation i ready only I do not know how to upload the file …

1 Like

If you have a Github account you can post it in https://github.com/AdyRock/com.onvif/issues/4
I have also sent my email address to you via pm if that’s easier.

I pick up Dutch

2 Likes

I have pushed a new test version (0.0.32) which has German, Dutch and Italian translations.

Hi Adrian:

Currently I am running 0.0.33 via github link.

No confirmation received when adding a camera, nor when sending a logfile

I use a door spy hole camera from Xmeye camera_e548, Onvif open ports 8899/ 9530 /34567 and H265 ports 80/554.

I get an errror message cannot read property ‘raw’ of undefined. I have sent you 3 logfiles (2x 0.0.24 1x 0.0.33).

Hope this is usefull for debugging, thank for your development efforts!

Regards Hans

Hi, could you install the latest test version from the Homey app store. The link is https://homey.app/en-gb/app/com.onvif/ONVIF-Camera/test/
The send log feature doesn’t work when installed via Github because it uses a protector mail server.
Alternatively copy the log and send it to me via a PM.

My Eminent EM6330 camera’s are working nicely with your app, great work! No ONVIF motion detection, but I think that’s a camera limitation (and can be overcome by using the Synology app) :+1:

1 Like

Is it possible to add an option when selecting a camera to view snapshot instead of (last) motion picture, now it always show last motion and you have to select snapshot…

Thx

The order of the images is defined by the order they are created and I can’t see a way in the UI to select one when the section is displayed. Therefore, all I can do is change the order of the code so the now image is created before the motion image when the app / driver is started.

Check out the test version to see if that is OK.