Skip to content

Commit a1c9d46

Browse files
authored
Merge pull request #596 from projecthorus/testing
v1.5.8 release - M20 PTU Support, iMet-4 fixes
2 parents dcfc876 + 7be4928 commit a1c9d46

File tree

10 files changed

+565
-196
lines changed

10 files changed

+565
-196
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ Vaisala | RS92-SGP/NGP | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_
2020
Vaisala | RS41-SG/SGP/SGM | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: (for -SGP)
2121
Graw | DFM06/09/17 | :heavy_check_mark: | :heavy_check_mark: | :x: | :x:
2222
Meteomodem | M10 | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | Not Sent
23-
Meteomodem | M20 | :heavy_check_mark: | :x: | :x: | Not Sent
23+
Meteomodem | M20 | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: (For some models)
2424
Intermet Systems | iMet-4 | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | Not Sent
2525
Intermet Systems | iMet-54 | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | Not Sent
2626
Lockheed Martin | LMS6-400/1680 | :heavy_check_mark: | :x: | :x: | :x:
2727
Meisei | iMS-100 | :heavy_check_mark: | :x: | :x: | :x:
28-
Meteo-Radiy | MRZ (400 MHz) | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :x:
28+
Meteo-Radiy | MRZ-H1 (400 MHz) | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :x:
2929

3030
Support for other radiosondes may be added as required - please send us sondes to test with! If you have any information about telemetry formats, we'd love to hear from you (see our contact details below).
3131

auto_rx/autorx/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# MINOR - New sonde type support, other fairly big changes that may result in telemetry or config file incompatability issus.
1818
# PATCH - Small changes, or minor feature additions.
1919

20-
__version__ = "1.5.7"
20+
__version__ = "1.5.8"
2121

2222

2323
# Global Variables

auto_rx/autorx/decode.py

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,12 @@ def __init__(
203203
# which don't necessarily have a consistent packet count to time increment ratio.
204204
# This is a tradeoff between being able to handle multiple iMet sondes on a single frequency, and
205205
# not flooding the various databases with sonde IDs in the case of a bad sonde.
206-
self.imet_id = None
206+
207+
# iMet ID store v2
208+
# Now instead of just latching onto an ID, we allow up to 4 new IDs to be created per decoder.
209+
# This should hopefully handle a few iMets on the same frequency in a graceful manner.
210+
self.imet_max_ids = 4
211+
self.imet_id = []
207212

208213
# This will become our decoder thread.
209214
self.decoder = None
@@ -876,7 +881,7 @@ def generate_decoder_command_experimental(self):
876881
)
877882

878883
# M20 decoder
879-
decode_cmd = f"./mXXmod --json --ptu -vvv --softin -i {self.raw_file_option} 2>/dev/null"
884+
decode_cmd = f"./m20mod --json --ptu -vvv --softin -i {self.raw_file_option} 2>/dev/null"
880885

881886
# M20 sondes transmit in short, irregular pulses - average over the last 2 frames, and use a peak hold
882887
demod_stats = FSKDemodStats(averaging_time=2.0, peak_hold=True)
@@ -1315,16 +1320,30 @@ def handle_decoder_line(self, data):
13151320

13161321
# Fix up the time.
13171322
_telemetry["datetime_dt"] = fix_datetime(_telemetry["datetime"])
1318-
# Generate a unique ID based on the power-on time and frequency, as iMet sondes don't send one.
1319-
# Latch this ID and re-use it for the entire decode run.
1320-
if self.imet_id == None:
1321-
self.imet_id = imet_unique_id(_telemetry)
1323+
1324+
# Generate a unique ID based on the power-on time and frequency, as iMet sonde telemetry is painful
1325+
# and doesn't send any ID.
1326+
_new_imet_id = imet_unique_id(_telemetry)
1327+
1328+
# If we have seen this ID before, keep using it.
1329+
if _new_imet_id in self.imet_id:
1330+
_telemetry["id"] = _new_imet_id
1331+
else:
1332+
# We have seen less than 4 different IDs while this decoder has been runing.
1333+
# Accept that this may be a new iMet sonde, and add the ID to the iMet ID list.
1334+
if len(self.imet_id) < self.imet_max_ids:
1335+
self.imet_id.append(_new_imet_id)
1336+
_telemetry["id"] = _new_imet_id
1337+
else:
1338+
# We have seen see many IDs this decode run, suspect this is likely an old iMet-1
1339+
# Which doesn't have a useful frame counter.
1340+
self.log_error("Exceeded maximum number of iMet sonde IDs for a decoder (4) - discarding this frame.")
1341+
return False
13221342

13231343
# Re-generate the datetime string.
13241344
_telemetry["datetime"] = _telemetry["datetime_dt"].strftime(
13251345
"%Y-%m-%dT%H:%M:%SZ"
13261346
)
1327-
_telemetry["id"] = self.imet_id
13281347

13291348
# iMet-5x Specific Actions
13301349
if self.sonde_type == "IMET5":

auto_rx/autorx/utils.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
"meisei100mod",
4747
"imet54mod",
4848
"mp3h1mod",
49+
"m20mod",
4950
]
5051

5152

@@ -70,8 +71,8 @@ def get_autorx_version(version_url=AUTORX_MAIN_VERSION_URL):
7071
try:
7172
_r = requests.get(version_url, timeout=5)
7273
except Exception as e:
73-
logging.exception(
74-
f"Version - Error determining version from URL {version_url}", e
74+
logging.error(
75+
f"Version - Error determining version from URL {version_url}: {str(e)}"
7576
)
7677
return None
7778

@@ -83,8 +84,8 @@ def get_autorx_version(version_url=AUTORX_MAIN_VERSION_URL):
8384
return _main_version
8485

8586
except Exception as e:
86-
logging.exception(
87-
f"Version - Error extracting version from url {version_url}.", e
87+
logging.error(
88+
f"Version - Error extracting version from url {version_url}: {str(e)}."
8889
)
8990
return None
9091

auto_rx/build.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ echo "Building for radiosonde_auto_rx version: $AUTO_RX_VERSION"
1414

1515
VERS_FLAG="-DVER_JSN_STR=$AUTO_RX_VERSION"
1616

17+
1718
# Build rs_detect.
1819
echo "Building dft_detect"
1920
cd ../scan/
@@ -38,7 +39,7 @@ gcc meisei100mod.c demod_mod.o bch_ecc_mod.o -lm -O3 -o meisei100mod -w $VERS_FL
3839
echo "Building M10 demod."
3940
gcc m10mod.c demod_mod.o -lm -O3 -o m10mod -w $VERS_FLAG
4041
echo "Building M20 demod."
41-
gcc mXXmod.c demod_mod.o -lm -O3 -o mXXmod -w $VERS_FLAG
42+
gcc m20mod.c demod_mod.o -lm -O3 -o m20mod -w $VERS_FLAG
4243
echo "Building iMet-54 demod."
4344
gcc imet54mod.c demod_mod.o -lm -O3 -o imet54mod -w $VERS_FLAG
4445
echo "Building MRZ demod."
@@ -74,7 +75,7 @@ cp ../mk2a/mk2mod .
7475
cp ../demod/mod/rs41mod .
7576
cp ../demod/mod/dfm09mod .
7677
cp ../demod/mod/m10mod .
77-
cp ../demod/mod/mXXmod .
78+
cp ../demod/mod/m20mod .
7879
cp ../demod/mod/rs92mod .
7980
cp ../demod/mod/lms6Xmod .
8081
cp ../demod/mod/meisei100mod .

auto_rx/clean.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ rm lms6mod
2424
rm lms6Xmod
2525
rm meisei100mod
2626
rm m10mod
27+
rm m20mod
2728
rm mXXmod
29+
rm mp3h1mod
30+
rm imet54mod
2831

2932
# LMS6-1680 Decoder
3033
echo "Cleaning LMS6-1680 Demodulator."
@@ -56,8 +59,11 @@ rm rs92mod
5659
rm dfm09mod
5760
rm m10mod
5861
rm mXXmod
62+
rm m20mod
5963
rm lms6Xmod
6064
rm meisei100mod
65+
rm mp3h1mod
66+
rm imet54mod
6167

6268

6369
echo "Done!"

demod/mod/Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ AUTO_RX_VERSION := $(shell PYTHONPATH=../../auto_rx python -m autorx.version)
88
CFLAGS = -O3 -Wall -Wno-unused-variable -DVER_JSN_STR=\"$(AUTO_RX_VERSION)\"
99
LDLIBS = -lm
1010

11-
PROGRAMS := rs41mod dfm09mod rs92mod lms6mod lms6Xmod meisei100mod m10mod mXXmod imet54mod
11+
PROGRAMS := rs41mod dfm09mod rs92mod lms6mod lms6Xmod meisei100mod m10mod m20mod imet54mod
1212

1313
all: $(PROGRAMS)
1414

@@ -26,9 +26,11 @@ meisei100mod: meisei100mod.o demod_mod.o bch_ecc_mod.o
2626

2727
m10mod: m10mod.o demod_mod.o
2828

29-
mXXmod: mXXmod.o demod_mod.o
29+
m20mod: m20mod.o demod_mod.o
3030

3131
imet54mod: imet54mod.o demod_mod.o
3232

33+
mp3h1mod: mp3h1mod.o demod_mod.o
34+
3335
clean:
3436
$(RM) $(PROGRAMS) $(PROGRAMS:=.o) demod_mod.o bch_ecc_mod.o

0 commit comments

Comments
 (0)