Skip to content
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

Time Drift Skipped for DeviceManagement #4

Open
wlockwood opened this issue Aug 16, 2023 · 0 comments
Open

Time Drift Skipped for DeviceManagement #4

wlockwood opened this issue Aug 16, 2023 · 0 comments

Comments

@wlockwood
Copy link

wlockwood commented Aug 16, 2023

The time drift adjustment that is calculated for each device doesn't get applied to the DeviceManagement service because the service has to be initialized in order to request the time, but since services are memoized (client.py:399) and drift is passed into the service initializer, the code to figure out drift (client.py:299) is run but never applied to the DeviceManagement service.

The client gets a timestamp from the device that it's talking to, calculates a delta ("drift") between the host computer's time and the target camera's time and stores that in the ONVIFCamera object. All future services created against that object acquire the drift, but the Device Management service - which I have to use to acquire device information - does not get this adjustment and thus will fail against devices that check the time as part of the authentication process.

On my local copy, I fixed this by commenting out the lines below in client.py:399. This makes the problem go away for my use case, but I don't know if it will have deleterious side effects for some other use case, so I'm not submitting a PR for this change.

service = self._services.get(binding_name)
if service and service.xaddr == xaddr and service._device:
    return service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant