python-ws-discovery
python-ws-discovery copied to clipboard
Discovery fails when multicast group registration request is sent ahead of discovery request
This happens with several different vendor cameras with different onvif client stack. Discovery works fine once I stop sending the multicast group registration request (and associated DROP request). This registration request should be made optional (and not the default). Several other discovery stacks/tools that I checked out seem to not send this request.
self._multiInSocket.setsockopt(socket.IPPROTO_IP, socket.IP_ADD_MEMBERSHIP, self._makeMreq(addr)) except socket.error: # see comments for setsockopt(.., socket.IP_ADD_MEMBERSHIP..
It's not clear from the specification if this is required or even recommended. Any insights would be appreciated.
I have seen something similar but I believe it is the switch between the camera and the discoverer.
If I comment out IP_ADD_MEMBERSHIP, the camera can be queried.
If I disable IGMP Snooping in the switch, the camera can be queried even with IP_ADD_MEMBERSHIP.