kopia lustrzana https://github.com/projecthorus/radiosonde_auto_rx
rs92,rs41,imet1ab,dfm,m10: output -> nmea, viking-gpsd
rodzic
a6aebc6dd7
commit
083bf60be5
|
@ -3,7 +3,21 @@ use strict;
|
|||
use warnings;
|
||||
|
||||
|
||||
my $filename = $ARGV[0];
|
||||
my $filename = undef;
|
||||
my $date = undef;
|
||||
|
||||
while (@ARGV) {
|
||||
if ($ARGV[0] eq "--date") {
|
||||
shift @ARGV;
|
||||
if (defined $ARGV[0]) {
|
||||
$date = shift @ARGV;
|
||||
}
|
||||
}
|
||||
else {
|
||||
$filename = shift @ARGV;
|
||||
}
|
||||
}
|
||||
|
||||
my $fpi;
|
||||
|
||||
if (defined $filename) {
|
||||
|
@ -13,7 +27,6 @@ else {
|
|||
$fpi = *STDIN;
|
||||
}
|
||||
|
||||
|
||||
my $fpo = *STDOUT;
|
||||
|
||||
|
||||
|
@ -25,10 +38,18 @@ my $NS; my $EW;
|
|||
my $cs;
|
||||
my $str;
|
||||
|
||||
my $date = 271016; ## (d)dmmyy ohne fuehrende 0 (wenn log kein Datum enthaelt)
|
||||
my $speed = 0.00;
|
||||
my $course = 0.00;
|
||||
|
||||
if (defined $date && $date =~ /(\d?\d\d\d\d\d)/) {
|
||||
$date = $1;
|
||||
}
|
||||
else {
|
||||
$date = 21116; ## (d)dmmyy ohne fuehrende 0 (wenn pos-log kein Datum enthaelt)
|
||||
}
|
||||
|
||||
my $geoid = 50.0; ## GPS ueber Ellipsoid; Geoid-Hoehe in Europa ca 40-50m
|
||||
|
||||
while ($line = <$fpi>) {
|
||||
if ($line =~ /(\d\d):(\d\d):(\d\d\.?\d?\d?\d?).*\ +lat:\ *(-?\d*)(\.\d*)\ +lon:\ *(-?\d*)(\.\d*)\ +alt:\ *(-?\d*\.\d*).*/) {
|
||||
|
||||
|
@ -57,8 +78,7 @@ print STDERR $line;
|
|||
$cs ^= $_ for unpack 'C*', $str;
|
||||
printf $fpo "\$$str*%02X\n", $cs;
|
||||
|
||||
## GPS ueber Ellipsoid; Geoid-Hoehe nicht beruecksichtigt
|
||||
$str = sprintf ("GPGGA,%010.3f,%08.3f,$NS,%09.3f,$EW,1,04,0.0,%.3f,M,0.0,M,,", $hms, $lat, $lon, $alt);
|
||||
$str = sprintf("GPGGA,%010.3f,%08.3f,$NS,%09.3f,$EW,1,04,0.0,%.3f,M,%.1f,M,,", $hms, $lat, $lon, $alt-$geoid, $geoid);
|
||||
$cs = 0;
|
||||
$cs ^= $_ for unpack 'C*', $str;
|
||||
printf $fpo "\$$str*%02X\n", $cs;
|
||||
|
@ -70,13 +90,14 @@ close $fpi;
|
|||
close $fpo;
|
||||
|
||||
|
||||
#############################################################################################################################################
|
||||
#############################################################################################################################
|
||||
##
|
||||
## term-1$ socat -d -d pty,raw,echo=0 pty,raw,b4800,echo=0 #[default baudrate 38400]
|
||||
## N PTY is /dev/pts/12
|
||||
## N PTY is /dev/pts/15
|
||||
##
|
||||
## term-2$ sox -t oss /dev/dsp -t wav - lowpass 3600 2>/dev/null | ./rs92ecc --ecc --crc --vel2 -e brdc3010.16n | ./pos2nmea.pl > /dev/pts/12
|
||||
## term-2$ sox -t oss /dev/dsp -t wav - lowpass 3600 2>/dev/null | ./rs92ecc --ecc --crc --vel2 -e brdc3010.16n | \
|
||||
## ./pos2nmea.pl --date 31116 > /dev/pts/12
|
||||
##
|
||||
## term-3$ gpsd -D2 -b -n -N /dev/pts/15
|
||||
##
|
||||
|
@ -84,5 +105,6 @@ close $fpo;
|
|||
##
|
||||
## Viking: GPS-layer, Realtime Tracking Mode, gpsd-port: 2947
|
||||
##
|
||||
#############################################################################################################################################
|
||||
#############################################################################################################################
|
||||
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue