Compare commits

..

31 Commits

Author SHA1 Message Date
941660a0b5 include replacement
Some checks failed
EIVE/-/pipeline/head There was a failure building this commit
2024-04-23 14:12:41 +02:00
ca3c988676 bump tmtccmd 2024-04-23 14:11:57 +02:00
3c0ac91227 Merge pull request 'CLock Events' (#291) from clock-events into main
All checks were successful
EIVE/-/pipeline/head This commit looks good
Reviewed-on: #291
Reviewed-by: Marius Eggert <eggertm@irs.uni-stuttgart.de>
2024-04-17 16:43:29 +02:00
f61c485979 Merge branch 'main' into clock-events
All checks were successful
EIVE/-/pipeline/pr-main This commit looks good
2024-04-17 16:20:09 +02:00
2ebbf750bd handling for new clock events 2024-04-17 16:19:58 +02:00
847fccbe66 Merge pull request 'test script' (#294) from bestest-script into main
All checks were successful
EIVE/-/pipeline/head This commit looks good
Reviewed-on: #294
Reviewed-by: Marius Eggert <eggertm@irs.uni-stuttgart.de>
2024-04-17 16:19:24 +02:00
c8292f4ee1 Merge branch 'main' into bestest-script
All checks were successful
EIVE/-/pipeline/pr-main This commit looks good
2024-04-17 15:05:45 +02:00
1cafdc817f clock events
All checks were successful
EIVE/-/pipeline/head This commit looks good
EIVE/-/pipeline/pr-main This commit looks good
2024-04-10 17:34:54 +02:00
5967dede97 add new events for clock handling
All checks were successful
EIVE/-/pipeline/head This commit looks good
2024-04-10 17:27:24 +02:00
a8d0143b1e Merge pull request 'Prep v6.2.0' (#290) from prep-v6.2.0 into main
All checks were successful
EIVE/-/pipeline/head This commit looks good
Reviewed-on: #290
2024-04-10 11:51:24 +02:00
a0ad5f8948 reran gens 2024-04-10 11:50:15 +02:00
20ecef5838 linter
Some checks are pending
EIVE/-/pipeline/head Build queued...
2024-04-10 11:48:04 +02:00
6d97841cbf bump version
Some checks are pending
EIVE/-/pipeline/head Build queued...
2024-04-10 11:47:05 +02:00
512f0e4530 changelog 2024-04-10 11:46:35 +02:00
e2f0221681 Merge pull request 'GNSS Fixes' (#289) from gnss-fixes into main
All checks were successful
EIVE/-/pipeline/head This commit looks good
Reviewed-on: #289
Reviewed-by: Robin Müller <muellerr@irs.uni-stuttgart.de>
2024-04-10 11:34:58 +02:00
e9eb45c088 Merge branch 'main' into gnss-fixes 2024-04-10 11:34:39 +02:00
ea72087d87 Merge pull request 'allow setting health for payload components' (#287) from set-health-cmd-payload into main
All checks were successful
EIVE/-/pipeline/head This commit looks good
Reviewed-on: #287
Reviewed-by: Marius Eggert <eggertm@irs.uni-stuttgart.de>
2024-04-10 11:34:30 +02:00
d48c029b85 Merge branch 'main' into gnss-fixes
Some checks are pending
EIVE/-/pipeline/pr-main Build queued...
2024-04-10 11:30:01 +02:00
b5f4f2ddab changelog
Some checks are pending
EIVE/-/pipeline/pr-main Build started...
2024-04-10 11:29:19 +02:00
64dd19bd12 Merge branch 'main' into set-health-cmd-payload
Some checks are pending
EIVE/-/pipeline/pr-main Build started...
2024-04-10 11:28:43 +02:00
102821fc71 Merge pull request 'Some PLOC commanding fixes' (#288) from ploc-tree-test into main
All checks were successful
EIVE/-/pipeline/head This commit looks good
Reviewed-on: #288
Reviewed-by: Marius Eggert <eggertm@irs.uni-stuttgart.de>
2024-04-09 14:41:10 +02:00
24f3abdd5a Merge branch 'main' into ploc-tree-test 2024-04-09 14:40:36 +02:00
a880db5655 changelog
All checks were successful
EIVE/-/pipeline/pr-main This commit looks good
2024-04-09 14:34:23 +02:00
4e0cbb1034 Merge branch 'main' into gnss-fixes 2024-04-09 14:33:33 +02:00
7dfdd40963 fixed PLOC mode commanding
Some checks are pending
EIVE/-/pipeline/pr-main Build queued...
2024-04-09 14:31:41 +02:00
6282686f2f lets just change the tmtc structure he said. everything will still work he said
All checks were successful
EIVE/-/pipeline/head This commit looks good
2024-04-09 13:29:01 +02:00
b160f079b1 small bugfix
All checks were successful
EIVE/-/pipeline/head This commit looks good
2024-04-09 13:19:25 +02:00
11d7ad0f8d start fixing PLOC tree
All checks were successful
EIVE/-/pipeline/head This commit looks good
2024-04-09 11:32:57 +02:00
5af69eb14e add supervisor
All checks were successful
EIVE/-/pipeline/pr-main This commit looks good
2024-04-08 13:40:37 +02:00
c72a04b262 allow setting health for payload components
All checks were successful
EIVE/-/pipeline/head This commit looks good
2024-04-08 11:36:25 +02:00
344f16099e test script
All checks were successful
EIVE/-/pipeline/head This commit looks good
2024-03-19 11:48:24 +01:00
13 changed files with 111 additions and 66 deletions

View File

@@ -12,12 +12,24 @@ list yields a list of all related PRs for each release.
## Added ## Added
- Added handling for new clock events.
# [v6.2.0] 2024-04-10
## Added
- Added version set for STR. - Added version set for STR.
- Command for relative timeshift. - Command for relative timeshift.
- Health commands for payload components.
## Fixed ## Fixed
- EPS power commands working again. - EPS power commands working again.
- GNSS commands working again.
## Changed
- Fixed PLOC commanding
# [v6.1.1] 2024-03-06 # [v6.1.1] 2024-03-06

View File

@@ -15,6 +15,10 @@ TM_DB_PATH = "tm.db"
# Separate DB or not? Not sure.. # Separate DB or not? Not sure..
# RAW_TM_PATH = "raw_tm.db" # RAW_TM_PATH = "raw_tm.db"
# TODO: The cleanest way would be to load those from the config file..
PRINT_RAW_HK_B64_STR = False
PRINT_RAW_EVENTS_B64_STR = False
PUS_APID = 0x65 PUS_APID = 0x65
CFDP_APID = 0x66 CFDP_APID = 0x66
PUS_PACKET_ID = PacketId(PacketType.TM, True, PUS_APID) PUS_PACKET_ID = PacketId(PacketType.TM, True, PUS_APID)

View File

@@ -79,6 +79,8 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path
8901;0x22c5;CLOCK_DUMP_LEGACY;INFO;Clock dump event. P1: timeval seconds P2: timeval milliseconds.;fsfw/src/fsfw/pus/Service9TimeManagement.h 8901;0x22c5;CLOCK_DUMP_LEGACY;INFO;Clock dump event. P1: timeval seconds P2: timeval milliseconds.;fsfw/src/fsfw/pus/Service9TimeManagement.h
8902;0x22c6;CLOCK_SET_FAILURE;LOW;Clock could not be set. P1: Returncode.;fsfw/src/fsfw/pus/Service9TimeManagement.h 8902;0x22c6;CLOCK_SET_FAILURE;LOW;Clock could not be set. P1: Returncode.;fsfw/src/fsfw/pus/Service9TimeManagement.h
8903;0x22c7;CLOCK_DUMP;INFO;Clock dump event. P1: timeval seconds P2: timeval microseconds.;fsfw/src/fsfw/pus/Service9TimeManagement.h 8903;0x22c7;CLOCK_DUMP;INFO;Clock dump event. P1: timeval seconds P2: timeval microseconds.;fsfw/src/fsfw/pus/Service9TimeManagement.h
8904;0x22c8;CLOCK_DUMP_BEFORE_SETTING_TIME;INFO;No description;fsfw/src/fsfw/pus/Service9TimeManagement.h
8905;0x22c9;CLOCK_DUMP_AFTER_SETTING_TIME;INFO;No description;fsfw/src/fsfw/pus/Service9TimeManagement.h
9100;0x238c;TC_DELETION_FAILED;MEDIUM;Deletion of a TC from the map failed. P1: First 32 bit of request ID, P2. Last 32 bit of Request ID;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h 9100;0x238c;TC_DELETION_FAILED;MEDIUM;Deletion of a TC from the map failed. P1: First 32 bit of request ID, P2. Last 32 bit of Request ID;fsfw/src/fsfw/pus/Service11TelecommandScheduling.h
9700;0x25e4;TEST;INFO;No description;fsfw/src/fsfw/pus/Service17Test.h 9700;0x25e4;TEST;INFO;No description;fsfw/src/fsfw/pus/Service17Test.h
10600;0x2968;CHANGE_OF_SETUP_PARAMETER;LOW;No description;fsfw/src/fsfw_hal/devicehandlers/MgmLIS3MDLHandler.h 10600;0x2968;CHANGE_OF_SETUP_PARAMETER;LOW;No description;fsfw/src/fsfw_hal/devicehandlers/MgmLIS3MDLHandler.h
@@ -234,8 +236,9 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path
12902;0x3266;POWER_STATE_MACHINE_TIMEOUT;MEDIUM;No description;mission/system/acs/SusAssembly.h 12902;0x3266;POWER_STATE_MACHINE_TIMEOUT;MEDIUM;No description;mission/system/acs/SusAssembly.h
12903;0x3267;SIDE_SWITCH_TRANSITION_NOT_ALLOWED;LOW;Not implemented, would increase already high complexity. Operator should instead command the assembly off first and then command the assembly on into the desired mode/submode combination;mission/system/acs/SusAssembly.h 12903;0x3267;SIDE_SWITCH_TRANSITION_NOT_ALLOWED;LOW;Not implemented, would increase already high complexity. Operator should instead command the assembly off first and then command the assembly on into the desired mode/submode combination;mission/system/acs/SusAssembly.h
13000;0x32c8;CHILDREN_LOST_MODE;MEDIUM;No description;mission/system/tcs/TcsBoardAssembly.h 13000;0x32c8;CHILDREN_LOST_MODE;MEDIUM;No description;mission/system/tcs/TcsBoardAssembly.h
13100;0x332c;GPS_FIX_CHANGE;INFO;Fix has changed. P1: Old fix. P2: New fix 0: Not seen, 1: No Fix, 2: 2D-Fix, 3: 3D-Fix;mission/acs/archive/GPSDefinitions.h 13100;0x332c;GPS_FIX_CHANGE;INFO;Fix has changed. P1: New fix. P2: Missed fix changes 0: Not seen, 1: No Fix, 2: 2D-Fix, 3: 3D-Fix;linux/acs/GPSDefinitions.h
13101;0x332d;CANT_GET_FIX;LOW;Could not get fix in maximum allowed time. P1: Maximum allowed time to get a fix after the GPS was switched on.;mission/acs/archive/GPSDefinitions.h 13101;0x332d;CANT_GET_FIX;MEDIUM;Could not get fix in maximum allowed time. Trying to reset both GNSS devices. P1: Maximum allowed time to get a fix after the GPS was switched on.;linux/acs/GPSDefinitions.h
13102;0x332e;RESET_FAIL;HIGH;Failed to reset an GNNS Device. P1: Board-Side.;linux/acs/GPSDefinitions.h
13200;0x3390;P60_BOOT_COUNT;INFO;P60 boot count is broadcasted once at SW startup. P1: Boot count;mission/power/P60DockHandler.h 13200;0x3390;P60_BOOT_COUNT;INFO;P60 boot count is broadcasted once at SW startup. P1: Boot count;mission/power/P60DockHandler.h
13201;0x3391;BATT_MODE;INFO;Battery mode is broadcasted at startup. P1: Mode;mission/power/P60DockHandler.h 13201;0x3391;BATT_MODE;INFO;Battery mode is broadcasted at startup. P1: Mode;mission/power/P60DockHandler.h
13202;0x3392;BATT_MODE_CHANGED;MEDIUM;Battery mode has changed. P1: Old mode. P2: New mode;mission/power/P60DockHandler.h 13202;0x3392;BATT_MODE_CHANGED;MEDIUM;Battery mode has changed. P1: Old mode. P2: New mode;mission/power/P60DockHandler.h
1 Event ID (dec) Event ID (hex) Name Severity Description File Path
79 8901 0x22c5 CLOCK_DUMP_LEGACY INFO Clock dump event. P1: timeval seconds P2: timeval milliseconds. fsfw/src/fsfw/pus/Service9TimeManagement.h
80 8902 0x22c6 CLOCK_SET_FAILURE LOW Clock could not be set. P1: Returncode. fsfw/src/fsfw/pus/Service9TimeManagement.h
81 8903 0x22c7 CLOCK_DUMP INFO Clock dump event. P1: timeval seconds P2: timeval microseconds. fsfw/src/fsfw/pus/Service9TimeManagement.h
82 8904 0x22c8 CLOCK_DUMP_BEFORE_SETTING_TIME INFO No description fsfw/src/fsfw/pus/Service9TimeManagement.h
83 8905 0x22c9 CLOCK_DUMP_AFTER_SETTING_TIME INFO No description fsfw/src/fsfw/pus/Service9TimeManagement.h
84 9100 0x238c TC_DELETION_FAILED MEDIUM Deletion of a TC from the map failed. P1: First 32 bit of request ID, P2. Last 32 bit of Request ID fsfw/src/fsfw/pus/Service11TelecommandScheduling.h
85 9700 0x25e4 TEST INFO No description fsfw/src/fsfw/pus/Service17Test.h
86 10600 0x2968 CHANGE_OF_SETUP_PARAMETER LOW No description fsfw/src/fsfw_hal/devicehandlers/MgmLIS3MDLHandler.h
236 12902 0x3266 POWER_STATE_MACHINE_TIMEOUT MEDIUM No description mission/system/acs/SusAssembly.h
237 12903 0x3267 SIDE_SWITCH_TRANSITION_NOT_ALLOWED LOW Not implemented, would increase already high complexity. Operator should instead command the assembly off first and then command the assembly on into the desired mode/submode combination mission/system/acs/SusAssembly.h
238 13000 0x32c8 CHILDREN_LOST_MODE MEDIUM No description mission/system/tcs/TcsBoardAssembly.h
239 13100 0x332c GPS_FIX_CHANGE INFO Fix has changed. P1: Old fix. P2: New fix 0: Not seen, 1: No Fix, 2: 2D-Fix, 3: 3D-Fix Fix has changed. P1: New fix. P2: Missed fix changes 0: Not seen, 1: No Fix, 2: 2D-Fix, 3: 3D-Fix mission/acs/archive/GPSDefinitions.h linux/acs/GPSDefinitions.h
240 13101 0x332d CANT_GET_FIX LOW MEDIUM Could not get fix in maximum allowed time. P1: Maximum allowed time to get a fix after the GPS was switched on. Could not get fix in maximum allowed time. Trying to reset both GNSS devices. P1: Maximum allowed time to get a fix after the GPS was switched on. mission/acs/archive/GPSDefinitions.h linux/acs/GPSDefinitions.h
241 13102 0x332e RESET_FAIL HIGH Failed to reset an GNNS Device. P1: Board-Side. linux/acs/GPSDefinitions.h
242 13200 0x3390 P60_BOOT_COUNT INFO P60 boot count is broadcasted once at SW startup. P1: Boot count mission/power/P60DockHandler.h
243 13201 0x3391 BATT_MODE INFO Battery mode is broadcasted at startup. P1: Mode mission/power/P60DockHandler.h
244 13202 0x3392 BATT_MODE_CHANGED MEDIUM Battery mode has changed. P1: Old mode. P2: New mode mission/power/P60DockHandler.h

View File

@@ -1,21 +0,0 @@
from tmtccmd.config import TmtcDefinitionWrapper, OpCodeEntry, CoreServiceList
from tmtccmd.config.tmtc import (
call_all_definitions_providers,
)
from tmtccmd.config.globals import get_default_tmtc_defs
def get_eive_service_op_code_dict() -> TmtcDefinitionWrapper:
"""Call all registered TMTC definition providers. They were registered using
the :py:func:`tmtc_definitions_provider` decorator.
"""
def_wrapper = get_default_tmtc_defs()
srv_5 = OpCodeEntry()
srv_5.add("0", "Event Test")
def_wrapper.add_service(
name=CoreServiceList.SERVICE_5.value,
info="PUS Service 5 Event",
op_code_entry=srv_5,
)
call_all_definitions_providers(def_wrapper)
return def_wrapper

View File

@@ -4,7 +4,7 @@
import logging import logging
from typing import List, cast from typing import List, cast
from tmtccmd import DefaultProcedureInfo from tmtccmd import TreeCommandingProcedure
from tmtccmd.tmtc import DefaultPusQueueHelper from tmtccmd.tmtc import DefaultPusQueueHelper
from tmtccmd.util import ObjectIdU32 from tmtccmd.util import ObjectIdU32
@@ -52,6 +52,7 @@ from eive_tmtc.tmtc.com.subsystem import build_com_subsystem_procedure
from eive_tmtc.tmtc.com.syrlinks_handler import pack_syrlinks_command from eive_tmtc.tmtc.com.syrlinks_handler import pack_syrlinks_command
from eive_tmtc.tmtc.core import pack_core_commands from eive_tmtc.tmtc.core import pack_core_commands
from eive_tmtc.tmtc.health import build_health_cmds from eive_tmtc.tmtc.health import build_health_cmds
from eive_tmtc.tmtc.payload.subsystem import create_payload_subsystem_cmd
from eive_tmtc.tmtc.payload.ploc_mpsoc import pack_ploc_mpsoc_commands from eive_tmtc.tmtc.payload.ploc_mpsoc import pack_ploc_mpsoc_commands
from eive_tmtc.tmtc.payload.ploc_supervisor import pack_ploc_supv_commands from eive_tmtc.tmtc.payload.ploc_supervisor import pack_ploc_supv_commands
from eive_tmtc.tmtc.payload.plpcdu import pack_pl_pcdu_commands from eive_tmtc.tmtc.payload.plpcdu import pack_pl_pcdu_commands
@@ -77,7 +78,7 @@ from eive_tmtc.utility.input_helper import InputHelper
def handle_pus_procedure( def handle_pus_procedure(
info: DefaultProcedureInfo, info: TreeCommandingProcedure,
queue_helper: DefaultPusQueueHelper, queue_helper: DefaultPusQueueHelper,
): ):
cmd_path = info.cmd_path cmd_path = info.cmd_path
@@ -252,7 +253,8 @@ def handle_payload_procedure(
queue_helper: DefaultPusQueueHelper, cmd_path_list: List[str] queue_helper: DefaultPusQueueHelper, cmd_path_list: List[str]
): ):
obj_id_man = get_object_ids() obj_id_man = get_object_ids()
assert len(cmd_path_list) >= 2 if cmd_path_list[0] == "subsystem":
return create_payload_subsystem_cmd(queue_helper, cmd_path_list[1])
if cmd_path_list[0] == "ploc_mpsoc": if cmd_path_list[0] == "ploc_mpsoc":
return pack_ploc_mpsoc_commands(queue_helper, cmd_path_list[1]) return pack_ploc_mpsoc_commands(queue_helper, cmd_path_list[1])
if cmd_path_list[0] == "ploc_supv": if cmd_path_list[0] == "ploc_supv":
@@ -264,7 +266,6 @@ def handle_payload_procedure(
object_id=object_id, q=queue_helper, cmd_str=cmd_path_list[1] object_id=object_id, q=queue_helper, cmd_str=cmd_path_list[1]
) )
if cmd_path_list[0] == "pl_pcdu": if cmd_path_list[0] == "pl_pcdu":
assert len(cmd_path_list) >= 3
return pack_pl_pcdu_commands(q=queue_helper, cmd_str=cmd_path_list[1]) return pack_pl_pcdu_commands(q=queue_helper, cmd_str=cmd_path_list[1])
if cmd_path_list[0] == "scex": if cmd_path_list[0] == "scex":
return pack_scex_cmds( return pack_scex_cmds(

View File

@@ -1,7 +1,9 @@
import logging import logging
import datetime import datetime
import sys import sys
import base64
from eive_tmtc.config.definitions import PRINT_RAW_EVENTS_B64_STR
from eive_tmtc.config.events import get_event_dict from eive_tmtc.config.events import get_event_dict
from eive_tmtc.config.object_ids import get_object_ids from eive_tmtc.config.object_ids import get_object_ids
from eive_tmtc.pus_tm.defs import PrintWrapper from eive_tmtc.pus_tm.defs import PrintWrapper
@@ -21,6 +23,8 @@ _LOGGER = logging.getLogger(__name__)
def handle_event_packet( # noqa C901: Complexity okay here def handle_event_packet( # noqa C901: Complexity okay here
raw_tm: bytes, pw: PrintWrapper raw_tm: bytes, pw: PrintWrapper
): # noqa C901: Complexity okay here ): # noqa C901: Complexity okay here
if PRINT_RAW_EVENTS_B64_STR:
print(f"PUS Event TM Base64: {base64.b64encode(raw_tm)}")
tm = Service5Tm.unpack(data=raw_tm, time_reader=CdsShortTimestamp.empty()) tm = Service5Tm.unpack(data=raw_tm, time_reader=CdsShortTimestamp.empty())
event_dict = get_event_dict() event_dict = get_event_dict()
event_def = tm.event_definition event_def = tm.event_definition
@@ -36,6 +40,7 @@ def handle_event_packet( # noqa C901: Complexity okay here
obj_name = event_def.reporter_id.hex(sep=",") obj_name = event_def.reporter_id.hex(sep=",")
else: else:
obj_name = obj_id_obj.name obj_name = obj_id_obj.name
assert tm.time_provider is not None
generic_event_string = ( generic_event_string = (
f"Object {obj_name} generated Event {info.name} (ID: {event_def.event_id:#04x})" f"Object {obj_name} generated Event {info.name} (ID: {event_def.event_id:#04x})"
f" at {tm.time_provider.as_date_time()}" f" at {tm.time_provider.as_date_time()}"
@@ -128,12 +133,16 @@ def handle_event_packet( # noqa C901: Complexity okay here
time = event_def.param1 + event_def.param2 / 1000.0 time = event_def.param1 + event_def.param2 / 1000.0
time_dt = datetime.datetime.fromtimestamp(time, datetime.timezone.utc) time_dt = datetime.datetime.fromtimestamp(time, datetime.timezone.utc)
pw.dlog(f"Current time: {time_dt}") pw.dlog(f"Current time: {time_dt}")
if info.name == "CLOCK_DUMP": if (
info.name == "CLOCK_DUMP"
or info.name == "CLOCK_DUMP_BEFORE_SETTING_TIME"
or info.name == "CLOCK_DUMP_AFTER_SETTING_TIME"
):
specific_handler = True specific_handler = True
# param 1 is timeval seconds, param 2 is timeval subsecond microseconds # param 1 is timeval seconds, param 2 is timeval subsecond microseconds
time = event_def.param1 + event_def.param2 / 1000000.0 time = event_def.param1 + event_def.param2 / 1000000.0
time_dt = datetime.datetime.fromtimestamp(time, datetime.timezone.utc) time_dt = datetime.datetime.fromtimestamp(time, datetime.timezone.utc)
pw.dlog(f"Current time: {time_dt}") pw.dlog(f"Clock dump event {info.name}. Current time: {time_dt}")
if info.name == "ACTIVE_SD_INFO": if info.name == "ACTIVE_SD_INFO":
sd_0_state = (event_def.param2 >> 16) & 0xFFFF sd_0_state = (event_def.param2 >> 16) & 0xFFFF
sd_1_state = event_def.param2 & 0xFFFF sd_1_state = event_def.param2 & 0xFFFF

View File

@@ -6,6 +6,7 @@ import base64 # noqa
import sqlite3 import sqlite3
from typing import List, cast from typing import List, cast
from uuid import UUID from uuid import UUID
from eive_tmtc.config.definitions import PRINT_RAW_HK_B64_STR
from eive_tmtc.pus_tm.hk import HkTmInfo from eive_tmtc.pus_tm.hk import HkTmInfo
from eive_tmtc.tmtc.acs.acs_ctrl import handle_acs_ctrl_hk_data from eive_tmtc.tmtc.acs.acs_ctrl import handle_acs_ctrl_hk_data
@@ -74,7 +75,8 @@ def handle_hk_packet(
if tm_packet.subservice == 25 or tm_packet.subservice == 26: if tm_packet.subservice == 25 or tm_packet.subservice == 26:
hk_data = tm_packet.tm_data[8:] hk_data = tm_packet.tm_data[8:]
if named_obj_id.as_bytes in hk_filter.object_ids: if named_obj_id.as_bytes in hk_filter.object_ids:
# print(f"PUS TM Base64: {base64.b64encode(raw_tm)}") if PRINT_RAW_HK_B64_STR:
print(f"PUS TM Base64: {base64.b64encode(raw_tm)}")
handle_regular_hk_print( handle_regular_hk_print(
printer=printer, printer=printer,
packet_uuid=packet_uuid, packet_uuid=packet_uuid,

View File

@@ -3,10 +3,8 @@ import enum
import logging import logging
import struct import struct
from eive_tmtc.config.definitions import CustomServiceList
from eive_tmtc.pus_tm.defs import PrintWrapper from eive_tmtc.pus_tm.defs import PrintWrapper
from tmtccmd.config import CmdTreeNode, TmtcDefinitionWrapper, OpCodeEntry from tmtccmd.config import CmdTreeNode
from tmtccmd.config.tmtc import tmtc_definitions_provider
from tmtccmd.pus.s200_fsfw_mode import create_mode_command, Mode from tmtccmd.pus.s200_fsfw_mode import create_mode_command, Mode
from tmtccmd.tmtc import DefaultPusQueueHelper from tmtccmd.tmtc import DefaultPusQueueHelper
from tmtccmd.pus.tc.s3_fsfw_hk import ( from tmtccmd.pus.tc.s3_fsfw_hk import (
@@ -15,6 +13,7 @@ from tmtccmd.pus.tc.s3_fsfw_hk import (
create_enable_periodic_hk_command_with_interval_with_diag, create_enable_periodic_hk_command_with_interval_with_diag,
create_disable_periodic_hk_command_with_diag, create_disable_periodic_hk_command_with_diag,
) )
from tmtccmd.pus.tc.s8_fsfw_action import create_action_cmd
from tmtccmd.fsfw.tmtc_printer import FsfwTmTcPrinter from tmtccmd.fsfw.tmtc_printer import FsfwTmTcPrinter
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
@@ -24,6 +23,11 @@ class GpsInfo:
MAX_SATELLITES = 30 MAX_SATELLITES = 30
class GnssChip(enum.IntEnum):
A_SIDE = 0
B_SIDE = 1
class OpCode: class OpCode:
OFF = "off" OFF = "off"
ON = "on" ON = "on"
@@ -59,36 +63,25 @@ def create_gnss_node() -> CmdTreeNode:
] ]
info_strs = [getattr(Info, key) for key in dir(OpCode) if not key.startswith("__")] info_strs = [getattr(Info, key) for key in dir(OpCode) if not key.startswith("__")]
combined_dict = dict(zip(op_code_strs, info_strs)) combined_dict = dict(zip(op_code_strs, info_strs))
node = CmdTreeNode("gnss", "GNSS device", hide_children_for_print=True) node = CmdTreeNode("gnss_devs", "GNSS Controller", hide_children_for_print=True)
for op_code, info in combined_dict.items(): for op_code, info in combined_dict.items():
node.add_child(CmdTreeNode(op_code, info)) node.add_child(CmdTreeNode(op_code, info))
return node return node
@tmtc_definitions_provider
def add_gps_cmds(defs: TmtcDefinitionWrapper):
oce = OpCodeEntry()
oce.add(keys=OpCode.OFF, info=Info.OFF)
oce.add(keys=OpCode.ON, info=Info.ON)
oce.add(keys=OpCode.RESET_GNSS, info=Info.RESET_GNSS)
oce.add(keys=OpCode.REQ_CORE_HK, info=Info.REQ_CORE_HK)
oce.add(keys=OpCode.ENABLE_CORE_HK, info=Info.ENABLE_CORE_HK)
oce.add(keys=OpCode.DISABLE_CORE_HK, info=Info.DISABLE_CORE_HK)
oce.add(keys=OpCode.REQ_SKYVIEW_HK, info=Info.REQ_SKYVIEW_HK)
oce.add(keys=OpCode.ENABLE_SKYVIEW_HK, info=Info.ENABLE_SKYVIEW_HK)
oce.add(keys=OpCode.DISABLE_SKYVIEW_HK, info=Info.DISABLE_SKYVIEW_HK)
defs.add_service(
name=CustomServiceList.GPS_CTRL.value,
info="GPS/GNSS Controller",
op_code_entry=oce,
)
def pack_gps_command( # noqa: C901 def pack_gps_command( # noqa: C901
object_id: bytes, q: DefaultPusQueueHelper, cmd_str: str object_id: bytes, q: DefaultPusQueueHelper, cmd_str: str
): # noqa: C901: ): # noqa: C901:
if cmd_str == OpCode.RESET_GNSS: if cmd_str == OpCode.RESET_GNSS:
# TODO: This needs to be re-implemented for val in GnssChip:
print("{:<2}: {:<20}".format(val, val.name))
chip: str = ""
while chip not in ["0", "1"]:
chip = input("Please specify which chip to reset: ")
q.add_log_cmd(f"gps: {Info.DISABLE_CORE_HK}")
q.add_pus_tc(
create_action_cmd(object_id=object_id, action_id=5, user_data=chip.encode())
)
_LOGGER.warning("Reset pin handling needs to be re-implemented") _LOGGER.warning("Reset pin handling needs to be re-implemented")
if cmd_str == OpCode.ENABLE_CORE_HK: if cmd_str == OpCode.ENABLE_CORE_HK:
interval = float(input("Please specify interval in floating point seconds: ")) interval = float(input("Please specify interval in floating point seconds: "))

View File

@@ -6,6 +6,8 @@ from eive_tmtc.config.object_ids import (
GYRO_1_L3G_HANDLER_ID, GYRO_1_L3G_HANDLER_ID,
GYRO_2_ADIS_HANDLER_ID, GYRO_2_ADIS_HANDLER_ID,
ACS_BOARD_ASS_ID, ACS_BOARD_ASS_ID,
PLOC_MPSOC_ID,
PLOC_SUPV_ID,
RW_ASSEMBLY, RW_ASSEMBLY,
SUS_BOARD_ASS_ID, SUS_BOARD_ASS_ID,
MGM_0_LIS3_HANDLER_ID, MGM_0_LIS3_HANDLER_ID,
@@ -28,6 +30,7 @@ SUBSYSTEM_DICT = {
0: "acs", 0: "acs",
1: "tcs", 1: "tcs",
2: "com", 2: "com",
3: "payload",
} }
ACS_OBJ_DICT = { ACS_OBJ_DICT = {
@@ -59,6 +62,11 @@ TCS_OBJ_DICT = {
5: ("TMP1075 IF BOARD", TMP1075_HANDLER_IF_BRD_ID), 5: ("TMP1075 IF BOARD", TMP1075_HANDLER_IF_BRD_ID),
} }
PAYLOAD_OBJ_DICT = {
0: ("Payload MPSoC", PLOC_MPSOC_ID),
1: ("Payload Supervisor", PLOC_SUPV_ID),
}
def get_obj_if_from_dict(lut: dict) -> bytes: def get_obj_if_from_dict(lut: dict) -> bytes:
for k, v in lut.items(): for k, v in lut.items():
@@ -81,6 +89,8 @@ def prompt_object() -> bytes:
return get_obj_if_from_dict(ACS_OBJ_DICT) return get_obj_if_from_dict(ACS_OBJ_DICT)
elif subsystem == "tcs": elif subsystem == "tcs":
return get_obj_if_from_dict(TCS_OBJ_DICT) return get_obj_if_from_dict(TCS_OBJ_DICT)
elif subsystem == "payload":
return get_obj_if_from_dict(PAYLOAD_OBJ_DICT)
else: else:
print(f"No object for subsystem {subsystem}") print(f"No object for subsystem {subsystem}")
return bytes() return bytes()

View File

@@ -21,20 +21,27 @@ class ModeId(enum.IntEnum):
class OpCode(str, enum.Enum): class OpCode(str, enum.Enum):
OFF = "off" OFF = "off"
REPORT_ALL_MODES = "report_modes" REPORT_ALL_MODES = "report_modes"
MPSOC_STREAM = "mode_mpsoc_stream"
CAM_STREAM = "mode_cam_stream"
EARTH_OBSV = "mode_eart_obsv"
class Info(str, enum.Enum): class Info(str, enum.Enum):
OFF = "Off Command" OFF = "Off Command"
REPORT_ALL_MODES = "Report all modes" REPORT_ALL_MODES = "Report all modes"
MPSOC_STREAM = "MPSoC Stream Mode"
CAM_STREAM = "Camera Stream Mode"
EARTH_OBSV = "Earth Observation Mode"
HANDLER_LIST: Dict[str, Tuple[int, str]] = { HANDLER_LIST: Dict[str, Tuple[int, str]] = {
OpCode.OFF: (ModeId.OFF, Info.OFF), OpCode.OFF: (ModeId.OFF, Info.OFF),
OpCode.MPSOC_STREAM: (ModeId.MPSOC_STREAM, Info.MPSOC_STREAM),
} }
def build_acs_subsystem_cmd(q: DefaultPusQueueHelper, cmd_str: str): def create_payload_subsystem_cmd(q: DefaultPusQueueHelper, cmd_str: str):
info_prefix = "ACS Subsystem" info_prefix = "Payload Subsystem"
if cmd_str == OpCode.REPORT_ALL_MODES: if cmd_str == OpCode.REPORT_ALL_MODES:
q.add_log_cmd(f"{info_prefix}: {Info.REPORT_ALL_MODES}") q.add_log_cmd(f"{info_prefix}: {Info.REPORT_ALL_MODES}")
q.add_pus_tc( q.add_pus_tc(
@@ -45,19 +52,28 @@ def build_acs_subsystem_cmd(q: DefaultPusQueueHelper, cmd_str: str):
) )
) )
mode_info_tup = HANDLER_LIST.get(cmd_str) mode_info_tup = HANDLER_LIST.get(cmd_str)
assert mode_info_tup is not None
if mode_info_tup is None: if mode_info_tup is None:
return return
pack_mode_cmd_with_info( pack_mode_cmd_with_info(
object_id=PL_SUBSYSTEM_ID, object_id=PL_SUBSYSTEM_ID,
info=f"{info_prefix}: {mode_info_tup[1]}", info=f"{info_prefix}: {mode_info_tup[1]}",
submode=0,
mode=mode_info_tup[0], mode=mode_info_tup[0],
submode=0,
q=q, q=q,
) )
def create_payload_subsystem_node() -> CmdTreeNode: def create_payload_subsystem_node() -> CmdTreeNode:
payload_node = CmdTreeNode("payload", "Payload Subsystem") payload_node = CmdTreeNode("payload", "Payload Subsystem")
payload_node.add_child(CmdTreeNode(OpCode.OFF, Info.OFF)) subsystem_node = CmdTreeNode("subsystem", "Subsystem Commands")
payload_node.add_child(CmdTreeNode(OpCode.REPORT_ALL_MODES, Info.REPORT_ALL_MODES)) subsystem_node.add_child(CmdTreeNode(OpCode.OFF, Info.OFF))
subsystem_node.add_child(CmdTreeNode(OpCode.MPSOC_STREAM, Info.MPSOC_STREAM))
subsystem_node.add_child(CmdTreeNode(OpCode.EARTH_OBSV, Info.EARTH_OBSV))
subsystem_node.add_child(CmdTreeNode(OpCode.CAM_STREAM, Info.CAM_STREAM))
subsystem_node.add_child(
CmdTreeNode(OpCode.REPORT_ALL_MODES, Info.REPORT_ALL_MODES)
)
payload_node.add_child(subsystem_node)
return payload_node return payload_node

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 = "6.1.1" version = "6.2.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.0.0rc1", # "tmtccmd~=8.0.0rc2",
"cfdp-py~=0.1.0", "cfdp-py~=0.1.1",
# "tmtccmd @ git+https://github.com/robamu-org/tmtccmd@main", "tmtccmd @ git+https://github.com/robamu-org/tmtccmd@main",
"python-dateutil ~= 2.8", "python-dateutil ~= 2.8",
] ]

14
scripts/raw-analysis.py Executable file
View File

@@ -0,0 +1,14 @@
#!/usr/bin/env python3
from base64 import b64decode
from spacepackets.ccsds.time import CdsShortTimestamp
from spacepackets.ecss.tm import PusTelemetry
from spacepackets.ecss.pus_1_verification import Service1Tm, UnpackParams
bruh = "CGX6cQAdIAEIOzcAAEBedwUTOzkYZe5WAAEAAAAAAAAAAF4z"
data = b64decode(bruh)
tm = PusTelemetry.unpack(data, CdsShortTimestamp.empty())
srv1_tm = Service1Tm.from_tm(
tm, UnpackParams(time_reader=CdsShortTimestamp.empty(), bytes_err_code=2)
)
print(f"service {tm.service} subservice {tm.subservice}")
print(f"error code: {srv1_tm.error_code}")

View File

@@ -97,8 +97,8 @@ def setup_params() -> Tuple[SetupWrapper, int]:
hk_level = int(post_arg_parsing_wrapper.args_raw.hk) hk_level = int(post_arg_parsing_wrapper.args_raw.hk)
else: else:
hk_level = 0 hk_level = 0
if params.app_params.print_tree: if params.tc_params.print_tree:
perform_tree_printout(params.app_params, hook_obj.get_command_definitions()) perform_tree_printout(params.tc_params, hook_obj.get_command_definitions())
sys.exit(0) sys.exit(0)
params.apid = PUS_APID params.apid = PUS_APID
if params.com_if is None: if params.com_if is None:
@@ -232,6 +232,7 @@ def main(): # noqa C901: Complexity okay here.
state = tmtc_backend.periodic_op(None) state = tmtc_backend.periodic_op(None)
tc_handler.cfdp_in_ccsds_handler.state_machine() tc_handler.cfdp_in_ccsds_handler.state_machine()
if state.request == BackendRequest.TERMINATION_NO_ERROR: if state.request == BackendRequest.TERMINATION_NO_ERROR:
tmtc_backend.close_com_if()
sys.exit(0) sys.exit(0)
elif state.request == BackendRequest.DELAY_IDLE: elif state.request == BackendRequest.DELAY_IDLE:
_LOGGER.info("TMTC Client in IDLE mode") _LOGGER.info("TMTC Client in IDLE mode")
@@ -252,6 +253,7 @@ def main(): # noqa C901: Complexity okay here.
elif state.request == BackendRequest.CALL_NEXT: elif state.request == BackendRequest.CALL_NEXT:
pass pass
except KeyboardInterrupt: except KeyboardInterrupt:
tmtc_backend.close_com_if()
sys.exit(0) sys.exit(0)