kopia lustrzana https://github.com/projecthorus/radiosonde_auto_rx
Add APRS callsign generation support for M20 sondes, matching dxlAPRS's weird-ass formatting.
rodzic
5f350410ab
commit
217909fe02
|
|
@ -13,6 +13,7 @@ import traceback
|
|||
import socket
|
||||
from threading import Thread, Lock
|
||||
from . import __version__ as auto_rx_version
|
||||
from .utils import strip_sonde_serial
|
||||
|
||||
try:
|
||||
# Python 2
|
||||
|
|
@ -74,7 +75,7 @@ def telemetry_to_aprs_position(
|
|||
# Generate the comment field.
|
||||
_aprs_comment = aprs_comment
|
||||
_aprs_comment = _aprs_comment.replace("<freq>", _freq)
|
||||
_aprs_comment = _aprs_comment.replace("<id>", sonde_data["id"])
|
||||
_aprs_comment = _aprs_comment.replace("<id>", strip_sonde_serial(sonde_data["id"]))
|
||||
_aprs_comment = _aprs_comment.replace("<temp>", "%.1fC" % sonde_data["temp"])
|
||||
_aprs_comment = _aprs_comment.replace(
|
||||
"<pressure>", "%.1fhPa" % sonde_data["pressure"]
|
||||
|
|
|
|||
|
|
@ -535,6 +535,7 @@ class SondeDecoder(object):
|
|||
# - Have dropped the low-leakage FIR filter (-F9) to save a bit of CPU
|
||||
# Have scaled back sample rate to 220 kHz to again save CPU.
|
||||
# mk2mod runs at ~90% CPU on a RPi 3, with rtl_fm using ~50% of another core.
|
||||
# Update 2021-07-24: Updated version with speedups now taking 240 kHz BW and only using 50% of a core.
|
||||
|
||||
decode_cmd = "%s %s-p %d -d %s %s-M raw -s 240k -f %d 2>/dev/null |" % (
|
||||
self.sdr_fm,
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
#
|
||||
|
||||
from __future__ import division, print_function
|
||||
import codecs
|
||||
import fcntl
|
||||
import logging
|
||||
import os
|
||||
|
|
@ -255,6 +256,15 @@ def generate_aprs_id(sonde_data):
|
|||
# Use the generated id same as dxlAPRS
|
||||
_object_name = sonde_data["aprsid"]
|
||||
|
||||
elif "M20" in sonde_data["type"]:
|
||||
# Generate the M20 ID based on the first two hex digits of the
|
||||
# raw hexadecimal id, followed by the last decimal section.
|
||||
# Why we do this and not just use the three hex bytes, nobody knows...
|
||||
if 'rawid' in sonde_data:
|
||||
_object_name = "ME" + sonde_data['rawid'].split('_')[1][:2] + sonde_data["id"].split("-")[-1]
|
||||
else:
|
||||
_object_name = None
|
||||
|
||||
elif "IMET" in sonde_data["type"]:
|
||||
# Use the last 5 characters of the unique ID we have generated.
|
||||
_object_name = "IMET" + sonde_data["id"][-5:]
|
||||
|
|
|
|||
|
|
@ -249,7 +249,7 @@ aprs_position_report = False
|
|||
# <batt> - Battery Voltage (e.g. 3.1V)
|
||||
# The default comment (below) is compatible with radiosondy.info's parsers, and should only be modified
|
||||
# if absolutely necessary.
|
||||
aprs_custom_comment = Clb=<vel_v> t=<temp> h=<humidity> p=<pressure> <freq> Type=<type> Radiosonde
|
||||
aprs_custom_comment = Clb=<vel_v> t=<temp> h=<humidity> p=<pressure> <freq> Type=<type> ser=<id> Radiosonde
|
||||
|
||||
|
||||
###########################
|
||||
|
|
|
|||
Ładowanie…
Reference in New Issue