V-REP Remote API Port Problems

Typically: "How do I... ", "How can I... " questions
Post Reply
skycoop
Posts: 2
Joined: 08 Jan 2016, 23:20

V-REP Remote API Port Problems

Post by skycoop »

I'm using the Remote API but V-REP isn't opening the port correctly. It's using an IP of 0.0.0.0 for some reason, not localhost (127.0.0.1). It's not that big of a problem, except that my co-workers' copies of V-REP all use localhost which means we have a code compatibility problem. I checked the "remoteApiConnections.txt" file, but there's no option to tell it to use localhost.

Any help would be appreciated.

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

Re: V-REP Remote API Port Problems

Post by coppelia »

Hello,

you are taking about two different things: ports and IP addresses. Localhost is an IP address, and is not selected on the V-REP side: the remote API client needs to specify the IP address where to connect to.

So we have:

V-REP side: specify port #

Remote API client side: specify IP address and port #

Cheers

skycoop
Posts: 2
Joined: 08 Jan 2016, 23:20

Re: V-REP Remote API Port Problems

Post by skycoop »

So I know for sure this issue is on V-REP's side. Immediately after launching V-REP, when I run:

Code: Select all

sudo netstat -tulpn | grep vrep
I get the following open ports:

Code: Select all

tcp        0      0 0.0.0.0:54981           0.0.0.0:*               LISTEN      3236/vrep       
tcp        0      0 0.0.0.0:52731           0.0.0.0:*               LISTEN      3236/vrep       
tcp        0      0 0.0.0.0:19997           0.0.0.0:*               LISTEN      3236/vrep       
udp        0      0 0.0.0.0:36217           0.0.0.0:*                           3236/vrep 
I know that it's at least opening the right port, I just don't know why it's opening them on 0.0.0.0.

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

Re: V-REP Remote API Port Problems

Post by coppelia »

You haven't understood how things work with socket communication. Imagine you want to send me a letter:

You are the sender (i.e. client, e.g. remote API client): you need to provide my address (i.e. my IP) and my mailbox number in my building (i.e. the port number)

I am the receiver (i.e. the server, e.g. V-REP): I just need to check my mailbox. So I just open my mailbox (i.e. the port number). But I do not provide any address! The post office knows my address (i.e. the system or the OS).

Once I have received your letter, then I can reply to it since your address is writen on it.

So again: V-REP as a server doesn't specify any IP address. The client does. Maybe there is a problem with the post office (i.e. the OS), as might suggest this post.

Cheers

Post Reply