JSON-RPC does not work in multiple FreeMASTER instances

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

JSON-RPC does not work in multiple FreeMASTER instances

Jump to solution
1,462 Views
JaroslavP
Contributor I

Hello,

when using multiple FreeMASTER instances, only the first one is reachable using JSON-RPC. The web pages and JScript running in other instances are accessing the first running instance, similarly as other pages running standalone in a browser. I know there is a /rpcs command line option to change the JSON-RPC port, but there is no way for the HTML application to find out the port of “its” FreeMASTER instance. Or is it possible?

Thanks,

JP

0 Kudos
1 Solution
1,455 Views
MichalH
NXP Apps Support
NXP Apps Support

Hello Jaroslav,

indeed, use of the /rpcs command-line option is the only way how to run multiple FreeMASTER instances each with it own JSON-RPC server. And a client script or HTML application which connects to the server needs to know the port. We realize this is not very convenient use case. This is why plan the following change in the upcoming update 3.1.3:

If started without the /rpcs option, the JSON-RPC server will automatically probe and pick a different port in range of 41001..41015 in case the default 41000 is already used. This will enable up to 16 instances to run and have their JSON-RPC servers started.

The HTML/JScript applications running inside the Chromium component embedded in the FreeMASTER main window will be able to determine the correct port. The way to achieve it is to include a "virtual" <script> file with a special URL: fmstr://localapp/info.js. This file will be supplied on-fly by the parent FreeMASTER application and will define an object with information needed to establish a JSON-RPC connection.

Please refer to "What's new" section and a User Guide of the FreeMASTER 3.1.3 when it is released by end of this month.

Thanks,
Michal

View solution in original post

0 Kudos
1 Reply
1,456 Views
MichalH
NXP Apps Support
NXP Apps Support

Hello Jaroslav,

indeed, use of the /rpcs command-line option is the only way how to run multiple FreeMASTER instances each with it own JSON-RPC server. And a client script or HTML application which connects to the server needs to know the port. We realize this is not very convenient use case. This is why plan the following change in the upcoming update 3.1.3:

If started without the /rpcs option, the JSON-RPC server will automatically probe and pick a different port in range of 41001..41015 in case the default 41000 is already used. This will enable up to 16 instances to run and have their JSON-RPC servers started.

The HTML/JScript applications running inside the Chromium component embedded in the FreeMASTER main window will be able to determine the correct port. The way to achieve it is to include a "virtual" <script> file with a special URL: fmstr://localapp/info.js. This file will be supplied on-fly by the parent FreeMASTER application and will define an object with information needed to establish a JSON-RPC connection.

Please refer to "What's new" section and a User Guide of the FreeMASTER 3.1.3 when it is released by end of this month.

Thanks,
Michal

0 Kudos