Closed scottjjr closed 1 year ago
Hi there. Thanks for leaving the comment.
I haven't really looked into those things as of yet. I don't have cameras myself that have those features, so would be dependent on others for a lot of experimentation and testing. I'd also want to avoid building things that are brand-specific.
Take a look at this document that lays out the supported features by ONVIF profile: https://www.onvif.org/wp-content/uploads/2022/04/onvif-profile-feature-overview.pdf
Profile T has motion region events and Profile M has a line crossing counter. Do you know if those are what you are looking for? Otherwise it's possible that events that you are referring to are already being sent as part of the general event support and we simply need to look for them and act on them.
If you are willing to help me figure this out, I'm happy to work on it with you. You'd need the CLI to run logs and have the time to run many iterations of drivers until we got it right...
Just FYI, I'm working on line detection now. Hope to have it available in the next week or so.
Hi - if you are still interested, I have line detection and tamper implemented in a test driver on an alternate channel here: https://bestow-regional.api.smartthings.com/invite/qWjB96yW9lyR
Hi Todd,Thanks! Will be happy to test//JoakimSent from my iPhoneOn 12 Nov 2022, at 20:15, Todd Austin @.***> wrote: Hi - if you are still interested, I have line detection and tamper implemented in a test driver on an alternate channel here: https://bestow-regional.api.smartthings.com/invite/qWjB96yW9lyR
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>
Hi - if you are still interested, I have line detection and tamper implemented in a test driver on an alternate channel here: https://bestow-regional.api.smartthings.com/invite/qWjB96yW9lyR
Brilliant will have a look - many thanks!
Hmmm so I have a general problem, the camera configured ok but then seems to become un-reachable after a few minutes. I cannot refresh it as it says unresponsive but the camera is definitively there and still on the same IP. Is there some debugging info somewhere I can use to see what’s going on?
Are you able to install the SmartThings CLI? If you have a windows machine on your LAN, it's pretty easy to do. Here is the install file.
Once you get that installed, open a command prompt window, navigate to the right directory, then make sure it is working with this command
smartthings devices
It will probably open a web page for you to authorize access to SmartThings. Once you complete that (needed only the first time you run the CLI) return to the command prompt window and you should see a list of all your devices.
With that working, you can fire up logging for the ONVIF driver:
smartthings edge:drivers:logcat
You'll be prompted for your hub IP address and the driver you want to monitor.
Once that is running, you can tap the refresh button in the app for the camera device, and you should see a bunch of activity. Post that back here and we can see what's going on.
Hi, as below.
It worked for about 10 minutes then stopped. When trying to refresh this happens.
Thanks.
2022-11-18T22:22:14.123254151+00:00 TRACE ONVIF Video Camera V1.3 Received event with handler capability 2022-11-18T22:22:14.190678151+00:00 INFO ONVIF Video Camera V1.3 <Device: 0bb04db4-e68e-4fb3-8859-fafed052fbe5 (Garage Camera)> received command: {"args":{},"capability":"partyvoice23922.refresh","command":"push","component":"info","positional_args":{}} 2022-11-18T22:22:14.256780818+00:00 TRACE ONVIF Video Camera V1.3 Found CapabilityCommandDispatcher handler in onvifDriver 2022-11-18T22:22:14.272638818+00:00 INFO ONVIF Video Camera V1.3 Refresh requested 2022-11-18T22:22:14.302650818+00:00 INFO ONVIF Video Camera V1.3 Starting Device Initialization routine for Garage Camera 2022-11-18T22:22:14.423683485+00:00 INFO ONVIF Video Camera V1.3 <Device: 0bb04db4-e68e-4fb3-8859-fafed052fbe5 (Garage Camera)> emitting event: {"attribute_id":"info","capability_id":"partyvoice23922.onvifinfo","component_id":"info","state":{"value":"<!DOCTYPE html>\n<HTML>\n<HEAD>\n<style>\ntable, td {\n border: 1px solid black;\n border-collapse: collapse;\n font-size: 11px;\n padding: 3px;\n}\n</style>\n</HEAD>\n<BODY>\n<table>\n<tr><td>IP addr: 10.1.1.9</td></tr>\n<tr><td>Name: IPC-T281H-MU</td></tr>\n<tr><td>Hardware: IPC-T281H-MU</td></tr>\n<tr><td>Profile: Streaming</td></tr>\n<tr><td>Profile: G</td></tr>\n<tr><td>Profile: T</td></tr>\n<tr><td>urn:uuid:55218000-eff9-11b4-8397-acb92f7c0ed0</td></tr>\n</table>\n</BODY>\n</HTML>\n"}} 2022-11-18T22:22:14.531814818+00:00 DEBUG ONVIF Video Camera V1.3 Sending GetSystemDateAndTime request to http://10.1.1.9/onvif/device_service 2022-11-18T22:22:14.677526818+00:00 DEBUG ONVIF Video Camera V1.3 HTTP Response Header: HTTP/1.1 401 Unauthorized 2022-11-18T22:22:14.693040485+00:00 DEBUG ONVIF Video Camera V1.3 auth_record: 2022-11-18T22:22:14.698569818+00:00 ERROR ONVIF Video Camera V1.3 Unexpected condition: HTTP 401 returned without WWW-Authenticate header 2022-11-18T22:22:14.715374485+00:00 ERROR ONVIF Video Camera V1.3 Failed to get date/time from http://10.1.1.9/onvif/device_service (Garage Camera) 2022-11-18T22:22:14.732950818+00:00 ERROR ONVIF Video Camera V1.3 Failed to initialize device Garage Camera 2022-11-18T22:22:14.746011485+00:00 INFO ONVIF Video Camera V1.3 <Device: 0bb04db4-e68e-4fb3-8859-fafed052fbe5 (Garage Camera)> emitting event: {"attribute_id":"status","capability_id":"partyvoice23922.onvifstatus","component_id":"info","state":{"value":"Not responding"}} 2022-11-18T22:22:14.779817818+00:00 DEBUG ONVIF Video Camera V1.3 IPCam #1 (configure!) device thread event handled
Hi - thanks for posting your log. However to really see what could be happening, I'm going to need you to capture a log when you press the Refresh button, so I can see how your camera is being initialized. The fact that it works, and then stops working after 10 minutes makes me suspect that it may have something to do with motion event subscriptions, which renew every 10 minutes. So you'll need to let logging run at least that long after the refresh.
Hi, that was the logs after pushing refresh.
are you meaning I remove, add logging, then re-add the camera, and leave logging running for a while, and push refresh after I notice it’s stopped working?
Strangely, when I read this on my laptop, the log text is cut off, but if I read it from my phone, I can see the rest. Whenever you post the log data, be sure to precede it with the 3 back-ticks (```) and then end it with 3 back-ticks (```). This will ensure proper formatting.
So what I see from your log is that your camera isn't responding according to spec for HTTP digest authentication. It is returning an invalid Authorization header so that the driver can't get authorized to access the camera.
What kind of camera is this? Have you gone through all of its settings options and made sure that ONVIF is enabled? For some cameras, this is mandatory and the setting can be hard to find. Hikvision cameras, for example, even have a separate userid and password you have to configure specifically for the ONVIF interface.
One other thing you might try is a freeware app called ONVIF Device Manager. It would be interesting to see if it has any success accessing your camera either.
I had put the log in a code block, formating likely a result of copy/paste from CMD windows output.
Camera is a HILOOK (so Hikvision) IPC-T281H-MU.
The response is the logs is the same as the response I get in Smartthings history, expect is formated in HTML. At the start it did work as there was a entry with a lot more information, but after a while it just responds with the above.
The struggle here is it does work, and then stops working.
Unsure how the auth/tokens are handled but I suspect if you're storing and reusing then the token with no reauth mechanism, it could be expiring after ~10 min, causing 401s from that point on. There is a setting for 'timeout' on the camera which could be triggering this (see below). Note when I tried this out the first time I got the same failure after ~10 min, so this isn't new to this update.
More info below.
ONVIF is enabled with digest, as is HTTP. RSTP is not enabled with digest.
Also ONVIF Device Manager appears to work fine
Re-read instructions and see you explicity say to enable RSTP digest. Appears I can register fine without this set, so if it switches to rstp that it could be the issue.
Have enabled this now., although the error in the logs is from the HTTP call and I'm also having issues subscribing now. Will keep tinkering, thanks for your help.
Captured events from the initial connect and subscribe through to subscription renewal. You can see after initial subscription that it says it'll wait 10 min to resubscribe, and then when it tries it fails with a 401. Since then no updates have come through.
The RSTP digest did not help unfortunately.
When trying to refresh after this failure, I get this error, so it's unrecoverable after ~10 minutes.
You let me know if your patience is getting thin! I’m happy to try and figure this out with you but it may take a fair amount of back and forth and multiple logs. Since some logs may display your private data, you might want to switch over to using a private thread back on the SmartThings community.
What I need you to do is delete the camera device and the run another device discovery while keeping logging going. Configure your authentication and other needed Settings then tap Refresh. This will show me the initial transactions with the camera and allow me to confirm what type of authorization is being set up (there are two types). That may help me figure out why authorization is failing later on.
You may be on to something, that a nonce or some other authorization element may be expiring.
Hi, as below. Doesn't contain the password and is on private network so am OK with the content.
''' ? Enter hub IP address with optionally appended port number: 10.1.1.4 ──────────────────────────────────────────────────────────────────
────────────────────────────────────────────────────────────────── 1 a3f99eee-5802-4edd-888d-1fac080bc02e ONVIF Video Camera V1.3 ────────────────────────────────────────────────────────────────── ? Select a driver. all connecting... connected 2022-11-25T05:15:24.386779954+00:00 TRACE ONVIF Video Camera V1.3 Setup driver onvifDriver with lifecycle handlers: DeviceLifecycleDispatcher: onvifDriver default_handlers: added: infoChanged: doConfigure: init: driverSwitched: removed: deleted: child_dispatchers:
2022-11-25T05:15:24.393352906+00:00 TRACE ONVIF Video Camera V1.3 Setup driver onvifDriver with Capability handlers: CapabilityCommandDispatcher: onvifDriver default_handlers: videoStream: startStream stopStream partyvoice23922.motionevents2: setSwitch switchOn switchOff partyvoice23922.refresh: push child_dispatchers:
2022-11-25T05:15:24.398593191+00:00 DEBUG ONVIF Video Camera V1.3 ONVIF Driver V1.3 Start 2022-11-25T05:15:24.417885499+00:00 TRACE ONVIF Video Camera V1.3 Received event with handler environment_info 2022-11-25T05:15:24.425301205+00:00 TRACE ONVIF Video Camera V1.3 Received event with handler environment_info 2022-11-25T05:15:24.430499470+00:00 DEBUG ONVIF Video Camera V1.3 Z-Wave hub node ID environment changed. 2022-11-25T05:15:24.467091423+00:00 TRACE ONVIF Video Camera V1.3 Received event with handler discovery 2022-11-25T05:15:24.477809780+00:00 DEBUG ONVIF Video Camera V1.3 Discovery handler invoked 2022-11-25T05:15:24.487562987+00:00 INFO ONVIF Video Camera V1.3 Starting Discovery cycle #1 2022-11-25T05:15:24.654048855+00:00 DEBUG ONVIF Video Camera V1.3 Discovery response from: 10.1.1.9 2022-11-25T05:15:24.719488225+00:00 DEBUG ONVIF Video Camera V1.3 ProbeMatch table: 0x11b7fb0 2022-11-25T05:15:24.725042334+00:00 DEBUG ONVIF Video Camera V1.3 MetadataVersion 10 2022-11-25T05:15:24.730199912+00:00 DEBUG ONVIF Video Camera V1.3 EndpointReference table: 0x11b8000 2022-11-25T05:15:24.735431193+00:00 DEBUG ONVIF Video Camera V1.3 Address urn:uuid:55218000-eff9-11b4-8397-acb92f7c0ed0 2022-11-25T05:15:24.740511732+00:00 DEBUG ONVIF Video Camera V1.3 XAddrs http://10.1.1.9/onvif/device_service http://[fd77:cc49:1093:3b70:aeb9:2fff:fe7c:ed0]/onvif/device_service 2022-11-25T05:15:24.746255602+00:00 DEBUG ONVIF Video Camera V1.3 Types dn:NetworkVideoTransmitter tds:Device 2022-11-25T05:15:24.751712663+00:00 DEBUG ONVIF Video Camera V1.3 Scopes onvif://www.onvif.org/type/video_encoder onvif://www.onvif.org/Profile/Streaming onvif://www.onvif.org/Profile/G onvif://www.onvif.org/Profile/T onvif://www.onvif.org/type/audio_encoder onvif://www.onvif.org/MAC/ac:b9:2f:7c:0e:d0 onvif://www.onvif.org/hardware/IPC-T281H-MU onvif://www.onvif.org/name/IPC-T281H-MU onvif://www.onvif.org/location/ 2022-11-25T05:15:24.758180228+00:00 INFO ONVIF Video Camera V1.3 Creating discovered IP Camera found at 10.1.1.9 2022-11-25T05:15:24.763428184+00:00 INFO ONVIF Video Camera V1.3 device_network_id = urn:uuid:55218000-eff9-11b4-8397-acb92f7c0ed0 2022-11-25T05:15:24.786492377+00:00 DEBUG ONVIF Video Camera V1.3 Discovery response from: 10.1.1.9 2022-11-25T05:15:24.825263420+00:00 DEBUG ONVIF Video Camera V1.3 ProbeMatch table: 0x11cb798 2022-11-25T05:15:24.830661117+00:00 DEBUG ONVIF Video Camera V1.3 MetadataVersion 10 2022-11-25T05:15:24.835928750+00:00 DEBUG ONVIF Video Camera V1.3 EndpointReference table: 0x11cb7e8 2022-11-25T05:15:24.865015620+00:00 DEBUG ONVIF Video Camera V1.3 Address urn:uuid:55218000-eff9-11b4-8397-acb92f7c0ed0 2022-11-25T05:15:24.870071146+00:00 DEBUG ONVIF Video Camera V1.3 XAddrs http://10.1.1.9/onvif/device_service http://[fd77:cc49:1093:3b70:aeb9:2fff:fe7c:ed0]/onvif/device_service 2022-11-25T05:15:24.875301760+00:00 DEBUG ONVIF Video Camera V1.3 Types dn:NetworkVideoTransmitter tds:Device 2022-11-25T05:15:24.880561389+00:00 DEBUG ONVIF Video Camera V1.3 Scopes onvif://www.onvif.org/type/video_encoder onvif://www.onvif.org/Profile/Streaming onvif://www.onvif.org/Profile/G onvif://www.onvif.org/Profile/T onvif://www.onvif.org/type/audio_encoder onvif://www.onvif.org/MAC/ac:b9:2f:7c:0e:d0 onvif://www.onvif.org/hardware/IPC-T281H-MU onvif://www.onvif.org/name/IPC-T281H-MU onvif://www.onvif.org/location/ 2022-11-25T05:15:24.886641427+00:00 DEBUG ONVIF Video Camera V1.3 Discovered device was already known 2022-11-25T05:15:26.984166333+00:00 TRACE ONVIF Video Camera V1.3 Received event with handler device_lifecycle 2022-11-25T05:15:27.091847146+00:00 INFO ONVIF Video Camera V1.3 <Device: 46f7e417-862a-4e12-b3c7-32c8c763ac1a (IPCam #1 (configure!))> received lifecycle event: added 2022-11-25T05:15:27.144844632+00:00 TRACE ONVIF Video Camera V1.3 Received event with handler device_lifecycle 2022-11-25T05:15:27.153938510+00:00 INFO ONVIF Video Camera V1.3 <Device: 46f7e417-862a-4e12-b3c7-32c8c763ac1a (IPCam #1 (configure!))> received lifecycle event: doConfigure 2022-11-25T05:15:27.180993364+00:00 TRACE ONVIF Video Camera V1.3 Found DeviceLifecycleDispatcher handler in onvifDriver 2022-11-25T05:15:27.186616841+00:00 INFO ONVIF Video Camera V1.3 ADDED handler: <46f7e417-862a-4e12-b3c7-32c8c763ac1a (IPCam #1 (configure!))> successfully added; device_network_id = urn:uuid:55218000-eff9-11b4-8397-acb92f7c0ed0 2022-11-25T05:15:27.215852118+00:00 INFO ONVIF Video Camera V1.3 <Device: 46f7e417-862a-4e12-b3c7-32c8c763ac1a (IPCam #1 (configure!))> emitting event: {"attribute_id":"motion","capability_id":"motionSensor","component_id":"main","state":{"value":"inactive"}} 2022-11-25T05:15:27.238381043+00:00 INFO ONVIF Video Camera V1.3 <Device: 46f7e417-862a-4e12-b3c7-32c8c763ac1a (IPCam #1 (configure!))> emitting event: {"attribute_id":"motionSwitch","capability_id":"partyvoice23922.motionevents2","component_id":"main","state":{"value":"Off"}} 2022-11-25T05:15:27.286408712+00:00 INFO ONVIF Video Camera V1.3 <Device: 46f7e417-862a-4e12-b3c7-32c8c763ac1a (IPCam #1 (configure!))> emitting event: {"attribute_id":"linecross","capability_id":"partyvoice23922.linecross","component_id":"line","state":{"value":"inactive"}} 2022-11-25T05:15:27.327447221+00:00 INFO ONVIF Video Camera V1.3 <Device: 46f7e417-862a-4e12-b3c7-32c8c763ac1a (IPCam #1 (configure!))> emitting event: {"attribute_id":"tamper","capability_id":"tamperAlert","component_id":"tamper","state":{"value":"clear"}} 2022-11-25T05:15:27.363259785+00:00 INFO ONVIF Video Camera V1.3 <Device: 46f7e417-862a-4e12-b3c7-32c8c763ac1a (IPCam #1 (configure!))> emitting event: {"attribute_id":"info","capability_id":"partyvoice23922.onvifinfo","component_id":"info","state":{"value":" "}} 2022-11-25T05:15:27.391516906+00:00 INFO ONVIF Video Camera V1.3 <Device: 46f7e417-862a-4e12-b3c7-32c8c763ac1a (IPCam #1 (configure!))> emitting event: {"attribute_id":"status","capability_id":"partyvoice23922.onvifstatus","component_id":"info","state":{"value":"Not configured"}} 2022-11-25T05:15:27.411887086+00:00 DEBUG ONVIF Video Camera V1.3 ADDED handler exiting for IPCam #1 (configure!) 2022-11-25T05:15:27.420864573+00:00 DEBUG ONVIF Video Camera V1.3 IPCam #1 (configure!) device thread event handled 2022-11-25T05:15:27.432064503+00:00 TRACE ONVIF Video Camera V1.3 Found DeviceLifecycleDispatcher handler in onvifDriver 2022-11-25T05:15:27.437607273+00:00 DEBUG ONVIF Video Camera V1.3 INIT handler for: <urn:uuid:55218000-eff9-11b4-8397-acb92f7c0ed0 (IPCam #1 (configure!))> 2022-11-25T05:15:27.450336635+00:00 INFO ONVIF Video Camera V1.3 <Device: 46f7e417-862a-4e12-b3c7-32c8c763ac1a (IPCam #1 (configure!))> emitting event: {"attribute_id":"linecross","capability_id":"partyvoice23922.linecross","component_id":"line","state":{"value":"inactive"}} 2022-11-25T05:15:27.466995627+00:00 DEBUG ONVIF Video Camera V1.3 IPCam #1 (configure!) device thread event handled 2022-11-25T05:15:27.479481533+00:00 TRACE ONVIF Video Camera V1.3 Found DeviceLifecycleDispatcher handler in onvifDriver 2022-11-25T05:15:27.485128355+00:00 DEBUG ONVIF Video Camera V1.3 IPCam #1 (configure!) device thread event handled 2022-11-25T05:15:27.505681293+00:00 DEBUG ONVIF Video Camera V1.3 IPCam #1 (configure!) device thread event handled 2022-11-25T05:15:27.518312606+00:00 INFO ONVIF Video Camera V1.3 Starting Device Initialization routine for IPCam #1 (configure!) 2022-11-25T05:15:27.524554725+00:00 INFO ONVIF Video Camera V1.3 <Device: 46f7e417-862a-4e12-b3c7-32c8c763ac1a (IPCam #1 (configure!))> emitting event: {"attribute_id":"info","capability_id":"partyvoice23922.onvifinfo","component_id":"info","state":{"value":"<!DOCTYPE html>\n\n
\n\n\n\nIP addr: 10.1.1.9 |
Name: IPC-T281H-MU |
Hardware: IPC-T281H-MU |
Profile: Streaming |
Profile: G |
Profile: T |
urn:uuid:55218000-eff9-11b4-8397-acb92f7c0ed0 |
IP addr: 10.1.1.9 |
Name: IPC-T281H-MU |
Hardware: IPC-T281H-MU |
Profile: Streaming |
Profile: G |
Profile: T |
urn:uuid:55218000-eff9-11b4-8397-acb92f7c0ed0 |
Last refresh hub: 11/25/2022 5:15:27 UTC |
Last refresh cam: 11/25/2022 6:15:27 UTC |
IP addr: 10.1.1.9 |
Name: IPC-T281H-MU |
Hardware: IPC-T281H-MU |
Profile: Streaming |
Profile: G |
Profile: T |
urn:uuid:55218000-eff9-11b4-8397-acb92f7c0ed0 |
IP addr: 10.1.1.9 |
Name: IPC-T281H-MU |
Hardware: IPC-T281H-MU |
Profile: Streaming |
Profile: G |
Profile: T |
urn:uuid:55218000-eff9-11b4-8397-acb92f7c0ed0 |
Last refresh hub: 11/25/2022 5:15:49 UTC |
Last refresh cam: 11/25/2022 6:15:49 UTC |
IP addr: 10.1.1.9 |
Name: IPC-T281H-MU |
Hardware: IPC-T281H-MU |
Profile: Streaming |
Profile: G |
Profile: T |
urn:uuid:55218000-eff9-11b4-8397-acb92f7c0ed0 |
IP addr: 10.1.1.9 |
Name: IPC-T281H-MU |
Hardware: IPC-T281H-MU |
Profile: Streaming |
Profile: G |
Profile: T |
urn:uuid:55218000-eff9-11b4-8397-acb92f7c0ed0 |
Last refresh hub: 11/25/2022 5:16:10 UTC |
Last refresh cam: 11/25/2022 6:16:10 UTC |
IP addr: 10.1.1.9 |
Name: IPC-T281H-MU |
Hardware: IPC-T281H-MU |
Profile: Streaming |
Profile: G |
Profile: T |
urn:uuid:55218000-eff9-11b4-8397-acb92f7c0ed0 |
IP addr: 10.1.1.9 |
Name: IPC-T281H-MU |
Hardware: IPC-T281H-MU |
Profile: Streaming |
Profile: G |
Profile: T |
urn:uuid:55218000-eff9-11b4-8397-acb92f7c0ed0 |
Last refresh hub: 11/25/2022 5:16:27 UTC |
Last refresh cam: 11/25/2022 6:16:27 UTC |
IP addr: 10.1.1.9 |
Name: IPC-T281H-MU |
Hardware: IPC-T281H-MU |
Profile: Streaming |
Profile: G |
Profile: T |
urn:uuid:55218000-eff9-11b4-8397-acb92f7c0ed0 |
Last refresh hub: 11/25/2022 5:16:27 UTC |
Last refresh cam: 11/25/2022 6:16:27 UTC |
SerialNumber: IPC-T281H-MU20210919AAWRG74158161 |
Model: IPC-T281H-MU |
HardwareId: 88 |
FirmwareVersion: V5.7.1 build 220610 |
Manufacturer: HIKVISION |
IP addr: 10.1.1.9 |
Name: IPC-T281H-MU |
Hardware: IPC-T281H-MU |
Profile: Streaming |
Profile: G |
Profile: T |
urn:uuid:55218000-eff9-11b4-8397-acb92f7c0ed0 |
Last refresh hub: 11/25/2022 5:16:27 UTC |
Last refresh cam: 11/25/2022 6:16:27 UTC |
SerialNumber: IPC-T281H-MU20210919AAWRG74158161 |
Model: IPC-T281H-MU |
HardwareId: 88 |
FirmwareVersion: V5.7.1 build 220610 |
Manufacturer: HIKVISION |
Resolution: 1280w x 720h |
IP addr: 10.1.1.9 |
Name: IPC-T281H-MU |
Hardware: IPC-T281H-MU |
Profile: Streaming |
Profile: G |
Profile: T |
urn:uuid:55218000-eff9-11b4-8397-acb92f7c0ed0 |
IP addr: 10.1.1.9 |
Name: IPC-T281H-MU |
Hardware: IPC-T281H-MU |
Profile: Streaming |
Profile: G |
Profile: T |
urn:uuid:55218000-eff9-11b4-8397-acb92f7c0ed0 |
Last refresh hub: 11/25/2022 5:16:37 UTC |
Last refresh cam: 11/25/2022 6:16:37 UTC |
IP addr: 10.1.1.9 |
Name: IPC-T281H-MU |
Hardware: IPC-T281H-MU |
Profile: Streaming |
Profile: G |
Profile: T |
urn:uuid:55218000-eff9-11b4-8397-acb92f7c0ed0 |
Last refresh hub: 11/25/2022 5:16:37 UTC |
Last refresh cam: 11/25/2022 6:16:37 UTC |
SerialNumber: IPC-T281H-MU20210919AAWRG74158161 |
Model: IPC-T281H-MU |
HardwareId: 88 |
FirmwareVersion: V5.7.1 build 220610 |
Manufacturer: HIKVISION |
IP addr: 10.1.1.9 |
Name: IPC-T281H-MU |
Hardware: IPC-T281H-MU |
Profile: Streaming |
Profile: G |
Profile: T |
urn:uuid:55218000-eff9-11b4-8397-acb92f7c0ed0 |
Last refresh hub: 11/25/2022 5:16:37 UTC |
Last refresh cam: 11/25/2022 6:16:37 UTC |
SerialNumber: IPC-T281H-MU20210919AAWRG74158161 |
Model: IPC-T281H-MU |
HardwareId: 88 |
FirmwareVersion: V5.7.1 build 220610 |
Manufacturer: HIKVISION |
Resolution: 1280w x 720h |
I've got to study this some more, but the first thing I notice is that your camera time is an hour off of your hub time. So I'd suggest getting that adjusted to make sure it's not causing problems.
Yeah that hour thing is weird, everything’s set right and appears to be an internal utc/daylight savings time conversion bug somewhere. Either camera is providing wrong value to ST, or ST is applying incorrect conversion to get UTC.
New Zealand is +12, and +13 DST over summer period (now).
The camera is using ntp with NZ Timezone + daylight savings configured and is reporting the correct local time in camera. For some reason the camera time in ST is reporting as utc +12, not +13 (so accounting for TZ but not DST). As above unsure if this is a camera bug or ST/driver conversion issue.
The hub has the location set to NZ and is reporting the correct time in the UI, and correct UTC in logs.
image below shows history with smartthings local time vs hub log utc and log of camera ‘utc’. Can see hub is correct to utc/vs local time but camer utc ‘is wrong’ even though camera set correctly.
There is no conversions done on the time received from the camera. It provides it in UTC time. You can see where the times are displayed in the log:
2022-11-25T05:15:27.683570194+00:00 INFO ONVIF Video Camera V1.3 Hub UTC datetime: 11/25/2022 5:15:27
2022-11-25T05:15:27.689003909+00:00 INFO ONVIF Video Camera V1.3 IP cam UTC datetime: 11/25/2022 6:15:27
The log time (UTC) is showing 05:15:27, the hub time shows as 05:15:27, but the camera is returning 06:15:27. So it definitely appears that the camera is returning the wrong time. I don't know if it's a bug in the ONVIF firmware or it's a camera config issue.
I'm actually surprised that the authentication works at all, since from the camera's perspective the creation time of the password hash is an hour old. But it does work and only 10 minutes later when the event subscription is renewed, it is rejected. If the camera is disallowing anything OVER one hour, then this could be why it is rejecting the authentication since it is OVER an hour old by then. I really don't know... this could just be a red herring and it's something else entirely.
A couple questions: 1) When you tried the ONVIF Device Manager, did you click on the events tab and wait several minutes to ensure that events kept being received? ONVIF renews it every MINUTE, so you would have seen it fail after that if it was having the same problem. EDIT: Also what time is ODM showing from your camera?
2) Is the video stream still working past the 10 minute mark? It should, as the events renewal problem is a separate issue.
Definitely looks like a camera bug issue, events in UTC clearly add/loose an hour when enabling/disabling the daylight savings flag.
Have changed to a timezone that includes the extra hour and will see how that goes.
Is there something I need to do to enable line crossing? I don't see the events trigger in smartthings. Here is ONVIF Device Manager event log vs smartthings log.
Unforuntatley same issue 10 min later :( Does'nt appear aligning UTC has helped.
Something else is going on in your log: your device discovery process is repeating over and over again. Normally it should just go through maybe three cycles and then quit. In fact you seem to have multiple discovery cycles going on simultaneously, which should NEVER happen. I see "Starting Discovery cycle #24" and then "#1" and then "#25"! This is bad.
Have you been having any other strange issues with your hub lately? When you do an Add device / Scan for nearby devices from your mobile app, the Edge platform tells the driver to start discovery, but then in a minute or so it tells it to stop. It looks like the notification to stop never made it to the driver. If this is happening to other drivers on your hub, then there is a possibility there could be any number of them churning away with repeated discovery cycles.
I know it's probably a pain, but what I would recommend is deleting all your devices, uninstalling the driver, and starting over. If we see this happen again, it needs to be reported to SmartThings support. They'll want you to send a snapshot of your hub through the IDE menus too.
Also, if there is any way to limit our testing to just one active camera, I think that would help in tracing the log. It's sometimes confusing when there are multiple devices. So even if your discovery process finds multiple cameras, just configure the userid & password for one of them.
Your ODM events screenshot is really helpful - I can try and see why the line events aren't being triggered, but for that I'll need to also go back and look at the initialization sequence.
If ODM is not having a problem when periodically re-subscribing to your camera, then that gives us hope that there is some change I could possibly make to the driver to solve the authentication issue we're having. There are a couple things we could possibly try with some driver modifications, but we've got to solve this discovery issue first.
On a completely different note, I had been meaning to ask if you had ever tried DISABLING that control timeout option on your camera?
Update on Line Cross events. During the period in which you were expecting to see motion events, the driver was still(!) going through a discovery cycle (possibly multiple), so I suspect that motion events were not even getting processed. However I went back and checked that the setup for Line Cross events went ok and it did. There is one thing different with this camera than what I've seen with others is that the Line Cross event here, rather than having a "True" or "1" value, has some other integer value of 82260 (ObjectId). Does this value mean anything to you? I was wondering if it tied back to something set up in your camera's line detection configuration. Regardless, this will require a small update to the driver to make sure it is getting treated as meaning 'motion active'.
I've also been thinking about this ongoing discovery cycle issue and if it might be actually causing the problem we're having with authentication and it actually might be... The same camera device is getting discovered repeatedly, with duplicate calls to the API made with http digest authentication data. It is entirely possible that the camera is choking on these multiple calls, so by the time it gets to the resubscription after 10 minutes, it's already been maxed out with all the ongoing discovery cycles.
It might be wise to re-boot your hub after deleting the driver and before loading it again.
Will give the delete and reboot a try. Do have wierd stuff sometimes where I can’t add a device without a reboot, but have had no issue adding the camera each time
The object is doesn’t mean much sorry. Assumed it was a tracked object id, like the instance id of an object a system might follow/track about the place.
Let me know how you make out. I thought also that maybe when you did an Add device / Scan for nearby devices, that maybe you never backed out of the screen when the initial scan was complete. (This sends a 'stop discovery' notification to the driver) I've never seen it as an issue before, but after seeing your log it made me think that maybe I should put a ceiling on the number of discovery cycles regardless of when you end it by exiting the scan screen. So I'll probably get you an updated driver with that change, plus the one to ensure your line crossing events are properly recognized.
Hello. I just pushed out a driver update to the alternate test channel that puts a limit on the number of discovery cycles executed when you do an Add device / Scan for nearby devices. This driver also has a minor change that should result in your line detection events getting registered in the SmartThings device.
If you have some time, it would be great if you could give this a go and let me know if it improves anything for you.
First, confirm that your hub has received driver version 2022-12-07T23:36:16.201207693
Can confirm that both my Dahua cameras were instantly found but no video unless ONVIF authentication is set to OFF.
Having to disable authentication to get video working seems to be a common thing with these Dahua cameras. Are you getting motion alerts?
Yes motion alerts seem to be working
Þann fim., 29. des. 2022, 05:57 Todd Austin skrifaði < @.***>:
Having to disable authentication to get video working seems to be a common thing with these Dahua cameras. Are you getting motion alerts?
— Reply to this email directly, view it on GitHub https://github.com/toddaustin07/Edge-ONVIF-Driver/issues/2#issuecomment-1367088838, or unsubscribe https://github.com/notifications/unsubscribe-auth/A257GOA65Y7WKRVZLU5CUNLWPUR3HANCNFSM554P4XZA . You are receiving this because you commented.Message ID: @.***>
Ok good to hear. I’ll go ahead and close the issue.
Hi, bit late on reply sorry.
Have gone through the remove/readd cycle, still unfortunately having issues past 10min where the device receives a 401 back from the camera.
I can get motion events, but still cannot get a line-cross event to come through.
Hi, this is neat stuff many thanks for this!
I'd like to set up some routines based on smart events as motion is too all over the show for me. Will things like Line Crossing and Intrusion Detection be coming soon?