From 37cf90f55958613f1b540c1c73174f62f792ffd9 Mon Sep 17 00:00:00 2001 From: lkoester Date: Tue, 14 Feb 2023 17:01:44 +0100 Subject: [PATCH] added missing changes from pyclient --- .idea/runConfigurations/Cross_Remote_Debug.xml | 2 +- pyclient/main copy.py | 10 +++++++--- pyclient/tmtc_conf.json | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.idea/runConfigurations/Cross_Remote_Debug.xml b/.idea/runConfigurations/Cross_Remote_Debug.xml index f04441e..01248fc 100644 --- a/.idea/runConfigurations/Cross_Remote_Debug.xml +++ b/.idea/runConfigurations/Cross_Remote_Debug.xml @@ -1,6 +1,6 @@ - + diff --git a/pyclient/main copy.py b/pyclient/main copy.py index 99655ee..947f63f 100644 --- a/pyclient/main copy.py +++ b/pyclient/main copy.py @@ -7,6 +7,8 @@ import sys import time from typing import Optional import datetime +import json +import pprint import tmtccmd from spacepackets.ecss import PusTelemetry, PusTelecommand, PusVerificator @@ -169,13 +171,15 @@ class PusHandler(SpecificApidHandlerBase): self.verif_wrapper.log_to_file(tm_packet, res) dedicated_handler = True if service == 3: - _LOGGER.info("No handling for HK packets implemented") - _LOGGER.info(f"Raw packet: 0x[{packet.hex(sep=',')}]") + # _LOGGER.info("No handling for HK packets implemented") + # _LOGGER.info(f"Raw packet: 0x[{packet.hex(sep=',')}]") pus_tm = PusTelemetry.unpack(packet, time_reader=CdsShortTimestamp.empty()) if pus_tm.subservice == 25: if len(pus_tm.source_data) < 8: raise ValueError("No addressable ID in HK packet") - json_str = pus_tm.source_data[8:] + json_str = str(pus_tm.source_data[8:].decode('utf8')) + json_object = json.loads(json_str) + pprint.pprint(json_object) dedicated_handler = True if service == 5: tm_packet = Service5Tm.unpack(packet, time_reader=CdsShortTimestamp.empty()) diff --git a/pyclient/tmtc_conf.json b/pyclient/tmtc_conf.json index 1a79d49..7ca13c1 100644 --- a/pyclient/tmtc_conf.json +++ b/pyclient/tmtc_conf.json @@ -1,6 +1,6 @@ { "com_if": "udp", - "tcpip_udp_ip_addr": "169.254.7.6", + "tcpip_udp_ip_addr": "192.168.1.116", "tcpip_udp_port": 7301, "tcpip_udp_recv_max_size": 1500 } \ No newline at end of file