Help: Unable to connect to toolkit!

I’m working on an issue that one of our users is having with our MIP SDK integration, where we are receiving “VideoOS.Platform.CommunicationMIPException: Unable to connect to toolkit! - —> VideoOS.Toolkit.NotConnectedException: Unable to connect to toolkit!”

Our integration was written a while ago using MIP SDK 2016, while the server they are connecting to is a Federated Server (and Remote Recording Server) running Milestone 2017R3.

When we initially tested our MIP SDK integration using their Federated Milestone Server, this exception did not occur. Also worth mentioning that when we test the same MIP SDK Integration now with a direct connection (No Federated Server) to the recorder in our lab, the exception does not occur.

We have been informed by the user that there has been no significant changes to their firewall settings since the initial test. However, I still suspect this issue is caused by a blocked port. Which ports on which host are required to connect to a Federated Milestone Server and retrieve video from a Remote Recording Server?

I’ve seen the other two posts on this forum that mention this same exception, but neither solution fixes the issue for us:

developer.milestonesys.com/s/question/0D50O00004ZRq93SAD/unable-to-connect-to-toolkit

developer.milestonesys.com/s/question/0D50O00003NHiu8SAD/unable-to-connect-to-toolkit

Full Stacktrace:

VideoOS.Platform.CommunicationMIPException: Unable to connect to toolkit! - —> VideoOS.Toolkit.NotConnectedException: Unable to connect to toolkit!

at VideoOS.Toolkit.SourceToolkit.Connect(ISet`1 requestedPropertyNames, ISet`1& availablePropertyNames, TimeSpan timeout)

at VideoOS.Toolkit.SourceToolkit.Connect(ISet`1 requestedPropertyNames, ISet`1& availablePropertyNames)

at VideoOS.Platform.SDK.Export.SDKInternalCommandService.ToolkitConnectWithExceptionHandling(IPlaybackSourceToolkit toolkit, ISet`1 properties, ISet`1& availableProperties)

— End of inner exception stack trace —

at VideoOS.Platform.SDK.Export.SDKInternalCommandService.ToolkitConnectWithExceptionHandling(IPlaybackSourceToolkit toolkit, ISet`1 properties, ISet`1& availableProperties)

at VideoOS.Platform.SDK.Export.SDKInternalCommandService.ImageExporterConnect(FQID deviceFQID, Int32 width, Int32 height, Boolean keepAspectRatio, Boolean fillSpace, Boolean allowUspcaling)

at VideoOS.Platform.Data.JPEGVideoSource.Init(Int32 width, Int32 height)

at VideoOS.Platform.Data.JPEGVideoSource.Init()

Please see this link and explore Port used by the system -

https://doc.milestonesys.com/2020r1/en-US/portal/htm/chapter-page-mc-administrator-manual.htm?TocPath=XProtect%20VMS%20products|XProtect%20VMS%20Administrator%20manual|_____0

Thank you, but this document does not seem to go into specifics about how ports are used with a Federated System.

Just to be clear, when I say a Federated System I mean connecting to a Milestone Server that manages multiple Remote Recording Servers.

In our lab we have only a single Milestone Server, which we do not have any issues with. Running Wireshark and accessing Video with the MIP SDK shows only 3 ports accessed on our Milestone Device: 80, 443, 7563.

The user reporting this issue with our integration to us does have a Federated Server Configuration, which seems to be the difference between our environments. We can connect and authenticate to the Federated Server, but ultimately results in this Tookit exception when we try to access video. Running Wireshark in their environment shows that the only ports accessed on the Federated Server are 80 and 443. Additional scans seem to indicate that there is nothing bound to 7563 on the Federated Server.

After connecting and authenticating to the Federated Server, does the Client (MIP SDK) then need to make a direct connection to the Remote Recording Server, or is the Federated Server able to act as a relay and transmit data between the Client (MIP SDK) and Remote Recording Server? It is unclear how the video is transmitted from Recording Server to the Client.

Hi. Sorry you received no reply but you need to log on to and access each server directly. Management Server does not relay requests.

This cannot be correct.

As I mentioned in the original post, this previously worked before. We were able to Login to a Management Server, find a Camera from a Remote Recorder via the Management Server, and able to retrieve recorded video through the MIP SDK. Never did I have to call the login method with anything but the address of the Management Server. I’m also fairly certain, but unable to prove, that at the time that this worked I only had access to the management server and could not directly access the recording server.

You say the Management Server does not relay requests, but is it able to inform the MIP SDK how to connect directly to the recording server and retrieve the requested video?

There must be an explanation for this.

Please clarify-

In the XProtect VMS each site has one Management Server and one or multiple Recording Servers.

If you have multiple sites, each with a Management Server, you can tie them together using Milestone Federated Architecture. A federation would in Milestone terms require multiple Management Servers.

I suspect you do not have multiple Management Servers but do have multiple Recording Servers on one Management Server. If so all the past communication should be disregarded and we should start on the same page.

My apologies, you are absolutely correct. I just confirmed with the user that it is indeed multiple remote recorders managed by a single Management Server. I must have misunderstood when they explained their environment to me the first time.

Now that we have cleared that up, allow me to try to describe our issue again.

Testing with our all-in-one Management and Recorder in the lab works just fine. Using Wireshark I see ports 80, 443, and 7563 used.

Testing with the users Management Server and Remote Recorders, I see the “Unable to connect to toolkit!” exception. Using Wireshark I only see ports 80 and 443 used on the Recorder, and that is all. It seems there is some port that is blocked preventing the toolkit connection.

It seems the MIP SDK will need access to 80 and 443 on the Management Server to authenticate and access camera data. What’s not clear is if the MIP SDK would then try to access 7563 directly on the Remote Recorder or if that communication would go through the Management Server. The Management Server does not seem to have anything bound to 7563, which makes sense since it is not running a Recording Service.

Hi Matt,

All audio/video data comes directly from the Recording Server - there’s definitely no possible way for the Management Server to relay any of that traffic. The only exception is if you have the Mobile Server running on the Management Server and you’re using the JavaScript Mobile SDK, not the .NET MIP SDK.

When you login with MIP SDK, in the background you are connecting to the Management Server and getting a list of devices you have access to. In the properties of those devices is a server address representing the Recording Server’s name/FQDN and port number like http://recorder:7563/

So when you use the MIP SDK to connect to a camera feed for live or playback, the your application/client is establishing a connection directly to the recorder on 7563.

If the recorder’s hostname cannot be resolved, or if the firewall port 7563 is not open, then that could explain why you can’t connect.

When you run Smart Client on the same machine where you’re seeing this error, can you login and see video? Or does that also not work?

Hi Josh,

Thank you, this is the information I was looking for.

I tested with the Smart Client installed on the same machine, and found that I was not able to view any video. Testing the process that you described step by step showed that the machine was not able to resolve the hostname of the recording server that the management server had returned. After we resolved the DNS issue and the machine was able to resolve the hostname set in the Management Service for that recorder, video starting playing in the Smart Client and in our application.

This issue is now resolved. Thanks again for your help.

-Matt

Thanks for the update Matt, I’m happy to hear you were able to sort the issue out! DNS resolution failure of the Recording Server is a really common source of “no video” calls.

All the best,

Josh