Remote API (legacy) client sends command to wrong remote API host

Report crashes, strange behaviour, or apparent bugs
Post Reply
Uli_v
Posts: 35
Joined: 14 Dec 2018, 18:07

Remote API (legacy) client sends command to wrong remote API host

Post by Uli_v » 25 Jun 2019, 17:25

In my small working example to reproduce the bug I have two remote API clients that communicate to 4 remote API servers. The clients connect to the simulation, restart (stop/start) the simulation, print something to two terminals and console of the simulator (via remote API calls). If I do that with two clients a few times, then it might happen that the message belonging to different terminals/hosts appear in the same or wrong terminal/host. I tested this with V-REP 3.5.0 and 3.6.1 rev3 (both have the issue).

Here is the working example to reproduce:
https://drive.google.com/open?id=1u6OW7 ... WpfVJgjSMD

How to reproduce:

Start 4 simulators, one in each terminal

Code: Select all

 ./vrep.sh multiple_remote_api_host_clients.ttt  -gREMOTEAPISERVERSERVICE_19997_FALSE_FALSE
 ./vrep.sh multiple_remote_api_host_clients.ttt  -gREMOTEAPISERVERSERVICE_19998_FALSE_FALSE
 ./vrep.sh multiple_remote_api_host_clients.ttt  -gREMOTEAPISERVERSERVICE_19999_FALSE_FALSE
 ./vrep.sh multiple_remote_api_host_clients.ttt  -gREMOTEAPISERVERSERVICE_20000_FALSE_FALSE
Run this script with arguments "0 1" first:

Code: Select all

python multiple_sims_debug.py 0 1
Observe outputs in the terminals (and simulation). It should print the right output to two different terminals.

Run this script with arguments "2 3":

Code: Select all

python multiple_sims_debug.py 2 3
Observe outputs in the terminals (and simulation). It should print the right output to two different terminals.

Run this script with arguments "0 1":

Code: Select all

python multiple_sims_debug.py 0 1
Observe outputs in the terminals (and simulation). You might have to repeat running "python multiple_sims_debug.py 0 1" and "python multiple_sims_debug.py 2 3" a few times until the issue happens.

ISSUE!
It is now printing to the single terminal (e.g. terminal started with port 19998, offset 1) and nothing to terminal 0 (started with port 19997, offset 0).
In same terminal it prints:

Code: Select all

Print via API call: 	sim_port_offset 0?
Print via API call: 	sim_port_offset 1?
The first line is the issue (it should not print "sim_port_offset 0" in terminal started with port 19998, with sim_port_offset 1).
It also printing to the same V-REP console (GUI).

coppelia
Site Admin
Posts: 7441
Joined: 14 Dec 2012, 00:25

Re: Remote API (legacy) client sends command to wrong remote API host

Post by coppelia » 27 Jun 2019, 06:26

Hello,

before I dig deeper into this issue, can you make sure that you do not additionally try to open a remote API port via the file remoteApiConnections.txt ?

Cheers

Uli_v
Posts: 35
Joined: 14 Dec 2018, 18:07

Re: Remote API (legacy) client sends command to wrong remote API host

Post by Uli_v » 27 Jun 2019, 16:57

I though that these just specify the configuration of the servers (if started), but they actually start the servers too? I will comment them out and try again.

I got this in the remoteApiConnections.txt (for V-REP 3.6.1 rev3).

Code: Select all

portIndex1_port             = 19997
portIndex1_debug            = false
portIndex1_syncSimTrigger   = false
And this in V-REP 3.5.0:

Code: Select all

portIndex1_port             = 19997
portIndex1_debug            = false
portIndex1_syncSimTrigger   = true

Post Reply