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

Setting time on PK-96 TNC



Unless you add the optional clock chip, the PK-96 TNC looses the time
setting when it looses power. I got tired of looking up the command, so I
created the following Perl program on my PC to read the time from my PC,
which is updated via an NTP server.

#######################################################
#                                                     #
# Program to set time on PK-96 TNC from PC clock      #
#                                                     #
# By: Don Woodward - KD4APP                           #
#                                                     #
#######################################################
$t = time();
($sec,$min,$hour,$day,$mon,$year,$wday,$yday,$isdst) = localtime($t);
$y = $year - 100;
$year1 = $y < 10 ? "0".$y : $y;
$mon1 = $mon < 10 ? "0".$mon : $mon;
$day1 = $day < 10 ? "0".$day : $day;
$hour1 = $hour < 10 ? "0".$hour : $hour;
$min1 = $min < 10 ? "0".$min : $min;
$sec1 = $sec < 10 ? "0".$sec : $sec;
print "Date is: $mon1/$day1/$year1 and Time is: $hour1:$min1:$sec1 \n";
print "Sending TNC this command to set time: daytime
$year1$mon1$day1$hour1$min1$sec1 \n";
$file = "com2:";
$command = "daytime $year1$mon1$day1$hour1$min1$sec1 \n";
open(FIFO, "> $file") || die "Cannot open $file \n";
print FIFO "daytime $year1$mon1$day1$hour1$min1$sec1 \n";
close FIFO;

--------------------------------
Don Woodward
KD4APP
AMSAT 33535
kd4app@amsat.org
http://kd4app.webhop.org


----
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