Alarm is not triggered at alarmManager of SmartClient while a MIPSDK exception found at MIP log file

We are using SDK with below statement to trigger alarm at SmartClient alarmManager, it works fine in our development environment.

But, it failed to trigger alarm at our production. Please advise how to solve this problem, thank you.

Log.Debug("fire an alarm eventHeader.ID = " + eventHeader.ID);

Log.Debug("fire an alarm eventHeader.Message = " + eventHeader.Message);

EnvironmentManager.Instance.SendMessage(new VideoOS.Platform.Messaging.Message(MessageId.Server.NewAlarmCommand) { Data = alarm });

Log.Debug("fire an alarm alarm is fired ");

Our log is below;

2023-08-15 16:59:08,111 [DEBUG] - fire an alarm eventHeader.ID = ff271d0e-2029-4363-8884-141aa09b33ec

2023-08-15 16:59:08,111 [DEBUG] - fire an alarm eventHeader.Message = zone36-sensor4 Climb Alarm

2023-08-15 16:59:08,355 [DEBUG] - fire an alarm alarm is fired

We noticed that there is below MIPSDK exception at [C:\ProgramData\Milestone\MIPSDK\MIP20230815.txt](file:C:/ProgramData/Milestone/MIPSDK/MIP20230815.txt)

2023-08-15 16:48:46.184 Debug: LicenseManager ():Licenses: Name=XPIM, Type=XPIM, Counter=1

2023-08-15 16:59:08.354 Error: BaseEventHandler ():Exception source: System.ServiceModel

Exception type: System.ArgumentException

Exception message: The provided URI scheme ‘https’ is invalid; expected ‘http’.

Parameter name: via

Exception target site: ValidateScheme

at System.ServiceModel.Channels.TransportChannelFactory`1.ValidateScheme(Uri via)

at System.ServiceModel.Channels.HttpChannelFactory`1.ValidateCreateChannelParameters(EndpointAddress remoteAddress, Uri via)

at System.ServiceModel.Channels.HttpChannelFactory`1.OnCreateChannelCore(EndpointAddress remoteAddress, Uri via)

at System.ServiceModel.Channels.HttpChannelFactory`1.OnCreateChannel(EndpointAddress remoteAddress, Uri via)

at System.ServiceModel.Channels.ChannelFactoryBase`1.InternalCreateChannel(EndpointAddress address, Uri via)

at System.ServiceModel.Channels.ChannelFactoryBase`1.CreateChannel(EndpointAddress address, Uri via)

at System.ServiceModel.Channels.SecurityChannelFactory`1.OnCreateChannel(EndpointAddress address, Uri via)

at System.ServiceModel.Channels.ChannelFactoryBase`1.InternalCreateChannel(EndpointAddress address, Uri via)

at System.ServiceModel.Channels.ChannelFactoryBase`1.CreateChannel(EndpointAddress address, Uri via)

at System.ServiceModel.Channels.ServiceChannelFactory.ServiceChannelFactoryOverRequest.CreateInnerChannelBinder(EndpointAddress to, Uri via)

at System.ServiceModel.Channels.ServiceChannelFactory.CreateServiceChannel(EndpointAddress address, Uri via)

at System.ServiceModel.Channels.ServiceChannelFactory.CreateChannel(Type channelType, EndpointAddress address, Uri via)

at System.ServiceModel.ChannelFactory`1.CreateChannel(EndpointAddress address, Uri via)

at System.ServiceModel.ChannelFactory`1.CreateChannel()

at System.ServiceModel.ClientBase`1.CreateChannel()

at System.ServiceModel.ClientBase`1.CreateChannelInternal()

at System.ServiceModel.ClientBase`1.get_Channel()

at System.ServiceModel.ClientBase`1.get_InnerChannel()

at System.ServiceModel.ClientBase`1.System.ServiceModel.ICommunicationObject.Open(TimeSpan timeout)

at System.ServiceModel.ClientBase`1.Open()

at VideoOS.Platform.Proxy.AlarmClient.AlarmClientCredentials.OpenClient()

at VideoOS.Platform.Proxy.AlarmClient.AlarmClientManager.GetAlarmClient(ServerId serverId)

at VideoOS.Platform.SDK.Platform.MessageManager.BaseAlarmHandler(Message message, FQID dest, FQID source)

Is the server setup to use secure communication?

Please check with the Server Configurator, Encryption tab. See if it uses “Server Certificate (Management Serve etc.)” for encryption and/or “Event Server and add-ons” certificate for encryption.

I have a hunch that your development and production might differ regarding using this, please let me know if encryption is enabled for the two categories.

Please also specify what product and version is the XProtect and what version of the MIP SDK are you using building the solution you have.

Hi Andersen,

Yes, our production we use secured communication with certificate.

While we do not use secured communication in our development environment.

In view this difference, please assist us a small piece of c# code for login with secured communication, or point us a sample program which use secured communication, thank you.

Best Regards,

Shen Jinmin

Using the code you do from the MIP Library it is automatic.

My guess, and the simplest explanation for the issue, is that you are building your solution with an old MIP SDK prior to the introduction of secured communication with the Event Server. If my guess is right the solution is easy, just re-build your solution while using an newer MIP SDK.

Announcement about the change.

https://doc.developer.milestonesys.com/html/index.html?base=gettingstarted/mip2022r1_intro.html&tree=tree_search.html?search=encrypt

The LibraryEventGenerator sample uses the same command, and has been heavily tested with and without secured communication. I mention this only so that you can be assured the same command still works.

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

https://github.com/milestonesys

The dependent files for the MIP SDK is available as a NuGet package. Use this to rebuild.

https://www.nuget.org/profiles/milestonesys

Hi Andersen,

Thank you very much for your advice.

I installed the dependent files for the MIP SDK from NuGet packages.

I am not able to recompile and get errors.

So, I installed a new version of SDK, Milestone MIP SDK Tools 2022 R2 Installer

However, it does not have the samples anymore, the previous SDK version has below samples

Where we can get these samples? Thank you

[C:\Program](file:C:/Program) Files\Milestone\MIPSDK>

Bin ComponentSamples Html Include Installers Lib PluginSamples ProtocolSamples Tools ToolSamples WSDL XSD

Best Regards,

Shen Jinmin

There is no MIP SDK installer, it has been discontinued. The content and purpose of the Milestone MIP SDK Tools Installer is something different. I recommend a read of this getting started if this sounds confusing. https://content.milestonesys.com/media/?mediaId=230C2432-D7A4-418C-A97052119509406D

The samples are now published at https://github.com/milestonesys