How can I change the port number? (ZeroMQ API - python)

Typically: "How do I... ", "How can I... " questions
Post Reply
wenyu
Posts: 13
Joined: 08 Mar 2021, 01:49

How can I change the port number? (ZeroMQ API - python)

Post by wenyu »

Hello!
I use the ZeroMQ remote API for Python. How can I change the port number?
python :

Code: Select all

client = RemoteAPIClient(host='localhost', port=23005)
sim = client.getObject('sim')
But I don't know how to change the corresponding port number in vrep V4.5.
Thanks.

fferri
Posts: 1230
Joined: 09 Sep 2013, 19:28

Re: How can I change the port number? (ZeroMQ API - python)

Post by fferri »

You can start CoppeliaSim passing the command line parameter -GzmqRemoteApi.rpcPort=23005.

Or with CoppeliaSim already started, execute sim.setNamedInt32Param('zmqRemoteApi.rpcPort',23005) (e.g. in the lua commander at bottom of screen) and then restart the ZMQ Remote API server addon.

wenyu
Posts: 13
Joined: 08 Mar 2021, 01:49

Re: How can I change the port number? (ZeroMQ API - python)

Post by wenyu »

Thanks for your reply, but it doesn't work.
execute sim.setNamedInt32Param('zmqRemoteApi.rpcPort',23005), and restart python program. The robot doesn't respond.

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

Re: How can I change the port number? (ZeroMQ API - python)

Post by coppelia »

Hello,

make sure to identify the source of the problem. When you say the robot doesn't respond, this doesn not necessarily mean that the remote API cannot communicate with CoppeliaSim. Is there an error message on the client or CoppeliaSim side, and if yes, what does it say?

Cheers

fferri
Posts: 1230
Joined: 09 Sep 2013, 19:28

Re: How can I change the port number? (ZeroMQ API - python)

Post by fferri »

fferri wrote: 05 Apr 2023, 12:36 ... and then restart the ZMQ Remote API server addon.
That is done via the menu Modules -> Connectivity -> ZMQ Remote API Server

wenyu
Posts: 13
Joined: 08 Mar 2021, 01:49

Re: How can I change the port number? (ZeroMQ API - python)

Post by wenyu »

Thanks for your reply. It helped me a lot.

thumengql
Posts: 1
Joined: 14 Feb 2024, 11:22

Re: How can I change the port number? (ZeroMQ API - python)

Post by thumengql »

For me, the -Gxx parameter does not work.

I used

Code: Select all

coppeliaSim.exe -c"sim.setNamedStringParam('zmqRemoteApi.rpcPort',23005)"
and it works

fferri
Posts: 1230
Joined: 09 Sep 2013, 19:28

Re: How can I change the port number? (ZeroMQ API - python)

Post by fferri »

thumengql wrote: 14 Feb 2024, 11:26 For me, the -Gxx parameter does not work.
Make sure to use the latest version of CoppeliaSim.

One of the previous 4.6.x releases had a bug with -G options.

Post Reply