Rosanswers logo


Following my previous post (not necessary to read it, I decided to open a new topic since the following issue is quite different an could be encountered in a different situation), I decided, in short, to create a node advertising services aiming to communicate with the DAQ card Labjack UE9 through a TCP socket.

So, when the service is called, a command is sent to a previously opened (and stored as class member) TCP socket and an answer is expected from this same socket.

The problem is, it seems that this TCP communication interfers with the one ROS uses to call it services. Indeed, no answer is received (recv function returns -1), and the card doesn't execute the command. Plus, I get an error message from the client node, saying

a message of over a gigabyte was predicted in tcpros. that seems highly unlikely, so I'll assume protocol synchronization is lost.

I read a few issues regarding this message, but they seem to be all different and kind of esoteric, though it seems to be linked to TCPROS implementation.

In my case, the TCP connection used to call the service seems to interfer with the one I use to communicate the Labjack. Do you think it's accurate? Would there be a way to fix it?

I must add that, when I use the same program but use USB instead of TCP via ethernet to send commands to the card, it works perfectly, so the problem definitely comes from TCP communication.


When running roswtf while I send service requests, it tells me :

WARNING The following nodes are unexpectedly connected :

  • unknown (http://localhost:somenumber/) -> /rosout (/rosout)

Te "somenumber" thingy changes everytime I run it, and strongly looks like a port number (44259 for example). Maybe it could be that the Labjack is sending back the TCP message to rosout instead of the node calling the command or something like this... I'm actually not that good in networking so I've got a hard time guessing where the issue comes from...

I configured my network with

ifconfig eth0 netmask

So it can communicate with the Labjack which IP address is

Originally posted by francoisdtf on ROS Answers with karma: 62 on 2015-06-25

Post score: 0

Original comments

Comment by gvdhoorn on 2015-06-26:
It would help if you posted the code you are trying to get working. Opening a TCP socket in a ROS node is something that is fully supported and should just work. Many nodes do the same, so it looks like you're doing something that is not entirely correct.

Comment by tfoote on 2015-06-27:
Code would be helpful. Without enough information to reproduce the problem you're only going to get guesses toward the solution. In general I'd suggest creating small test programs to test each part separately. Once those are working try combining into a larger system.


1 Answer 1


Rosanswers logo

Okay I'm really confused right now. I was opening the TCP connection in my class constructor, saving the socket ID in a class attribute. So I tried to open it directly in the service instead, and close it immediately. It worked, so I put it back as it was before, and surprisingly it worked this time

Originally posted by francoisdtf with karma: 62 on 2015-06-29

This answer was ACCEPTED on the original site

Post score: 0


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.