Initial working iMet54 decoding.

pull/365/head
Mark Jessop 2021-01-24 22:18:20 +10:30
rodzic d772837777
commit 796580e162
4 zmienionych plików z 30 dodań i 7 usunięć

Wyświetl plik

@ -642,7 +642,7 @@ def main():
"--type",
type=str,
default=None,
help="Immediately start a decoder for a provided sonde type (Valid Types: RS41, RS92, DFM, M10, M20, IMET, IMET54, LMS6, MK2LMS, MEISEI)",
help="Immediately start a decoder for a provided sonde type (Valid Types: RS41, RS92, DFM, M10, M20, IMET, IMET5, LMS6, MK2LMS, MEISEI)",
)
parser.add_argument(
"-t",

Wyświetl plik

@ -383,7 +383,7 @@ def read_auto_rx_config(filename, no_sdr_test=False):
"M10": True,
"M20": True,
"IMET": False,
"IMET54": False,
"IMET5": False,
"LMS6": True,
"MK2LMS": False,
"MEISEI": False,

Wyświetl plik

@ -28,7 +28,7 @@ VALID_SONDE_TYPES = [
"M10",
"M20",
"IMET",
"IMET54",
"IMET5",
"MK2LMS",
"LMS6",
"MEISEI",
@ -97,7 +97,7 @@ class SondeDecoder(object):
"M10",
"M20",
"IMET",
"IMET54",
"IMET5",
"MK2LMS",
"LMS6",
"MEISEI",
@ -454,7 +454,7 @@ class SondeDecoder(object):
# iMet-4 (IMET1RS) decoder
decode_cmd += "./imet1rs_dft --json 2>/dev/null"
elif self.sonde_type == "IMET54":
elif self.sonde_type == "IMET5":
# iMet-4 Sondes
decode_cmd = "%s %s-p %d -d %s %s-M raw -F9 -s 48k -f %d 2>/dev/null |" % (
@ -1129,6 +1129,12 @@ class SondeDecoder(object):
_telemetry["id"] = self.imet_id
_telemetry["station_code"] = self.imet_location
# iMet-54 Specific Actions
if self.sonde_type == "IMET5":
# Fix up the time.
_telemetry["datetime_dt"] = fix_datetime(_telemetry["datetime"])
# LMS Specific Actions (LMS6, MK2LMS)
if "LMS" in self.sonde_type:
# We are only provided with HH:MM:SS, so the timestamp needs to be fixed, just like with the iMet sondes

Wyświetl plik

@ -299,8 +299,10 @@ static int print_position(gpx_t *gpx, int ecc, int ecc_gps) {
}
if (gpx->option.jsn && ecc >= 0) { // ecc_gps >= 0 not reliable?
unsigned long count_day = (unsigned long)(gpx->std*3600 + gpx->min*60 + gpx->sek+0.5); // (gpx->timems/1e3+0.5) has gaps
fprintf(stdout, "{ \"type\": \"%s\"", "IMET5");
fprintf(stdout, ", \"id\": \"%u\", \"datetime\": \"%02d:%02d:%06.3fZ\", \"lat\": %.5f, \"lon\": %.5f, \"alt\": %.5f",
fprintf(stdout, ", \"frame\": %lu", count_day);
fprintf(stdout, ", \"id\": \"IMET54-%u\", \"datetime\": \"%02d:%02d:%06.3fZ\", \"lat\": %.5f, \"lon\": %.5f, \"alt\": %.5f",
gpx->SNu32, gpx->std, gpx->min, gpx->sek, gpx->lat, gpx->lon, gpx->alt);
//fprintf(stdout, ", \"subtype\": \"%s\"", "IMET54");
if (gpx->jsn_freq > 0) {
@ -401,6 +403,8 @@ int main(int argc, char *argv[]) {
int rawhex = 0;
int cfreq = -1;
float baudrate = -1;
FILE *fp;
char *fpname = NULL;
@ -486,6 +490,14 @@ int main(int argc, char *argv[]) {
}
else return -1;
}
else if ( (strcmp(*argv, "--br") == 0) ) {
++argv;
if (*argv) {
baudrate = atof(*argv);
if (baudrate < 4600 || baudrate > 5000) baudrate = BAUD_RATE; // default: 4798
}
else return -1;
}
else if (strcmp(*argv, "--iq0") == 0) { option_iq = 1; } // differential/FM-demod
else if (strcmp(*argv, "--iq2") == 0) { option_iq = 2; }
else if (strcmp(*argv, "--iq3") == 0) { option_iq = 3; } // iq2==iq3
@ -619,10 +631,15 @@ int main(int argc, char *argv[]) {
dsp.opt_dc = option_dc;
dsp.opt_IFmin = option_min;
if ( dsp.sps < 8 ) {
if ( dsp.sps < 5 ) {
fprintf(stderr, "note: sample rate low (%.1f sps)\n", dsp.sps);
}
if (baudrate > 0) {
dsp.br = (float)baudrate;
dsp.sps = (float)dsp.sr/dsp.br;
fprintf(stderr, "sps corr: %.4f\n", dsp.sps);
}
k = init_buffers(&dsp); // BT=0.5 (IQ-Int: BT > 0.5 ?)
if ( k < 0 ) {