libONVIF icon indicating copy to clipboard operation
libONVIF copied to clipboard

Why can't I discovery for devices?

Open chccc1994 opened this issue 3 years ago • 2 comments

Running onvifinfo does not find onvif device.

1. debug screenshot image 2. onvif device test tool image

chccc1994 avatar Aug 26 '22 03:08 chccc1994

Hi, maybe the device is expecting a specific type in the WS-Discovery request. Try to replace tds:Device with tdn:NetworkVideoTransmitter (There second discovery Probe already contains tdn:NetworkVideoTransmitter but maybe only the first probe is processed correctly, also try to replace the second probe with type tdn:NetworkVideoTransmitter with tds:Device).

Long story short - try this:

			ProbeTypeRequest request;
			request.Types = "tds:Device";
			auto uuidOne = QString("uuid:%1").arg(SoapHelper::GenerateUuid());
			auto probeResponseTwo = discovery->Probe(request, uuidOne);
			request.Types = "tds:Device";
			auto uuidTwo = QString("uuid:%1").arg(SoapHelper::GenerateUuid());
			auto probeResponseOne = discovery->Probe(request, uuidTwo);

and this:

			ProbeTypeRequest request;
			request.Types = "tdn:NetworkVideoTransmitter";
			auto uuidOne = QString("uuid:%1").arg(SoapHelper::GenerateUuid());
			auto probeResponseTwo = discovery->Probe(request, uuidOne);
			request.Types = "tdn:NetworkVideoTransmitter";
			auto uuidTwo = QString("uuid:%1").arg(SoapHelper::GenerateUuid());
			auto probeResponseOne = discovery->Probe(request, uuidTwo);

Tereius avatar Aug 31 '22 22:08 Tereius

Hi, I tried these two methods and turned off the firewall, but I still couldn't find the device under the windows platform.

image

chccc1994 avatar Sep 01 '22 01:09 chccc1994

Is there a typo? image should be tdn:NetworkVideoTransmitter.

If this does not work you may try this ONVIF Server and see if it is found.

Tereius avatar Sep 05 '22 20:09 Tereius

1、I tried to modify the device type tdn:NetworkVideoTransmitter, but I still couldn't find the device under the windows platform. 2、 I tried this ONVIF Server ,onivfinfo.exe Found "no" match.

tds:Device tdn:NetworkVideoTransmitter.

vs2022 cmake3.22.5

image

chccc1994 avatar Sep 06 '22 02:09 chccc1994

I compiled onvifinfo.exe on a fresh Windows 10 (version 21H2) virtual machine with VisualStudio 2022 and it works right away and finds the Happytime onvif server without any problems. I think you have to do some research why it fails on your Machine. Perhaps you have to experiment with some gsoap multicast related socket params here (https://www.genivia.com/doc/guide/html/structsoap.html#aa5faa7630425a8ab8018f0b2d4d0c18d).

onvifinfo

Tereius avatar Sep 06 '22 17:09 Tereius

Thank you for your prompt reply.

I tried to find the device under this operating system Windows 10 version 20H2(OS Build 19042.1889) so, I think it may be a problem with the operating system Windows 10 version 21H2(OS Build 19044.1889)

chccc1994 avatar Sep 07 '22 03:09 chccc1994