Order Tray | Contact Us | Home | SIG Lists

[aprssig] RE: APRS server help

Andrew Rich vk4tec at tech-software.net
Fri Sep 16 07:36:24 UTC 2005


Kewl

Fixed with reconnect code

#!/usr/bin/perl
use Net::Telnet;
my $host = "second.aprs.net";
my $port = "14580";
my $t = new Net::Telnet(Timeout => '50',Dump_log => 'dump.log',Input_log =>
'input.log',Output_log => 'output.log',Prompt => "/$prmt/");
$t->errmode('return');
# $t->errmode('die');
$t->Net::Telnet::open(Host => $host, Port => $port);
print $t "user VK4TEC pass 21694 vers Perl 1.0 filter
p/PCSAT/PC2/W3AD/RS0/ISS d/RS0ISS-3/PCSAT2/W3ADO-1\n";
while ()
{
$from_buffer = $t->getline();
print $from_buffer;
$msg = $t->errmsg;
recon() if ($msg);
}

sub recon
{

print "Error: $msg\n";
$t->close();
$t->Net::Telnet::open(Host => $host, Port => $port);
print $t "user VK4TEC pass 21694 vers Perl 1.0 filter
p/PCSAT/PC2/W3AD/RS0/ISS d/RS0ISS-3/PCSAT2/W3ADO-1\n";
}

~

-----------------------------------------
Andrew Rich - VK4TEC
Satellite Ground Station for PCSAT2
vk4tec at tech-software.net
www.tech-software.net
Brisbane AUSTRALIA

-----Original Message-----
From: aprssig-bounces at lists.tapr.org
[mailto:aprssig-bounces at lists.tapr.org]On Behalf Of AE5PL Lists
Sent: Thursday, 15 September 2005 9:12 PM
To: TAPR APRS Mailing List
Subject: RE: [aprssig] RE: APRS server help


aprsd does not support server filters.  APRS servers will disconnect you
for a number of reasons, not the least of which is your ISP doing router
maintenance.

You have errmode set to 'return' yet you are not checking for an errmsg.
I am not sure that while(<$t>) will actually drop out upon error.  You
should increase your timeout to 30 seconds because the server sends
comment lines (prefixed with #) every 20 seconds as a keep alive.  If
you do have an errmsg, close the connection and reopen it and you should
be fine.  You can also set errmode to call a subroutine to do this.

Set Telnetmode to 0 so strange characters don't confuse the Telnet
module.

For clarity to the server sysop, I would recommend using something like
the following for your login line (this also negates having to use two
lines to send the filter):
print "user VK4TEC-10 pass xxxx vers Perl 1.0 filter
p/PCSAT/PC2/W3AD/RS0/ISS d/RS0ISS-3/PCSAT2/W3ADO-1\n";

73,

Pete Loveall AE5PL
mailto:pete at ae5pl.net

> -----Original Message-----
> From: Andrew Rich
> Posted At: Thursday, September 15, 2005 2:36 AM
> Subject: [aprssig] RE: APRS server help
>
> I have aprsd working, how do I send forward a filter string ?
>
> -----Original Message-----
> From: Andrew Rich [mailto:vk4tec at tech-software.net]
> Sent: Thursday, 15 September 2005 5:02 PM
> To: TAPR APRS Mailing List
> Subject: APRS server help
>
> It all works well, but after a few days, it just stops.
>
> The perl script does not bomb out.
>
> When I leave the perl script as it it, and look on
> second.aprs.net, it says i am disconnected.
>
> Is there anyting more reliable I can use ?
>
> I just want to log on and log to a file ?
>
> (after sending forward a filter )
>
> #!/usr/bin/perl
> use Net::Telnet;
> my $host = "second.aprs.net";
> my $user = "";
> my $password = "";
> my $prompt = "";
> my (@data, $line);
> my $t = new Net::Telnet(Timeout => '5',port => '14580');
> $t->errmode('return');
> $t->Net::Telnet::open($host);
> sleep 5;
> print $t "user VK4TEC-10 pass xxxx\n";
> sleep 3;
> print $t "# filter p/PCSAT/PC2/W3AD/RS0/ISS
d/RS0ISS-3/PCSAT2/W3ADO-1\n";
> while (<$t>) {
>  $date = `date +%d/%m/%y" "%H:%M:%S`;
>  chop $date;
>  # print $date."\n";
>  open (tnc, ">> /data/vkdata.txt");
>  print tnc "$date ";
>  print tnc $_ ;
>  close(tnc);
> }
> $t->close();
>
> Andew VK4TEC

_______________________________________________
aprssig mailing list
aprssig at lists.tapr.org
https://lists.tapr.org/cgi-bin/mailman/listinfo/aprssig






More information about the aprssig mailing list