Question about TCPReporting.

Hi,

I am willing to obtain data from a TaskContext class and put it into a socket. I have been checking the TCPReporting example but I have some problems about it:

1) I can't manage to fully work following the instructions contained in the class documentation with TCPReporting and a Telnet session or an echo/reply client.c.
2) I would like to know if there is a working client version somewhere.
3) How can I send information from a R/W TaskContext port into a socket .

Many thanks for your time in advance.

Regards.

Ruben Smits's picture

Question about TCPReporting.

On Sunday 13 July 2008 19:56:07 mintaka wrote:
> Hi,
>
> I am willing to obtain data from a TaskContext class and put it into a
> socket. I have been checking the TCPReporting example but I have some
> problems about it:
>
> 1) I can't manage to fully work following the instructions contained in the
> class documentation with TCPReporting and a Telnet session or an echo/reply
> client.c.

First you need to tell the reporter which data should be available. You have
to do this the same way as with the other reporters using a configuration
property file listing the components/data you want to report.

The TCPReporter is a server which can send data to different clients, each
client has to register himself and subscribe to the data he wants. Here's a
list of the necessary messages to do this:

#If you connect you should get the following message:
100 Orocos 1.0 TcpReporting Server 1.0

#Register yourself to the server (you have to send this exact string):
version 1.0

and apparently this does not work from a telnet session, i'm looking into it.
It does work using a python script:
-------
#!/usr/bin/python
from socket import *
import time
from os import *

host='localhost'
port=3142
addr=(host,port)
sock=socket(AF_INET,SOCK_STREAM)
sock.connect(addr)
print(sock.recv(1024))
sock.send('version 1.0\n')
print(sock.recv(1024))
#time.sleep(1)
sock.send('subscribe TimeStamp\n')
-------
which gives me:
-----
./tcp-client.py
100 Orocos 1.0 TcpReporting Server 1.0

101 OK

302 TimeStamp

-----

> 2) I would like to know if there is a working client version
> somewhere.
I'm using it at this moment from trunk and it works perfectly. There is a good
explanation at:

> 3) How can I send information from a R/W TaskContext port into a
> socket .
You cannot use the TCPReporting component for this because it's only for
reporting. I do have an application specific component that uses a socket to
retrieve command (retrieving data is similar). If you want i can send you a
code snippet.

Ruben

Hi Ruben, It would be very

Hi Ruben,

It would be very useful if you can send to me the code snippet in order to have a clear idea.

My email is: mintaka_alnitak [..] ...

Regards,

Question about TCPReporting.

On Sunday 13 July 2008 19:56:07 mintaka wrote:
> Hi,
>
> I am willing to obtain data from a TaskContext class and put it into a
> socket. I have been checking the TCPReporting example but I have some
> problems about it:
>
> 1) I can't manage to fully work following the instructions contained in the
> class documentation with TCPReporting and a Telnet session or an echo/reply
> client.c. 2) I would like to know if there is a working client version
> somewhere. 3) How can I send information from a R/W TaskContext port into a
> socket .

As far as I understand, this is a one-way system for logging data ports into a
file over a network.
If you want to send data to Orocos taskcontexts over a network, you can only
use the CORBA interface. Doing this from another C++ program is
straightforward if you can use the Orocos RTT library as well on the other
end. You can set up a 'ControlTaskProxy' to your remote TaskContext and use
its ports. If you don't have this option, you'll need to work through
the .idl CORBA interfaces.

Peter