mtbServer on macOS Monterey - Failure to start

Report crashes, strange behaviour, or apparent bugs
Post Reply
Posts: 1
Joined: 19 Jan 2022, 02:49

mtbServer on macOS Monterey - Failure to start

Post by jccordova »

MTB Robot's script fails to start mtbServer.

macOS Monterey 12.3.

CoppeliaSim 4.4.0

a) On an empty scene I put an MTB Robot (MTB Robot.ttm, from robots/non-mobile).

b) When I run the simulation it reports the following errors:
[/MTB@childScript:error] 325: in simMTB.startServer@simExtMTB: Failed to start or connect to MTB server.
stack traceback:
[C]: in function 'simExtMtb_startServer'
[string "/MTB@childScript"]:325: in function 'startRobotServer'
[string "/MTB@childScript"]:35: in function 'sysCall_init'
[/MTB@childScript:error] [string "/MTB@childScript"]:366: attempt to compare number with nil
stack traceback:
[string "/MTB@childScript"]:366: in function 'sysCall_cleanup'

c) The simulation is suspended.

The call to simMTB.startServer in the code (line 325) is:

local serverHandle,errorMsg=simMTB.startServer('mtbServer',portNb,theProgram,initJoints,initVel)

I located mtbServer in


If I open a terminal at that point and run it (./mtbServer) I get the following message:
Trying socket communication on port 20000
Connecting to client...

So I interrupted the process (mtbServer), went back to the code and edited the call to simMTB to manually stick in the port number:

local serverHandle,errorMsg=simMTB.startServer('mtbServer',20000,theProgram,initJoints,initVel)

I started the simulation and got the same error as before; THIS DID NOT WORK.

Nevertheless I left the code with the manual port number (20000) in there and I started mtbServer manually from my operating system terminal.

THEN I ran the simulation again and IT WORKED.

I also played with changing the first parameter 'mtbServer' but that had no effect; as long as I had manually started mtbServer, the simulation worked regardless of the string in the first parameter.

The MTB Robot's script will work as long as mtbServer is started beforehand, manually.
The function simMTB.startServer will not start mtbServer but WILL connect to an already initiated mtbServer as long as the port parameter matches that of the mtbServer (that's why I had to manually stick in the 20000).

¿What is preventing simMTB.startServer to start mtbServer and how to fix it?

I't doesn't seem to be something that has to do with permissions; I tried disabling the firewall and that would not fix the situation.

It doesn't happen on my Windows installation of CoppeliaSim.

Any insights will be appreciated.

Thank you.

Site Admin
Posts: 9762
Joined: 14 Dec 2012, 00:25

Re: mtbServer on macOS Monterey - Failure to start

Post by coppelia »

Hello, that is strange. Did you try with an absolute path to the mtbServer application?


Post Reply