direwolf/scripts/telemetry-toolkit/telem-balloon.pl

43 lines
1.3 KiB
Perl
Raw Permalink Normal View History

Development snapshot 1.3 dev F. Changes to be committed: modified: .gitattributes modified: CHANGES.md modified: Makefile modified: Makefile.linux new file: Makefile.macosx modified: Makefile.win modified: aclients.c modified: aprs_tt.c modified: aprs_tt.h modified: atest.c modified: audio.c modified: audio.h new file: audio_portaudio.c new file: audio_stats.c new file: audio_stats.h modified: audio_win.c modified: ax25_pad.c modified: ax25_pad.h modified: beacon.c modified: config.c modified: config.h modified: decode_aprs.c modified: decode_aprs.h modified: demod.c modified: digipeater.c modified: direwolf.c modified: direwolf.h modified: dlq.c modified: doc/README.md modified: doc/Raspberry-Pi-APRS.pdf modified: doc/User-Guide.pdf new file: doc/WA8LMF-TNC-Test-CD-Results.pdf modified: dtime_now.c modified: dtmf.c modified: dw-start.sh modified: encode_aprs.c modified: encode_aprs.h modified: gen_packets.c modified: gen_tone.c modified: gen_tone.h new file: generic.conf modified: grm_sym.h modified: hdlc_rec.c modified: hdlc_rec.h modified: igate.c modified: kiss.c modified: kiss_frame.c modified: kissnet.c modified: latlong.c modified: man1/direwolf.1 modified: mgn_icon.h modified: misc/README-dire-wolf.txt new file: misc/strlcat.c new file: misc/strlcpy.c modified: morse.c new file: morse.h modified: nmea.c modified: pfilter.c modified: ptt.c new file: serial_port.c new file: serial_port.h modified: server.c modified: symbols.c modified: symbols.h new file: telemetry-toolkit/telem-balloon.conf new file: telemetry-toolkit/telem-balloon.pl new file: telemetry-toolkit/telem-bits.pl new file: telemetry-toolkit/telem-data.pl new file: telemetry-toolkit/telem-data91.pl new file: telemetry-toolkit/telem-eqns.pl new file: telemetry-toolkit/telem-m0xer-3.txt new file: telemetry-toolkit/telem-parm.pl new file: telemetry-toolkit/telem-unit.pl new file: telemetry-toolkit/telem-volts.conf new file: telemetry-toolkit/telem-volts.py modified: telemetry.c modified: textcolor.c modified: tq.c modified: tt_text.c modified: tt_text.h modified: tt_user.c modified: tt_user.h modified: utm2ll.c modified: version.h new file: walk96.c modified: xmit.c
2015-09-07 23:56:20 +00:00
#!/usr/bin/perl
# Part of Dire Wolf APRS Telemetry Toolkit, WB2OSZ, 2015
# In a real situation this would obtain data from sensors.
# For demonstration purposes we use historical data supplied on the command line.
if ($#ARGV+1 != 5) {
print STDERR "5 command line arguments must be provided.\n";
usage();
}
($seq,$vbat,$vsolar,$temp,$sat) = @ARGV;
# Scale to integer in range of 0 to 8280.
# This must be the inverse of the mapping in the EQNS message.
$vbat = int(($vbat * 1000) + 0.5);
$vsolar = int(($vsolar * 1000) + 0.5);
$temp = int((($temp + 273.2) * 10) + 0.5);
exit system("telem-data91.pl $seq $vbat $vsolar $temp $sat");
sub usage ()
{
print STDERR "\n";
print STDERR "balloon.pl - Format data into Compressed telemetry format.\n";
print STDERR "\n";
print STDERR "In a real situation this would obtain data from sensors.\n";
print STDERR "For demonstration purposes we use historical data supplied on the command line.\n";
print STDERR "\n";
print STDERR "Usage: balloon.pl seq vbat vsolar temp sat\n";
print STDERR "\n";
print STDERR "Where,\n";
print STDERR " seq is a sequence number.\n";
print STDERR " vbat is battery voltage.\n";
print STDERR " vsolar is solar cell voltage.\n";
print STDERR " temp is temperature, degrees C.\n";
print STDERR " sat is number of GPS satellites visible.\n";
exit 1;
}