Send all custom fields via UDP broadcast, add baud rate and modulation details to sondehub uploader

pull/109/head v0.3.9
Mark Jessop 2022-09-17 19:21:21 +09:30
rodzic a377c0a2c2
commit 84ad11e310
5 zmienionych plików z 24 dodań i 4 usunięć

Wyświetl plik

@ -1 +1 @@
__version__ = "0.3.7"
__version__ = "0.3.9"

Wyświetl plik

@ -53,6 +53,11 @@ def send_payload_summary(telemetry, port=55672, comment="HorusDemodLib"):
if 'speed' in telemetry:
packet['speed'] = telemetry['speed']
# Add in any field names from the custom field section
if "custom_field_names" in telemetry:
for _custom_field_name in telemetry["custom_field_names"]:
if _custom_field_name in telemetry:
packet[_custom_field_name] = telemetry[_custom_field_name]
# Set up our UDP socket
_s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)

Wyświetl plik

@ -213,6 +213,12 @@ class SondehubAmateurUploader(object):
if "modulation" in telemetry:
_output["modulation"] = telemetry["modulation"]
if "modulation_detail" in telemetry:
_output["modulation_detail"] = telemetry["modulation_detail"]
if "baud_rate" in telemetry:
_output["baud_rate"] = telemetry["baud_rate"]
# Add in any field names from the custom field section
if "custom_field_names" in telemetry:
for _custom_field_name in telemetry["custom_field_names"]:

Wyświetl plik

@ -72,6 +72,7 @@ def main():
# parser.add_argument("--summary", type=int, default=-1, help="Override user.cfg UDP Summary output port. (NOT IMPLEMENTED)")
parser.add_argument("--freq_hz", type=float, default=None, help="Receiver IQ centre frequency in Hz, used in determine the absolute frequency of a telemetry burst.")
parser.add_argument("--freq_target_hz", type=float, default=None, help="Receiver 'target' frequency in Hz, used to add metadata to station position info.")
parser.add_argument("--baud_rate", type=int, default=None, help="Modulation baud rate (Hz), used to add additional metadata info.")
parser.add_argument("-v", "--verbose", action="store_true", default=False, help="Verbose output (set logging level to DEBUG)")
args = parser.parse_args()
@ -184,6 +185,10 @@ def main():
_decoded['f_centre'] = int(demod_stats.fest_mean) + int(args.freq_hz)
habitat_uploader.last_freq_hz = _decoded['f_centre']
# Add in baud rate, if provided.
if args.baud_rate:
_decoded['baud_rate'] = int(args.baud_rate)
# Send via UDP
send_payload_summary(_decoded, port=user_config['summary_port'])
@ -229,11 +234,15 @@ def main():
_decoded['f_centre'] = int(demod_stats.fest_mean) + int(args.freq_hz)
habitat_uploader.last_freq_hz = _decoded['f_centre']
# Add in baud rate, if provided.
if args.baud_rate:
_decoded['baud_rate'] = int(args.baud_rate)
# Send via UDP
send_payload_summary(_decoded, port=user_config['summary_port'])
# Upload to Habitat
habitat_uploader.add(_decoded['ukhas_str']+'\n')
# Do not upload Horus Binary packets to the Habitat endpoint.
# habitat_uploader.add(_decoded['ukhas_str']+'\n')
# Upload the string to Sondehub Amateur
sondehub_uploader.add(_decoded)

Wyświetl plik

@ -1,6 +1,6 @@
[tool.poetry]
name = "horusdemodlib"
version = "0.3.7"
version = "0.3.9"
description = "Project Horus HAB Telemetry Demodulators"
authors = ["Mark Jessop"]
license = "LGPL-2.1-or-later"