Compare commits

..

1 Commits

Author SHA1 Message Date
4fe2161622 add command to reset the scheduler
All checks were successful
EIVE/-/pipeline/head This commit looks good
2024-05-14 15:08:30 +02:00
7 changed files with 19 additions and 25 deletions

View File

@@ -10,14 +10,6 @@ list yields a list of all related PRs for each release.
# [unreleased] # [unreleased]
# [v7.1.0] 2025-01-17
- Bumped `tmtccmd` to v8.1.0
## Fixed
- Use new mode TM API.
# [v7.0.0] 2024-05-06 # [v7.0.0] 2024-05-06
- Reworked PLOC MPSoC commanding to be inline with OBSW update. - Reworked PLOC MPSoC commanding to be inline with OBSW update.

View File

@@ -17,7 +17,6 @@ TM_DB_PATH = "tm.db"
# TODO: The cleanest way would be to load those from the config file.. # TODO: The cleanest way would be to load those from the config file..
PRINT_RAW_HK_B64_STR = False PRINT_RAW_HK_B64_STR = False
PRINT_RAW_ACTION_DATA_REPLY_B64_STR = True
PRINT_RAW_EVENTS_B64_STR = False PRINT_RAW_EVENTS_B64_STR = False
PUS_APID = 0x65 PUS_APID = 0x65

View File

@@ -52,7 +52,7 @@ from eive_tmtc.tmtc.wdt import create_wdt_node
class EiveHookObject(HookBase): class EiveHookObject(HookBase):
def __init__(self, json_cfg_path: str): def __init__(self, json_cfg_path: str):
super().__init__(json_cfg_path) super().__init__(json_cfg_path=json_cfg_path)
def get_command_definitions(self) -> CmdTreeNode: def get_command_definitions(self) -> CmdTreeNode:
root_node = CmdTreeNode.root_node() root_node = CmdTreeNode.root_node()

View File

@@ -1,10 +1,8 @@
import base64
import logging import logging
import struct import struct
from spacepackets.ecss import PusTm from spacepackets.ecss import PusTm
from tmtccmd.pus.s8_fsfw_action_defs import CustomSubservice from tmtccmd.pus.s8_fsfw_action_defs import CustomSubservice
from eive_tmtc.config.definitions import PRINT_RAW_ACTION_DATA_REPLY_B64_STR
from eive_tmtc.config.object_ids import ( from eive_tmtc.config.object_ids import (
ACU_HANDLER_ID, ACU_HANDLER_ID,
PDU_1_HANDLER_ID, PDU_1_HANDLER_ID,
@@ -53,8 +51,6 @@ def handle_action_service_tm(
if object_id is None: if object_id is None:
object_id = ObjectIdU32(object_id_raw, "Unknown ID") object_id = ObjectIdU32(object_id_raw, "Unknown ID")
if tm_packet.subservice == CustomSubservice.TM_DATA_REPLY: if tm_packet.subservice == CustomSubservice.TM_DATA_REPLY:
if PRINT_RAW_ACTION_DATA_REPLY_B64_STR:
print(f"PUS TM Base64: {base64.b64encode(raw_tm)}")
if object_id.as_bytes == IMTQ_HANDLER_ID: if object_id.as_bytes == IMTQ_HANDLER_ID:
return handle_imtq_replies(action_id, pw, custom_data) return handle_imtq_replies(action_id, pw, custom_data)
elif object_id.as_bytes == PLOC_MPSOC_ID: elif object_id.as_bytes == PLOC_MPSOC_ID:

View File

@@ -15,7 +15,7 @@ from tmtccmd.logging.pus import RawTmtcTimedLogWrapper
from tmtccmd.pus import VerificationWrapper from tmtccmd.pus import VerificationWrapper
from tmtccmd.pus.s20_fsfw_param import Service20FsfwTm, Service20ParamDumpWrapper from tmtccmd.pus.s20_fsfw_param import Service20FsfwTm, Service20ParamDumpWrapper
from tmtccmd.pus.s20_fsfw_param_defs import CustomSubservice as ParamSubservice from tmtccmd.pus.s20_fsfw_param_defs import CustomSubservice as ParamSubservice
from tmtccmd.pus.s200_fsfw_mode import Service200FsfwReader, Service200FsfwTm from tmtccmd.pus.s200_fsfw_mode import Service200FsfwTm
from tmtccmd.pus.s200_fsfw_mode import Subservice as ModeSubservice from tmtccmd.pus.s200_fsfw_mode import Subservice as ModeSubservice
from tmtccmd.tmtc import GenericApidHandlerBase, SpecificApidHandlerBase from tmtccmd.tmtc import GenericApidHandlerBase, SpecificApidHandlerBase
from eive_tmtc.config.definitions import TM_DB_PATH, PUS_APID from eive_tmtc.config.definitions import TM_DB_PATH, PUS_APID
@@ -109,7 +109,7 @@ class PusHandler(SpecificApidHandlerBase):
elif service == 20: elif service == 20:
self._handle_param_packet(packet, tm_packet) self._handle_param_packet(packet, tm_packet)
elif service == 200: elif service == 200:
dedicated_handler = self._handle_mode_packet(tm_packet) dedicated_handler = self._handle_mode_packet(packet, tm_packet)
else: else:
_LOGGER.info( _LOGGER.info(
f"The service {service} is not implemented in Telemetry Factory" f"The service {service} is not implemented in Telemetry Factory"
@@ -193,21 +193,21 @@ class PusHandler(SpecificApidHandlerBase):
f"unknown subservice {tm_packet.subservice} for parameter service" f"unknown subservice {tm_packet.subservice} for parameter service"
) )
def _handle_mode_packet(self, pus_tm: PusTelemetry) -> bool: def _handle_mode_packet(self, raw_data: bytes, _: PusTelemetry) -> bool:
tm_packet = Service200FsfwReader(pus_tm) tm_packet = Service200FsfwTm.unpack(
if tm_packet.tm.subservice == ModeSubservice.TM_CANT_REACH_MODE: raw_telemetry=raw_data, time_reader=CdsShortTimestamp.empty()
)
if tm_packet.subservice == ModeSubservice.TM_CANT_REACH_MODE:
obj_id = tm_packet.object_id obj_id = tm_packet.object_id
obj_id_obj = self.obj_id_dict.get(obj_id) obj_id_obj = self.obj_id_dict.get(obj_id)
retval = tm_packet.return_value retval = tm_packet.return_value
assert retval is not None
string_list = generic_retval_printout(retval) string_list = generic_retval_printout(retval)
self.pw.dlog(f"Received Mode Reply from {obj_id_obj}: Can't reach mode.") self.pw.dlog(f"Received Mode Reply from {obj_id_obj}: Can't reach mode.")
for string in string_list: for string in string_list:
self.pw.dlog(f"Reason: {string}") self.pw.dlog(f"Reason: {string}")
return True return True
if tm_packet.tm.subservice == ModeSubservice.TM_WRONG_MODE_REPLY: if tm_packet.subservice == ModeSubservice.TM_WRONG_MODE_REPLY:
self.pw.dlog(f"Received Mode TM wrong mode reply, mode: {tm_packet.mode}") self.pw.dlog(f"Received Mode TM wrong mode reply, mode: {tm_packet.mode}")
return True
return False return False

View File

@@ -19,6 +19,7 @@ from tmtccmd.fsfw.tmtc_printer import get_validity_buffer_str
from tmtccmd.pus.s11_tc_sched import ( from tmtccmd.pus.s11_tc_sched import (
create_enable_tc_sched_cmd, create_enable_tc_sched_cmd,
create_disable_tc_sched_cmd, create_disable_tc_sched_cmd,
create_reset_tc_sched_cmd,
) )
from eive_tmtc.config.object_ids import CORE_CONTROLLER_ID from eive_tmtc.config.object_ids import CORE_CONTROLLER_ID
@@ -70,6 +71,7 @@ class ActionId(enum.IntEnum):
MKDIR_HELPER = 55 MKDIR_HELPER = 55
ENABLE_SCHEDULER = 56 ENABLE_SCHEDULER = 56
UPDATE_LEAP_SECONRS = 60 UPDATE_LEAP_SECONRS = 60
RESET_SCHEDULER = 61
class ParamId(enum.IntEnum): class ParamId(enum.IntEnum):
@@ -122,6 +124,7 @@ class OpCode:
ENABLE_SCHEDULER = "enable_scheduler" ENABLE_SCHEDULER = "enable_scheduler"
DISABLE_SCHEDULER = "disable_scheduler" DISABLE_SCHEDULER = "disable_scheduler"
UPDATE_LEAP_SECONDS = "leap_seconds_update" UPDATE_LEAP_SECONDS = "leap_seconds_update"
RESET_SCHEDULER = "reset_scheduler"
class Info: class Info:
@@ -166,6 +169,7 @@ class Info:
ENABLE_SCHEDULER = "Enable scheduler" ENABLE_SCHEDULER = "Enable scheduler"
DISABLE_SCHEDULER = "Disable scheduler" DISABLE_SCHEDULER = "Disable scheduler"
UPDATE_LEAP_SECONDS = "Updates the Leap Seconds" UPDATE_LEAP_SECONDS = "Updates the Leap Seconds"
RESET_SCHEDULER = "Reset scheduler"
class Chip(enum.IntEnum): class Chip(enum.IntEnum):
@@ -475,6 +479,9 @@ def pack_core_commands( # noqa C901
elif cmd_str == OpCode.DISABLE_SCHEDULER: elif cmd_str == OpCode.DISABLE_SCHEDULER:
q.add_log_cmd(Info.DISABLE_SCHEDULER) q.add_log_cmd(Info.DISABLE_SCHEDULER)
q.add_pus_tc(create_disable_tc_sched_cmd()) q.add_pus_tc(create_disable_tc_sched_cmd())
elif cmd_str == OpCode.RESET_SCHEDULER:
q.add_log_cmd(Info.RESET_SCHEDULER)
q.add_pus_tc(create_reset_tc_sched_cmd())
elif cmd_str == OpCode.UPDATE_LEAP_SECONDS: elif cmd_str == OpCode.UPDATE_LEAP_SECONDS:
q.add_log_cmd(Info.UPDATE_LEAP_SECONDS) q.add_log_cmd(Info.UPDATE_LEAP_SECONDS)
leap_seconds = int(input("Specify new Leap Seconds Value: ")).to_bytes( leap_seconds = int(input("Specify new Leap Seconds Value: ")).to_bytes(

View File

@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
name = "eive-tmtc" name = "eive-tmtc"
description = "TMTC Commander EIVE" description = "TMTC Commander EIVE"
readme = "README.md" readme = "README.md"
version = "7.2.0" version = "7.1.0"
requires-python = ">=3.10" requires-python = ">=3.10"
license = {text = "Apache-2.0"} license = {text = "Apache-2.0"}
authors = [ authors = [
@@ -29,9 +29,9 @@ classifiers = [
"Topic :: Scientific/Engineering" "Topic :: Scientific/Engineering"
] ]
dependencies = [ dependencies = [
"tmtccmd ~= 8.1", "tmtccmd ~= 8.0.1",
# "tmtccmd @ git+https://github.com/robamu-org/tmtccmd@main", # "tmtccmd @ git+https://github.com/robamu-org/tmtccmd@main",
"cfdp-py>=0.4, <=0.5", "cfdp-py~=0.1.0",
"python-dateutil ~= 2.8", "python-dateutil ~= 2.8",
] ]