6

I am creating a program to talk to a IP Camera, of this model:

CVUL-I125

This has a simple web interface and I've successfully talked to it in order to control it, and grab video and snapshots from it.

However, I can't find any good documentation on how to detect that this camera is on the network, nor which particular IP address it has.

So far the only tool I have that finds it is the bundled windows software.

I'm assuming (hoping!) that there is a better way than just iterating over all IP addresses in range and seeing if there's something that looks like the camera interface there.

Does anyone know how to do this?

Is there a known API for this sort of thing?

Note that since it is an IP camera, it doesn't connect directly to my computer, and thus there is nothing installed locally I can talk to.

Here are some more details:

  • The camera and the software I'm making will be sold, which means I cannot rely on any particular type of setup at the clients place, except for working DHCP
  • The camera has no API documentation that I can find, if anyone has stronger google-fu than me on that score, please enlighten me
  • The camera has DHCP support, so it does in fact connect to the network successfully, the question is how I can reliably find it afterwards
  • I do not know if it has a hostname, the documentation says nothing and my own DHCP server lists only the MAC address for it
Lasse V. Karlsen
  • 380,855
  • 102
  • 628
  • 825

3 Answers3

7

According to the link you provided this camera is capable of UPnP.

UPnP is a protocol which has several methods for device discovery/search:

Your code must multicast UDP packets as search requests. Your UPnP devices will answer (depending on configuration) with UPnP Search Responses which are UDP unicast packets.

UPnP Search Responses contains a HTTP URL to allow retrieval of an XML description of the device. The host in the HTTP URL usually is the devices IP/hostname.

Have a look at the UPnP spec.

You don't say which OS/language you are using - so just a small list of APIs and libraries:

aminexplo
  • 360
  • 1
  • 13
Yahia
  • 69,653
  • 9
  • 115
  • 144
  • This sounds *very* promising. I did not think of UPnP at all. I will look into this! I will hold off on accepting your answer for now, until I've confirmed this, but this looks mighty promising. – Lasse V. Karlsen Feb 06 '12 at 19:24
  • @LasseV.Karlsen updated with link to APIs/libraries... – Yahia Feb 06 '12 at 19:28
  • I will be implementing this in iOS, through MonoTouch (Mono), I so probably need source code in C# syntax to be able to use it. Luckily I probably don't need to implement the entire UPnP stack, only the parts related to discovery. – Lasse V. Karlsen Feb 07 '12 at 13:34
  • @LasseV.Karlsen There are some SDKs available for iOS (though mostly commercial) but [here](http://upnp.org/sdcps-and-certification/resources/sdks/) you can find a list of UPnP SDKs (both commercial and open source)... perhaps this helps somehow... – Yahia Feb 07 '12 at 14:35
  • While many cameras use the SSDP portion of UPnP for discovery, others use WS-Discovery for ONVIF control. Still others use mDNS (Bonjour). `The best thing about Standards is that there are so many to choose from.` Then there are the rogues that use some proprietary protocol for discovery. :( – Jesse Chisholm Feb 13 '15 at 19:55
  • @Yahia Do you know of a cross platform C++ implementation that would work on both android and iOS ? –  Sep 16 '18 at 16:33
0

What you want is to read the DHCP options that this network camera should be passing. Typically any consumer device will output its vendor identifier string in option 43 of the DHCP packets. Interface with your DHCP server, and you can have the DHCP server send you a notification when the camera has been connected to the network.

This procedure is different for each dhcp vendor. Do you know what DHCP will be running in the network?

Otherwise I suggest installing a simple DHCPd. It should be easily configurable to react to the proper option 43 value and talking back to your application.

Dervall
  • 5,736
  • 3
  • 25
  • 48
  • This would probably be a good solution if the camera and the software was running on my network only, but I intend to sell the program bundled with the camera, and thus I cannot rely on the DHCP server working with me, at least not if it depends on what kind of DHCP server and/or configuration the client has. – Lasse V. Karlsen Feb 06 '12 at 19:07
0

It sounds like it uses DHCP (otherwise it wouldn't be on your network at ALL).

I use this tool all the time:

http://www.angryip.org/w/Home

The "Discovery API" would be to listen on DHCP port 68 when the camera tries to connect to the network. I'd just take a Wireshark trace, or use the above-referenced ip-scan tool.

paulsm4
  • 114,292
  • 17
  • 138
  • 190
  • It does use DHCP. It sounds like this method would only work if I am running the program when the camera connects, what about the other way around? In my case, the camera will be sold to a client along with the software, and while the camera will most likely be connected all the time, the software might not. I am hoping I can create an autodiscovery feature to avoid much of the support hassle with clients not setting up their camera correctly. – Lasse V. Karlsen Feb 06 '12 at 19:09