Giter Site home page Giter Site logo

some problems of search cam about onvif HOT 9 CLOSED

agsh avatar agsh commented on July 28, 2024
some problems of search cam

from onvif.

Comments (9)

RogerHardiman avatar RogerHardiman commented on July 28, 2024 1

I checked the source of ONVIF Device Manager on SourceForge to see how they do Discovery.

The correct procedure on Windows is to make some calls to the Microsoft System.ServiceModel.Discovery service API. Microsoft then handle port 239.255.255.250 data and pass results back via the Microsoft API.

So right now there is no way that Discovery will work reliably on Windows without a lot of Microsoft specific code.

As a result I'm going to close this issue.

from onvif.

agsh avatar agsh commented on July 28, 2024

Hello!
Probably you should use events because camera can send response later than timeout is over.
Another way is to run probe several times, maybe the problem in your network?

from onvif.

RogerHardiman avatar RogerHardiman commented on July 28, 2024

I would like to add to this Issue Report

  1. Windows 10 machine.
    I am using the code below.
    First time I execute it I can find the ONVIF devices on my network (3 of them).
    Next time I execute it it does not find any devices.
    I can run it over and over and it never finds any more devices, but then after a while it does get replies from devices but then no longer receives any more replies. Clearing the ARP cache (arp -d *) made no difference for me.
    Tested with node 0.12 and node 4.4.4

  2. At the same time I run the example on my Raspberry Pi and it detects the devices every time.
    (with devices detected within 2 seconds)

So something related to Windows.

var onvif = require('./lib/onvif');
onvif.Discovery.on('device', function(cam){
    // function would be called as soon as NVT responses 
    console.log('received discovery message');
    console.log(cam.hostname);
    console.log(cam.port);
    console.log(cam.path);
})
onvif.Discovery.probe();

from onvif.

agsh avatar agsh commented on July 28, 2024

This is very interesting. As you can see in the code, there is nothing else sending udp packet and listening the response. I haven't got any Windows machine, so let this issue being open.

from onvif.

RogerHardiman avatar RogerHardiman commented on July 28, 2024

I have looked at the source of another node wsdiscovery package. One thing they do a close of the udp socket when discovery is over. Will need to try it.

from onvif.

agsh avatar agsh commented on July 28, 2024

But there is close method at line 142 in discovery.js. I don't know where to dig.

from onvif.

RogerHardiman avatar RogerHardiman commented on July 28, 2024

sorry, I had missed the close on line 142. It was just a guess.

Anyway I ran wireshark. The first time I run my test program I can see that Windows transmits the UDP broadcast packet to 239.255.255.0 and the test program gets a reply from ONVIF devices.

Next time I run the program there is no reply from ONVIF devices and wireshark tells me the UDP broadcast packet was not sent.

Windows does do WS-Discovery too, so perhaps something in windows is preventing port 3702 from being used,

from onvif.

RogerHardiman avatar RogerHardiman commented on July 28, 2024

I've written a really small program to send UDP packets on 3702 239.255.255.0.
Some times the packets leave. Some times they do not. It looks like some other process in Windows is causing problems.

from onvif.

RogerHardiman avatar RogerHardiman commented on July 28, 2024

I wrote a small C# program to send UDP packets on 239.255.255.0. On my Win10 box they are transmitted for a while, then stop being transmitted.
So there is something windows specific here. I wonder if the proper Windows way is to register with some MS discovery service and let it handle the packets.

I think we can close this and simply say that Discovery does not work on Windows right now

from onvif.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.