On Sun, 2011-02-27 at 14:06 +0100, Roberto Inzerillo wrote:
> Hi everybody,
>   I'm fooling around with Arduino and FGFS, in order to create a few 
> physical instruments.
> 
> Since I felt like using an intermediate piece of software that manages 
> data transfers between Arduino and FGFS (Instead of connecting them 
> directly one to the other) and every crazy thing my sick mind can 
> produce, I started making FGFS talk to a Python using a telnet 
> connection, then the script talks to the Arduino board on a serial 
> connection. Well, it works ... but the telnet connection is very slow 
> and that slows down every intercation, it makes it far less than realtime.
> 
> I was wondering if that telnet connection FGFS provides to access it's 
> property tree is slow by design, if that's because Telnet can't do more 
> by itself, or maybe it's only me with my OS/hardware configuration that 
> makes it so terribly slow. Consider that everything runs on the very 
> same machine, there's no physical wire that telnet has to cross at all.
> 
> Btw, I did that on an AthlonII-250 based machine, both on Windows7-64bit 
> and Ubuntu 10 Linux, with Python 2.7 and 3.2, and an Arduino Mega2560 board.
> 
> Cheers,
>    Roberto
> 
Hi Roberto,

This is a GOOD question!

And some time earlier I read another post about the
'slowness' of the telnet connection to fgfs...

I quickly added some 'timing' to my telnet access,
through a perl script, and find :-

39 accesses took 15.57 secs, av 0.4 secs per access...

So I do not think it is your OS/hardware config!

These were all 'get <path>' reads of the property 
tree... after opening a tcp socket to $FGFS_IO, on
host and port, the general code (re-typed here,
so errors may have crept in!) is :-
my ($FGFS_IO);
my @intervals = ();

sub fgfs_send($) {
    print $FGFS_IO shift, "\015\012";
}

sub fgfs_get($$) {
    my ($txt,$rval) = @_;
    my $tb = [gettimeofday];
    fgfs_send("get $txt");
    eof $FGFS_IO and return 0;
    ${$rval} = <$FGFS_IO>;
    my $elap = tv_interval($tb,[gettimeofday]);
    push(@intervals,$elap);
    ${$rval} =~ s/\015?\012$//;
    ${$rval} =~ /^ERR (.*)/ and print "$1\n" and return 0;
    return 1;
}

# and one of the accessing services
sub fgfs_get_coord($$) {
    my ($rlon,$rlat) = @_;
    fgfs_get("/position/longitude-deg",$rlon) or exit(-2);
    fgfs_get("/position/latitude-deg",$rlat) or exit(-2);
}
etc...

That was over a fast local LAN, WIN32 to linux, but I have 
tried it in the one machine and get about the same... 

Does anyone have any reason for this?

Or is it that 'telnet' is slow anyway...

It certainly precludes any type of real time
interaction at present through telnet...

Look forward to more information on this, just to
understand what is possible...

Regards,
Geoff.



------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in 
Real-Time with Splunk. Collect, index and harness all the fast moving IT data 
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business 
insights. http://p.sf.net/sfu/splunk-dev2dev 
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to