How to communicate with local mobile server using mobile SDK?

so I installed mobile server on each client pc. so web client mobileSDK will communicate with local mobile server. local mobile server communicates with milestone server. But mobile SDK couldn’t connect to local mobile server.

I saw some warning message in browser. “aborting video request for undefined”

I set mobile server IP as 127.0.0.1. this should work logically and your guide says mobile server can be one more and on local.

Hello Lee,

can you give us some more details what exactly does not work. By the error you have specify I can guess that the communication works but video does not start. If you have some logs that may also help. Wireshark trace will be much helpful.

Also you can check this video just to see if your setup is correct: https://www.youtube.com/watch?v=w-dXuFzCaFU

yes, communication looks like working.

The mobile SDK is working fine with mobile server which is on milestone server, but doesn’t work with one which I installed on local machine.

This is the problem I have exactly now

Hi Lee,

Where exactly are you specifying Mobile Server IP as 127.0.0.1?

Here you can follow the steps from our manual how to install mobile server on a separate machine from the Management Server. Please notice that in the In the Server URL field, you should fill in the primary management server address but not localhost address on your machine if management server is not installed there.

hello

If I put primary management server address for mobile server URL, my mobile SDK will communicate with local mobile server ? I don’t think so.

I think the local mobile server communicates with management server and mobile SDK communicates with local mobile server , so it can reduce management server’s usage. or I am wrong?

In mobile SDK, there is MobileServerURL. so you mean I need to put primary management server address for MobileServerURL? not local mobile server addresss 127.0.0.1 ?

Please advise. Thanks

Ok let me try do describe what is your setup and please correct me if I have misunderstood it:

  1. You have installed the Milestone system on machine A (bundle installation)
  2. You have installed only Milestone Mobile Server on machine B and it is connected with the VMS installed on the machine A by typing the machine A IP address in the Management Server Address window in tray controller

The problem as I understood is the SDK is working all together in the machine A but the same SDK does not work on machine B. Am I right?

great! that’s just what I did. you understood correctly.

In that case, SDK should work with machine B ? I checked your document, it says can use multiple mobile server on different machines.

Could you tell me what is the best solution and current way will work or not?

could you answer the above my question ?

Hello Teodor,

Here’s our set up (referred to above by Lee Bin).

Above, you can see 4 Mobile Servers (one is installed on the Surveillance Server).

All of the Mobile Servers are visible and known to the Surveillance Server (the Mobile Server IP Addresses are configured in setting in the Surveillance Server).

We are not using Milestone Smart-Client, nor the Milestone Web-Client (but they work).

We have a custom SSS-web-server/SSS-web-app.

Do you know how to route traffic between internet browsers, Mobile Servers, and custom SSS-web-server/SSS-web-apps?

Will the SSS Web-Server require a table of IP Addresses for all SSS-web-apps, or

is there some sort of mechanism we are not aware of to perform the routhing?

It seems that the web-browsers with local Mobile Servers could use 127.0.0.1 and the SSS-web-server IP addresses. We’re not sure about other web-browsers on computers that don’t have a local Mobile Server. Would they default to using the Mobile Server on the Milestone Surveillance Server)?

NOTE: We are using Milestone’s Central API (port #1237), Milestone Professional (non+) 2019 R1, Mobile Server 2019 R1, and MIP SDK 2020 R3.

Thank you.

Hi Daniel,

Thanks you for the picture.

I’m not sure however I fully understand the target architecture, even with the image.

I’ll kindly ask you to elaborate a little bit more on following topics:

  • What is “SSS Web-Server” ? Is this some sort of API Gateway, or Web Gateway, or Web Server, or just an Reverse Proxy ?
  • What is the “SecServer.exe” ? What is it’s relation with the Mobile JS SDK ? Is it a some sort of Web server that serves your Web application and Mobile JS SDK is just a part of it ?
  • Why SecServer.exe is connected to M251, BioStar2 and Milestone VMS?
  • Is your web Application supposed to be accessible always trough the SSL Web-Server (supposing the above assumptions are correct of course) ?
  • Why you would need multiple Mobile servers installed on multiple machines ? If this only for the purpose of Mobile JS SDK able to work correctly (connects to localhost) ? If that was the idea, I don’t think this is needed and just adds more complexity to the system.
  • I’m not sure I fully understand the sentence “the Mobile Server IP Addresses are configured in setting in the Surveillance Server”. How and where you have configured those IP addresses.

We want to answer your question (and Lee’s one) but we have to understand correctly the whole (bigger) “picture” first.

Thank you!

Hi Petar

actually, I was asking about Mobile SDK , mobile server and milestone server. we got it works. but we want to fetch the running mobile servers using central API, so we can assign mobile server to each web client app.

Could you tell me how to fetch the running mobile servers using central API or anything ?

You could try this one:

https://doc.developer.milestonesys.com/html/reference/protocols/registrationservice.html

Hello Teodor,

(1) ISSUE: We were able to connect (momentarily) to different Mobile Servers using our web-app (with 3 camera feeds). However, despite being connected and receiving video feeds, the “connection status” displayed on the Milestone Surveillance Server (i.e. a red or green icon) almost always shows red (meaning Mobile Server not connected). I was told this is a bug, and the red/green status icon cannot be trusted.

(2) ISSUE: However, after a while, the connection is lost, and we were not able to reestablish the connection until we restarted all services on the Surveillance Server. It is intermittent. We are only displaying 3 camera-feeds, so I don’t it is a network, CPU, or GPU issue.

(3) QUESTION: This is related to Lee Bin’s question above:

Is there a Central API function or some other mechanism to get the list of Mobile Servers’ IP Addresses from the Surveillance Server? That list will be used for routing between our web-app and the correct Mobile Server.

Thank you.

Daniel

You contact support for issues 1 and 2.

Hello Petar,

We found the issue of why some Mobile Servers not connecting (it appears that the Mobile Servers don’t work on systems with Windows 7).

Regarding the issue of multiple Mobile Servers:

We have the following IP Addresses in the XPMobileSDK.library.js and XPMobileSDK.js files, but we can only set one IP-Address, because the .js files are not dynamic.

QUESTION: Do you know of a mechanism that we can use for multiple Mobile Servers simultaneously (because the Mobile SDK files below are not dynamic)?

We are using the Central API in Professional (non+) 2019 R1, so I’m not sure how the suggested round-robin method (https://doc.developer.milestonesys.com/html/reference/protocols/registrationservice.html) would work?

//Adapter.js file:

const axios = require(‘axios’);

//= =======================================

// Connection Route

//= =======================================

exports.Connection = function (req, res, next) {

console.log(‘connecting…’);

var route = req.body.route;

var data = req.body.content;//‘<?xml version="1.0" encoding="utf-8"?><Communication xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance” xmlns:xsd=“http://www.w3.org/2001/XMLSchema”>RequestConnect\n’

var responseType = req.body.responseType;

var contentType = req.body.contentType;

//var serverIP = “http://127.0.0.1:8081/”; //localhost

//var serverIP = “http://192.168.1.103:8081/”; //TEST1 //TEST1 (this works)

//var serverIP = “http://192.168.1.107:8081/”; //AMS (this works)

var serverIP = “http://192.168.1.145:8081/”; //DESKTOP-4MA36CC (Mobile Server on Surveillance Server; this works)

console.log(serverIP + route)

axios.post(serverIP + route,

data,

{

  responseType: responseType,

  headers:{

    'Content-Type': contentType

  }

}).then(response => {

  if(typeof data === 'string' && data.search('Upload') > 0){

    console.log('VideoPushResponse: ', response.data)

  }

  let result = response.data;

  console.log(result)

  res.header('Access-Control-Allow-Origin', '\*');

  res.header('Access-Control-Allow-Methods', 'PUT, GET, POST, DELETE, OPTIONS');

  res.header('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept, Authorization, Access-Control-Allow-Credentials');

  res.header('Content-Type', 'text/xml; charset=utf-8')

  res.status(200).send(result);

}).catch(error => {

  console.log(error);

});

};

---------------------------------------------------------------

//XPMobileSDK.library.js

import $ from ‘jquery’

import rootReducer from ‘../redux’

let XPMobileSDK = {

library: {},

interfaces: {},

};

let XPMobileSDKSettings = {

fileName: ‘XPMobileSDK.js’,

clientType: ‘WebClient’,

communicationChanel: ‘XProtectMobile/Communication’,

videoChanel: ‘/XProtectMobile/Video’,

audioChannel: ‘/XProtectMobile/Audio’,

//MobileServerURL: ‘http://127.0.0.1:8081’, //TEST1 (this works?)

//MobileServerURL: ‘http://192.168.1.103:8081’, //TEST1 (this works)

//MobileServerURL: ‘http://192.168.1.107:8081’, //AMS (this works)

MobileServerURL: ‘http://192.168.1.145:8081’, //DESKTOP-4MA36CC (Mobile Server on Surveillance Server; this works)

defaultEncryptionPadding: ‘Iso10126’,

primeLength: 1024,

videoConnectionTimeout: 20000,

resamplingFactor: 1 / 1000000,

supportsMultiThreaded: false,

supportsCarousels: false,

supportsFootages: false,

supportsCHAP: true,

SupportsAudioIn: true,

SupportsAudioOut: false,

AudioCompressionLevel: 99,

AudioCompressionLevelAudioAPI: 41,

};

. . . . . . <<>>

Thanks, Daniel

No, I don’t.