[OZAPRS] PERL Code : Talk to PREDICT and tune D700 Radio

Chris Hill chris.hill at crhtelnet.com.au
Sun Aug 28 14:37:24 EST 2005


Hi Andrew,

This is looking good.  Some thoughts for consideration:

1.  Can you also define $uplink_freq, and set the D-700 to the right TX
frequency (which of course needs to be the opposite compensation compared
to
the downlink_freq)

2.  Can the setting of uplink and downlink freq be elegantly handled,
regardless of whether the uplink and downlink is in the same band (eg
ISS),
or separate bands (eg PCSAT2)?

3.  What about some sanity checking of the frequencies you are setting the
radio to (just in case a bizarre range rate is returned from the tracking
software).  Especially important when setting the TX frequency.


Well done, anyway...  I can see myself modifying this to run on my linux
box, to drive my FT-736, or similar.


Regards,



Chris
vk6kch





-----Original Message-----
From: ozaprs-bounces at marconi.ics.mq.edu.au
[mailto:ozaprs-bounces at marconi.ics.mq.edu.au] On Behalf Of Andrew Rich
Sent: Sunday, 28 August 2005 7:50 AM
To: Ozaprs
Subject: [OZAPRS] PERL Code : Talk to PREDICT and tune D700 Radio 

#!/usr/bin/perl
#
# Talk to PREDICT satellite tracking and tune Kenwood D700 Radio
#
# Andrew Rich VK4TEC Aug 2005
#
use Socket;
use Net::Telnet;
use Math::Round;
$frequency = "437975";
my $port = 1210;
my ($predict_server, $satellite);
if ($#ARGV eq 1)
{
$predict_server = $ARGV[0];
$satellite = $ARGV[1];
}
else
{
print "WARNING: Use syntax \"predict_radiocontrol.pl hostname satellite\"
(i.e., predict_radioconttrol localhost ISS)\n";
print "Substituting default arguments\n";
$predict_server = "localhost";
$satellite = "ISS";
}
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_DOPPLER $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";
$shift = (($server_response * 4.375) / 1000 );
$newfreq = (int($frequency + $shift));
$rounded = nearest(5,$newfreq) ;
$date = `date +%d/%m/%y" "%H:%M:%S`;
chop $date;
print "DATE: $date \n";
print "SATT: $satellite \n";
print "BASE: $frequency \n";
print "HOST: $predict_server \n";
print "PORT: $port \n";
print "TUNE: $rounded \n";
print "DOPP: $shift \n\n";
open (comport, "> /dev/ttyS0");
print comport "FQ 00".$rounded."000,0\n";
close(comport);
close(SOCKET);
sub time_out
{
die "Server not responding for satellite $satellite\n";
}

_______________________________________________
ozaprs mailing list
ozaprs at marconi.ics.mq.edu.au
http://marconi.ics.mq.edu.au/cgi-bin/mailman/listinfo/ozaprs


_______________________________________________
ozaprs mailing list
ozaprs at marconi.ics.mq.edu.au
http://marconi.ics.mq.edu.au/cgi-bin/mailman/listinfo/ozaprs



More information about the Ozaprs mailing list