Add SondeMonitor version check - closes #87

This commit is contained in:
xss 2022-11-16 13:47:47 +11:00
parent ef53e123a0
commit 36a7e961e3
2 changed files with 17 additions and 5 deletions

View File

@ -290,11 +290,23 @@ def telemetry_filter(telemetry):
if telemetry["software_name"] == "radiosonde_auto_rx":
if parse_autorx_version(telemetry["software_version"]) < (1,5,9):
return (False,f"Autorx version is out of date and doesn't handle iMet-1 and iMet-4 radiosondes correctly. Please update to 1.5.9 or later")
if "DFM" in telemetry["type"]:
if telemetry["software_name"] == "SondeMonitor":
if parse_sondemonitor_version(telemetry["software_version"]) < (6,2,7,9):
return (False,f"SondeMonitor version is out of date and doesn't handle DFM radiosondes correctly. Please update to 6.2.7.9 or later")
if "dev" in telemetry:
return (False, "All checks passed however payload contained dev flag so will not be uploaded to the database")
return (True, "")
def parse_sondemonitor_version(version):
try:
m = re.search(r'(\d+)\.(\d+)\.(\d+)(?:\.(\d+))?', version)
return tuple([int(x if x != None else 0) for x in m.groups()])
except:
return (0,0,0,0)
def parse_autorx_version(version):
try:
m = re.search(r'(\d+)\.(\d+)(?:\.(\d+))?', version)

View File

@ -5,21 +5,21 @@ import gzip
import uuid
body = [
{
"software_name": "radiosonde_auto_rx",
"software_version": "1.5.9",
"software_name": "SondeMonitor",
"software_version": "6.2.7.9",
"uploader_callsign": "DL1XH",
"uploader_position": ["53.762","10.471",0],
"uploader_antenna": "5/8 GP",
"time_received": "2022-11-16T23:55:44.195615Z",
"datetime": "2022-11-16T23:56:00.000000Z",
"manufacturer": "Vaisala",
"type": "potato",
"type": "DFM",
"serial": "T1240994",
"subtype": "iMet-4",
"subtype": "RS41-SGP",
"frame": 5777,
"lat": 54.6185,
"lon": 11.23383,
"alt": 23214.77006,
"alt": 1.77006,
"temp": -71.0,
"humidity": 3.3,
"pressure": 29.57,