Camera IP

How to print the IP address of a camera connected to VMS

I will mention two ways

On the Rest API

Ref. https://doc.developer.milestonesys.com/mipvmsapi/api/config-rest/v1/

This will give you your cameras

https://localhost/api/rest/v1/cameras

In the data you get you will find the camera you are working with and find a parent for it.

            "parent": {

                "type": "hardware",

                "id": "3ac63e07-d9a7-4321-a261-538cc05b658b"

https://localhost/api/rest/v1/hardware/3ac63e07-d9a7-4321-a261-538cc05b658b

You will find ‘address’

(The id is here an example, will be a GUID but not the one displayed here.)

On Configuration API

Ref. https://doc.developer.milestonesys.com/html/index.html?base=gettingstarted/intro_configurationapi.html&tree=tree_4.html

See it using the Config API Client sample.

https://doc.developer.milestonesys.com/html/index.html?base=samples/componentsamples/configapiclient/readme.html&tree=tree_2.html

https://github.com/milestonesys

And For Rest API , when i get into it and type the username and password , it not working

i want to know what is meant by username in this case ?

https://doc.developer.milestonesys.com/mipvmsapi/api/config-rest/v1/#section/Introduction/Get-started

i mean in code and this is my code that i want to print the ip address in

This is not protocol integration, wrong tag..

The answer I posted yesterday was deleted. I am sorry if my answers don’t stick I will not be able to help.

So you can’t help further in this urgent task issue ?

Did you write down the answer yesterday? Please post it here so we have a working point.

No i didn’t , I need a full example with good explanation to understand how to print the IP Address of the camera in C# please .

or you could give me an exact function to take the camera name and give me the IP or sort of that kind

This was answered yesterday.

I can recreate the code in the new year.

The answer wasn’t helpful at all and very complex to understand

,What is the meaning of this ( I can recreate the code in the new year.) ?

and this mean that there is no direct way to get IP address of the camera ?

If this doesn’t help you please leave it here for other followers of this forum.

using VideoOS.Platform;
using VideoOS.Platform.ConfigurationItems;
 
FQID fqid = ev.EventHeader.Source.FQID;
if (fqid.Kind == Kind.Camera)
{
	Camera camera = new Camera(fqid);
	Hardware hardware = new Hardware(fqid.ServerId, camera.ParentItemPath);
	Debug.WriteLine(camera.DisplayName + " address: " + hardware.Address);
}

There is a chance that you will receive answers from other users of the Forum, if my answer doesn’t make sense and you don’t want to ask questions based on the code I post.

this is the same exact code that i’ve tried but not work with my case

Then please debug and explain how it fails.

this is what happen :

Are any of the two parameters null?

Show me what they contain and include the call stack..

what is the call stack ?

21

Look at the previous picture you sent, there is a ‘show call stack’.

I need you to debug and show values not code.

ok