[Date Prev][Date Next][Thread Prev][Thread Next] - [Date Index][Thread Index][Author Index]

RE: [Xastir] using XASTIR as a sat tracking program (code included)



#!/usr/bin/perl
use Socket;
use Net::Telnet;
my $port = 1210;
my ($predict_server, $satellite);
$satellite ="ISS";
$predict_server = "localhost";
my ($d1, $d2, $d3, $d4, $rawserver) = gethostbyname($predict_server);
my $serveraddr = pack("Sna4x8", 2, $port, $rawserver);
my $prototype = getprotobyname('udp');
socket(SOCKET,2,SOCK_DGRAM,$prototype) || die("No Socket\n");
$| = 1;  # no buffering
$SIG{ALRM} = \&time_out;
alarm(10);  # Force exit if no response from server
send(SOCKET, "GET_SAT $satellite\0" , 0 , $serveraddr) or die("UDP send
failed $!\n");
my $server_response = '';  # required by recv function
recv(SOCKET, $server_response, 100, 0) or die "UDP recv failed $!\n";
my ($name, $lon, $lat, $az, $el, $aos_seconds, $foot) = split /\n/,
$server_response;
print $lat." ".$lon."\n";
my $aos_time_date = gmtime($aos_seconds);
close(SOCKET);
$ns ="S";
if ($lat =~ m/\+/)
{
$ns = "N";
}
$lat =~ s/-+//g;
if ($lon < 180)
{
$ew = "W";
$lon3 = $lon;
}
elsif ($lon > 180)
{
$lon3 = 360 -$lon;
$ew = "E";
}
$lon1 = sprintf "%.3d",int($lon3);
$lat1 = sprintf "%02d",int($lat);
$host = "localhost";
$t = new Net::Telnet(Timeout=> '5', port => '2023', Dump_Log   =>
"/maint/scripts/predict_uiview.log");
$t->errmode('return');
$t->Net::Telnet::open($host);
sleep 2;
print $t "user VK4TEC pass 21694 \n";
sleep 3;
print $t
"MISSE5>APU25N,WIDE:=".$lat1."00.00".$ns."\\".$lon1."00.00".$ew."SPCSAT2 on
ISS\n";
print
"MISSE5>APU25N,WIDE:=".$lat1."00.00".$ns."\\".$lon1."00.00".$ew."SPCSAT2 on
ISS\n";
sleep 2;
$t->close;
sleep 15;

sub time_out
{
die "Server not responding for satellite $satellite\n";
}





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

-----Original Message-----
From: N1OFZ [mailto:n1ofz@arrl.net]
Sent: Saturday, 17 September 2005 4:50 AM
To: Andrew Rich
Subject: Re: [Xastir] using XASTIR as a sat tracking program



I'd love to have see your perl script!  I use predict and gsat.  I
also have xastir running so it would be great to have one less map
app running.

Dana
N1OFZ



On Sep 16, 2005, at 2:00 PM, Andrew Rich wrote:

> I am using XASTIR as a satellite tracking program
>
> I use perl to ask predict where a satllite is
>
> then i conenct to xastor on port 2023 and put an icon on the map
>
> anyone know how to do circles ?
>
> -----------------------------------------
> Andrew Rich - VK4TEC
> Satellite Ground Station for PCSAT2
> vk4tec@tech-software.net
> www.tech-software.net
> Brisbane AUSTRALIA
----
Sent via amsat-bb@amsat.org. Opinions expressed are those of the author.
Not an AMSAT member? Join now to support the amateur satellite program!
To unsubscribe, send "unsubscribe amsat-bb" to Majordomo@amsat.org



AMSAT Top AMSAT Home