python-onvif-zeep icon indicating copy to clipboard operation
python-onvif-zeep copied to clipboard

multiprocessing: ONVIFCamera.__init__() does not succeed when run from another core

Open Guilmort opened this issue 5 years ago • 2 comments

From a process launched through the Python 3.8 multiprocessing module when trying to call init from an ONVIFCamera instance my code get stuck.

Within update_xaddrs() method call on the following line :

capabilities = self.devicemgmt.GetCapabilities({'Category': 'All'})

It never returns and get stuck.

Guilmort avatar Jan 16 '20 23:01 Guilmort

Hi Guys I also have an issue where the code stops at the above line, though we don't use multiprocessing we are using threading. I have this issue intermittently with one camera in particular and a reboot of the camera will fix the issue. Eventually though the issue comes back, I am trying to flag an error rather than just never get a reply from update_xaddrs().

jasonbrown-helios avatar Jan 25 '20 02:01 jasonbrown-helios

@Guilmort I managed to get around this issue by doing the following. from zeep.transports import Transport

Then when calling cam = ONVIFCamera add transport=Transport(operation_timeout=xx) so for example cam = ONVIFCamera(ip_address, port, username, password, transport=Transport(operation_timeout=30))

To me it looks like Zeep is not timing out, it is supposed to have a default timeout of 300, but I found other posts complaining that Zeep was ignoring its default timeout, so operation_timeout was added.

jasonbrown-helios avatar Jan 25 '20 06:01 jasonbrown-helios