Hi,
I am using matlab and freemaster rpc-server for automatic data logging.
I tried to get all the information from the freemaster lite JS api because there is no rpc-server api where the json structures for the commands are defined or at least I could not find it.
So far it has worked and I can read and write variables and stop the communication, but the structure to start communication does not work. Does anyone here have an idea what is wrong with this?
jsonMessage2(1).jsonrpc="2.0";
jsonMessage2(1).method="StartComm";
jsonMessage2(1).params=["comm_plugin_conn","name","addr=localhost;port=9990;timeout=500","string"];
jsonMessage2(1).id=0;
The error message is: msg: 'StartComm: Could not open the communication port (Error 0x848a0001: Connect string invalid.) !'
I got the connection string from the freemaster desktop application running with an existing freemaster project, in the UI I can start the communication without problems.
解決済! 解決策の投稿を見る。
Hi @Ickes,
StartComm expects a single argument - connection string:
It can be passed as positional or named argument.
In your case the message could look like this (assuming the target is connected to you PC via UART):
(positional):
jsonMessage2(1).jsonrpc="2.0";
jsonMessage2(1).method="StartComm";
jsonMessage2(1).params=["RS232;port=COM1;speed=115200"];
jsonMessage2(1).id=0;
(named):
jsonMessage2(1).jsonrpc="2.0";
jsonMessage2(1).method="StartComm";
jsonMessage2(1).params={"name": "RS232;port=COM1;speed=115200"};
jsonMessage2(1).id=0;
Currently, there is no explicit description of the JSON messages. The message can be inferred from the JS client y following these 2 rules:
Hope it helps,
Iulian
Hi @iulian_stan,
thank you for your reply. I am using the FreeMASTER tcp to serial plugin and found a way to start the communication.
With the plugin the necessary string consists of the comm-plugin-id followed by the comm-plugin-string
''' StartCommMessage(1).params=["{comm-plugin-id};comm-plugin-string","name"];
Hi @Ickes,
StartComm expects a single argument - connection string:
It can be passed as positional or named argument.
In your case the message could look like this (assuming the target is connected to you PC via UART):
(positional):
jsonMessage2(1).jsonrpc="2.0";
jsonMessage2(1).method="StartComm";
jsonMessage2(1).params=["RS232;port=COM1;speed=115200"];
jsonMessage2(1).id=0;
(named):
jsonMessage2(1).jsonrpc="2.0";
jsonMessage2(1).method="StartComm";
jsonMessage2(1).params={"name": "RS232;port=COM1;speed=115200"};
jsonMessage2(1).id=0;
Currently, there is no explicit description of the JSON messages. The message can be inferred from the JS client y following these 2 rules:
Hope it helps,
Iulian