Send commands to camera from user network?

We have a case where there is a separate camera and user network. We are trying to send HTTP commands to a camera which is unreachable. Is there a way to get/send commands to the camera network from a mgmt client plugin on the user network?

I think you can use this-

const string VideoOS.Platform.Messaging.MessageId.Control.DriverCommand = “Control.DriverCommand”

-

Used to send device specific commands to a device through the Recording Server.

The Data field is filled with DriverCommandData, and the command is send with ‘destination’ FQID identifies the device.

The response is received via the DriverResponse message.

-ref. https://doc.developer.milestonesys.com/html/index.html?base=miphelp/class_video_o_s_1_1_platform_1_1_messaging_1_1_message_id_1_1_control.html&tree=tree_search.html?search=messageid

Thanks Bo. I’m having trouble getting a response. The following snippet is sent via a button click in a management client plugin. Does everything look ok?

var driverResponse = EnvironmentManager.Instance.SendMessage(
 
	new VideoOS.Platform.Messaging.Message(
 
	MessageId.Control.DriverCommand,
 
	new DriverCommandData()
	{
		Command = "GET:stw-cgi/media.cgi",
		Parameter = "msubmenu=videocodecinfo&action=view&Channel=0&AllProfiles=True",
		SyncObject = _selectedItem
 
	}),
 
	this._selectedItem.FQID);

You do not get driver response like that. You need instead to use-

https://doc.developer.milestonesys.com/html/index.html?base=miphelp/class_video_o_s_1_1_platform_1_1_messaging_1_1_driver_response_data.html&tree=tree_search.html?search=driverresponse

Thanks, I am now getting responses with a receiver method. One last thing.. our plugin uses a chromium web browser that opens the camera’s web page directly. Is it possilbe to load web pages from the camera which is on a separate network? Thanks again.

DriverCommand and DriverResponse is a way to let the communication go through the recording server and it works, as you started the thread by asking, even if you do not have direct access to the network on which the recording server communicates with the camera devices. Whether you can use this to open a camera’s web page I do not know. My guess is that if the web page is not just a static html page it will not work.

I could ask around here in Milestone, but if you like a more precise answer please indicate whether the web page you are talking about is a page static in nature or something complex streaming video or similar.

Unfortunately our web page is fairly complex, so this likely won’t work. Not a problem, thanks for your answer.

I did have one more question regarding this code snippet. The _selectedItem is the Camera item, but when I attempt a command I get the following error msg: “No Device instance found with the id f2c72de4-4bdc-4068-bf71-65fd145733af”. where id is not that of the camera. Any idea what’s happening here?

            DriverCommandData driverCommandData = new DriverCommandData();
            driverCommandData.Command = "GET:";
 
             EnvironmentManager.Instance.SendMessage(
 
                new VideoOS.Platform.Messaging.Message(
 
                MessageId.Control.DriverCommand,
                
                new DriverCommandData()
                {
                    Command = "GET:stw-cgi/system.cgi",
                    Parameter = param,
                    SyncObject = _selectedItem
 
                }),
                _selectedItem.FQID
            );

I have consulted Milestone Development but it is hard for us to see what happened in your code, so can you please debug your plugin and see where the _selectedItem changed from the camera item to “f2c72de4-4bdc-4068-bf71-65fd145733af”.

Are you developing Smart Client Plugin? If so, this link tells you how to debug Smart Client plugin, please see this -

https://developer.milestonesys.com/s/article/debugging-techniques-for-Smart-Client-plugins