Compare commits

...

17 Commits

16 changed files with 143 additions and 81 deletions

View File

@@ -10,6 +10,22 @@ list yields a list of all related PRs for each release.
# [unreleased]
# [v2.12.6] 2023-02-14
## Fixed
- Fixed GPS processed set output
## Added
- Added command to request switcher set from PCDU handler.
# [v2.12.5] 2023-02-13
## Added
- EIVE system commands
# [v2.12.4] 2023-02-12
## Fixed
@@ -118,7 +134,6 @@ tmtccmd v4.0.0rc0
## Added
- Added command to request switcher set from PCDU handler.
- Star Tracker: Add commands to update default datarate.
## Changed

View File

@@ -1,4 +1,4 @@
__version__ = "2.12.4"
__version__ = "2.12.6"
import logging
from pathlib import Path
@@ -6,7 +6,7 @@ from pathlib import Path
SW_NAME = "eive-tmtc"
VERSION_MAJOR = 2
VERSION_MINOR = 12
VERSION_REVISION = 4
VERSION_REVISION = 6
EIVE_TMTC_ROOT = Path(__file__).parent
PACKAGE_ROOT = EIVE_TMTC_ROOT.parent

View File

@@ -71,6 +71,6 @@ class CustomServiceList(str, enum.Enum):
RTD = "rtd"
TMP1075 = "tcs_tmp"
TVTTESTPROCEDURE = "tvtestproc"
CONTROLLERS = "controllers"
SCEX = "scex"
TM_STORE = "tm_store"
SYSTEM = "system"

View File

@@ -121,8 +121,8 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path
11706;0x2dba;SELF_TEST_MTM_RANGE_FAILURE;LOW;Get self test result returns failure that MTM values were outside of the expected range. P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission/devices/ImtqHandler.h
11707;0x2dbb;SELF_TEST_COIL_CURRENT_FAILURE;LOW;Get self test result returns failure indicating that the coil current was outside of the expected range P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA;mission/devices/ImtqHandler.h
11708;0x2dbc;INVALID_ERROR_BYTE;LOW;Received invalid error byte. This indicates an error of the communication link between IMTQ and OBC.;mission/devices/ImtqHandler.h
11801;0x2e19;ERROR_STATE;HIGH;Reaction wheel signals an error state;mission/devices/devicedefinitions/RwDefinitions.h
11802;0x2e1a;RESET_OCCURED;LOW;;mission/devices/devicedefinitions/RwDefinitions.h
11801;0x2e19;ERROR_STATE;HIGH;Reaction wheel signals an error state;mission/devices/devicedefinitions/rwHelpers.h
11802;0x2e1a;RESET_OCCURED;LOW;;mission/devices/devicedefinitions/rwHelpers.h
11901;0x2e7d;BOOTING_FIRMWARE_FAILED;LOW;Failed to boot firmware;linux/devices/startracker/StarTrackerHandler.h
11902;0x2e7e;BOOTING_BOOTLOADER_FAILED;LOW;Failed to boot star tracker into bootloader mode;linux/devices/startracker/StarTrackerHandler.h
12001;0x2ee1;SUPV_MEMORY_READ_RPT_CRC_FAILURE;LOW;PLOC supervisor crc failure in telemetry packet;linux/devices/ploc/PlocSupervisorHandler.h
1 Event ID (dec) Event ID (hex) Name Severity Description File Path
121 11706 0x2dba SELF_TEST_MTM_RANGE_FAILURE LOW Get self test result returns failure that MTM values were outside of the expected range. P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA mission/devices/ImtqHandler.h
122 11707 0x2dbb SELF_TEST_COIL_CURRENT_FAILURE LOW Get self test result returns failure indicating that the coil current was outside of the expected range P1: Indicates on which axis the failure occurred. 0 -> INIT, 1 -> +X, 2 -> -X, 3 -> +Y, 4 -> -Y, 5 -> +Z, 6 -> -Z, 7 -> FINA mission/devices/ImtqHandler.h
123 11708 0x2dbc INVALID_ERROR_BYTE LOW Received invalid error byte. This indicates an error of the communication link between IMTQ and OBC. mission/devices/ImtqHandler.h
124 11801 0x2e19 ERROR_STATE HIGH Reaction wheel signals an error state mission/devices/devicedefinitions/RwDefinitions.h mission/devices/devicedefinitions/rwHelpers.h
125 11802 0x2e1a RESET_OCCURED LOW mission/devices/devicedefinitions/RwDefinitions.h mission/devices/devicedefinitions/rwHelpers.h
126 11901 0x2e7d BOOTING_FIRMWARE_FAILED LOW Failed to boot firmware linux/devices/startracker/StarTrackerHandler.h
127 11902 0x2e7e BOOTING_BOOTLOADER_FAILED LOW Failed to boot star tracker into bootloader mode linux/devices/startracker/StarTrackerHandler.h
128 12001 0x2ee1 SUPV_MEMORY_READ_RPT_CRC_FAILURE LOW PLOC supervisor crc failure in telemetry packet linux/devices/ploc/PlocSupervisorHandler.h

View File

@@ -126,6 +126,7 @@ SUS_5_N_LOC_XFYMZB_PT_ZB = bytes([0x44, 0x12, 0x00, 0x37])
SUS_11_R_LOC_XBYMZB_PT_ZB = bytes([0x44, 0x12, 0x00, 0x43])
# System and Assembly Objects
EIVE_SYSTEM_ID = bytes([0x73, 0x01, 0x00, 0x00])
ACS_SUBSYSTEM_ID = bytes([0x73, 0x01, 0x00, 0x01])
PL_SUBSYSTEM_ID = bytes([0x73, 0x01, 0x00, 0x02])
TCS_SUBSYSTEM_ID = bytes([0x73, 0x01, 0x00, 0x03])

View File

@@ -76,7 +76,7 @@
0x49010005;GPIO_IF
0x49010006;SCEX_UART_READER
0x49020004;SPI_MAIN_COM_IF
0x49020005;SPI_RW_COM_IF
0x49020005;RW_POLLING_TASK
0x49020006;SPI_RTD_COM_IF
0x49030003;UART_COM_IF
0x49040002;I2C_COM_IF
1 0x00005060 P60DOCK_TEST_TASK
76 0x49010005 GPIO_IF
77 0x49010006 SCEX_UART_READER
78 0x49020004 SPI_MAIN_COM_IF
79 0x49020005 SPI_RW_COM_IF RW_POLLING_TASK
80 0x49020006 SPI_RTD_COM_IF
81 0x49030003 UART_COM_IF
82 0x49040002 I2C_COM_IF

View File

@@ -3,6 +3,14 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path
0x0001;Failed;Unspecified system-wide code for failed.;1;HasReturnvaluesIF;fsfw/returnvalues/returnvalue.h
0x63a0;NVMB_KeyNotExists;Specified key does not exist in json file;160;NVM_PARAM_BASE;mission/memory/NVMParameterBase.h
0x6300;NVMB_Busy;;0;NVM_PARAM_BASE;mission/system/objects/Stack5VHandler.h
0x52b0;RWHA_SpiWriteFailure;;176;RW_HANDLER;mission/devices/devicedefinitions/rwHelpers.h
0x52b1;RWHA_SpiReadFailure;Used by the spi send function to tell a failing read call;177;RW_HANDLER;mission/devices/devicedefinitions/rwHelpers.h
0x52b2;RWHA_MissingStartSign;Can be used by the HDLC decoding mechanism to inform about a missing start sign 0x7E;178;RW_HANDLER;mission/devices/devicedefinitions/rwHelpers.h
0x52b3;RWHA_InvalidSubstitute;Can be used by the HDLC decoding mechanism to inform about an invalid substitution combination;179;RW_HANDLER;mission/devices/devicedefinitions/rwHelpers.h
0x52b4;RWHA_MissingEndSign;HDLC decoding mechanism never receives the end sign 0x7E;180;RW_HANDLER;mission/devices/devicedefinitions/rwHelpers.h
0x52b5;RWHA_NoReply;Reaction wheel only responds with empty frames.;181;RW_HANDLER;mission/devices/devicedefinitions/rwHelpers.h
0x52b6;RWHA_NoStartMarker;Expected a start marker as first byte;182;RW_HANDLER;mission/devices/devicedefinitions/rwHelpers.h
0x52b7;RWHA_SpiReadTimeout;Timeout when reading reply;183;RW_HANDLER;mission/devices/devicedefinitions/rwHelpers.h
0x58a0;SUSS_ErrorUnlockMutex;;160;SUS_HANDLER;mission/devices/SusHandler.h
0x58a1;SUSS_ErrorLockMutex;;161;SUS_HANDLER;mission/devices/SusHandler.h
0x66a0;SADPL_CommandNotSupported;;160;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h
@@ -10,26 +18,14 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path
0x66a2;SADPL_MainSwitchTimeoutFailure;;162;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h
0x66a3;SADPL_SwitchingDeplSa1Failed;;163;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h
0x66a4;SADPL_SwitchingDeplSa2Failed;;164;SA_DEPL_HANDLER;mission/devices/SolarArrayDeploymentHandler.h
0x51a0;IMTQ_InvalidCommandCode;;160;IMTQ_HANDLER;mission/devices/ImtqHandler.h
0x51a1;IMTQ_ParameterMissing;;161;IMTQ_HANDLER;mission/devices/ImtqHandler.h
0x51a2;IMTQ_ParameterInvalid;;162;IMTQ_HANDLER;mission/devices/ImtqHandler.h
0x51a3;IMTQ_CcUnavailable;;163;IMTQ_HANDLER;mission/devices/ImtqHandler.h
0x51a4;IMTQ_InternalProcessingError;;164;IMTQ_HANDLER;mission/devices/ImtqHandler.h
0x51a5;IMTQ_RejectedWithoutReason;;165;IMTQ_HANDLER;mission/devices/ImtqHandler.h
0x51a0;IMTQ_InvalidSpeed;Action Message with invalid speed was received. Valid speeds must be in the range of [-65000, 1000] or [1000, 65000];160;IMTQ_HANDLER;mission/devices/RwHandler.h
0x51a1;IMTQ_InvalidRampTime;Action Message with invalid ramp time was received.;161;IMTQ_HANDLER;mission/devices/RwHandler.h
0x51a2;IMTQ_SetSpeedCommandInvalidLength;Received set speed command has invalid length. Should be 6.;162;IMTQ_HANDLER;mission/devices/RwHandler.h
0x51a3;IMTQ_ExecutionFailed;Command execution failed;163;IMTQ_HANDLER;mission/devices/RwHandler.h
0x51a4;IMTQ_CrcError;Reaction wheel reply has invalid crc;164;IMTQ_HANDLER;mission/devices/RwHandler.h
0x51a5;IMTQ_ValueNotRead;;165;IMTQ_HANDLER;mission/devices/RwHandler.h
0x51a6;IMTQ_CmdErrUnknown;;166;IMTQ_HANDLER;mission/devices/ImtqHandler.h
0x51a7;IMTQ_UnexpectedSelfTestReply;The status reply to a self test command was received but no self test command has been sent. This should normally never happen.;167;IMTQ_HANDLER;mission/devices/ImtqHandler.h
0x52b0;RWHA_SpiWriteFailure;;176;RW_HANDLER;mission/devices/RwHandler.h
0x52b1;RWHA_SpiReadFailure;Used by the spi send function to tell a failing read call;177;RW_HANDLER;mission/devices/RwHandler.h
0x52b2;RWHA_MissingStartSign;Can be used by the HDLC decoding mechanism to inform about a missing start sign 0x7E;178;RW_HANDLER;mission/devices/RwHandler.h
0x52b3;RWHA_InvalidSubstitute;Can be used by the HDLC decoding mechanism to inform about an invalid substitution combination;179;RW_HANDLER;mission/devices/RwHandler.h
0x52b4;RWHA_MissingEndSign;HDLC decoding mechanism never receives the end sign 0x7E;180;RW_HANDLER;mission/devices/RwHandler.h
0x52b5;RWHA_NoReply;Reaction wheel only responds with empty frames.;181;RW_HANDLER;mission/devices/RwHandler.h
0x52b6;RWHA_NoStartMarker;Expected a start marker as first byte;182;RW_HANDLER;mission/devices/RwHandler.h
0x52a0;RWHA_InvalidSpeed;Action Message with invalid speed was received. Valid speeds must be in the range of [-65000, 1000] or [1000, 65000];160;RW_HANDLER;mission/devices/RwHandler.h
0x52a1;RWHA_InvalidRampTime;Action Message with invalid ramp time was received.;161;RW_HANDLER;mission/devices/RwHandler.h
0x52a2;RWHA_SetSpeedCommandInvalidLength;Received set speed command has invalid length. Should be 6.;162;RW_HANDLER;mission/devices/RwHandler.h
0x52a3;RWHA_ExecutionFailed;Command execution failed;163;RW_HANDLER;mission/devices/RwHandler.h
0x52a4;RWHA_CrcError;Reaction wheel reply has invalid crc;164;RW_HANDLER;mission/devices/RwHandler.h
0x50a0;SYRLINKS_CrcFailure;;160;SYRLINKS_HANDLER;mission/devices/SyrlinksHandler.h
0x50a1;SYRLINKS_UartFraminOrParityErrorAck;;161;SYRLINKS_HANDLER;mission/devices/SyrlinksHandler.h
0x50a2;SYRLINKS_BadCharacterAck;;162;SYRLINKS_HANDLER;mission/devices/SyrlinksHandler.h
1 Full ID (hex) Name Description Unique ID Subsytem Name File Path
3 0x0001 Failed Unspecified system-wide code for failed. 1 HasReturnvaluesIF fsfw/returnvalues/returnvalue.h
4 0x63a0 NVMB_KeyNotExists Specified key does not exist in json file 160 NVM_PARAM_BASE mission/memory/NVMParameterBase.h
5 0x6300 NVMB_Busy 0 NVM_PARAM_BASE mission/system/objects/Stack5VHandler.h
6 0x52b0 RWHA_SpiWriteFailure 176 RW_HANDLER mission/devices/devicedefinitions/rwHelpers.h
7 0x52b1 RWHA_SpiReadFailure Used by the spi send function to tell a failing read call 177 RW_HANDLER mission/devices/devicedefinitions/rwHelpers.h
8 0x52b2 RWHA_MissingStartSign Can be used by the HDLC decoding mechanism to inform about a missing start sign 0x7E 178 RW_HANDLER mission/devices/devicedefinitions/rwHelpers.h
9 0x52b3 RWHA_InvalidSubstitute Can be used by the HDLC decoding mechanism to inform about an invalid substitution combination 179 RW_HANDLER mission/devices/devicedefinitions/rwHelpers.h
10 0x52b4 RWHA_MissingEndSign HDLC decoding mechanism never receives the end sign 0x7E 180 RW_HANDLER mission/devices/devicedefinitions/rwHelpers.h
11 0x52b5 RWHA_NoReply Reaction wheel only responds with empty frames. 181 RW_HANDLER mission/devices/devicedefinitions/rwHelpers.h
12 0x52b6 RWHA_NoStartMarker Expected a start marker as first byte 182 RW_HANDLER mission/devices/devicedefinitions/rwHelpers.h
13 0x52b7 RWHA_SpiReadTimeout Timeout when reading reply 183 RW_HANDLER mission/devices/devicedefinitions/rwHelpers.h
14 0x58a0 SUSS_ErrorUnlockMutex 160 SUS_HANDLER mission/devices/SusHandler.h
15 0x58a1 SUSS_ErrorLockMutex 161 SUS_HANDLER mission/devices/SusHandler.h
16 0x66a0 SADPL_CommandNotSupported 160 SA_DEPL_HANDLER mission/devices/SolarArrayDeploymentHandler.h
18 0x66a2 SADPL_MainSwitchTimeoutFailure 162 SA_DEPL_HANDLER mission/devices/SolarArrayDeploymentHandler.h
19 0x66a3 SADPL_SwitchingDeplSa1Failed 163 SA_DEPL_HANDLER mission/devices/SolarArrayDeploymentHandler.h
20 0x66a4 SADPL_SwitchingDeplSa2Failed 164 SA_DEPL_HANDLER mission/devices/SolarArrayDeploymentHandler.h
21 0x51a0 IMTQ_InvalidCommandCode IMTQ_InvalidSpeed Action Message with invalid speed was received. Valid speeds must be in the range of [-65000, 1000] or [1000, 65000] 160 IMTQ_HANDLER mission/devices/ImtqHandler.h mission/devices/RwHandler.h
22 0x51a1 IMTQ_ParameterMissing IMTQ_InvalidRampTime Action Message with invalid ramp time was received. 161 IMTQ_HANDLER mission/devices/ImtqHandler.h mission/devices/RwHandler.h
23 0x51a2 IMTQ_ParameterInvalid IMTQ_SetSpeedCommandInvalidLength Received set speed command has invalid length. Should be 6. 162 IMTQ_HANDLER mission/devices/ImtqHandler.h mission/devices/RwHandler.h
24 0x51a3 IMTQ_CcUnavailable IMTQ_ExecutionFailed Command execution failed 163 IMTQ_HANDLER mission/devices/ImtqHandler.h mission/devices/RwHandler.h
25 0x51a4 IMTQ_InternalProcessingError IMTQ_CrcError Reaction wheel reply has invalid crc 164 IMTQ_HANDLER mission/devices/ImtqHandler.h mission/devices/RwHandler.h
26 0x51a5 IMTQ_RejectedWithoutReason IMTQ_ValueNotRead 165 IMTQ_HANDLER mission/devices/ImtqHandler.h mission/devices/RwHandler.h
27 0x51a6 IMTQ_CmdErrUnknown 166 IMTQ_HANDLER mission/devices/ImtqHandler.h
28 0x51a7 IMTQ_UnexpectedSelfTestReply The status reply to a self test command was received but no self test command has been sent. This should normally never happen. 167 IMTQ_HANDLER mission/devices/ImtqHandler.h
0x52b0 RWHA_SpiWriteFailure 176 RW_HANDLER mission/devices/RwHandler.h
0x52b1 RWHA_SpiReadFailure Used by the spi send function to tell a failing read call 177 RW_HANDLER mission/devices/RwHandler.h
0x52b2 RWHA_MissingStartSign Can be used by the HDLC decoding mechanism to inform about a missing start sign 0x7E 178 RW_HANDLER mission/devices/RwHandler.h
0x52b3 RWHA_InvalidSubstitute Can be used by the HDLC decoding mechanism to inform about an invalid substitution combination 179 RW_HANDLER mission/devices/RwHandler.h
0x52b4 RWHA_MissingEndSign HDLC decoding mechanism never receives the end sign 0x7E 180 RW_HANDLER mission/devices/RwHandler.h
0x52b5 RWHA_NoReply Reaction wheel only responds with empty frames. 181 RW_HANDLER mission/devices/RwHandler.h
0x52b6 RWHA_NoStartMarker Expected a start marker as first byte 182 RW_HANDLER mission/devices/RwHandler.h
0x52a0 RWHA_InvalidSpeed Action Message with invalid speed was received. Valid speeds must be in the range of [-65000, 1000] or [1000, 65000] 160 RW_HANDLER mission/devices/RwHandler.h
0x52a1 RWHA_InvalidRampTime Action Message with invalid ramp time was received. 161 RW_HANDLER mission/devices/RwHandler.h
0x52a2 RWHA_SetSpeedCommandInvalidLength Received set speed command has invalid length. Should be 6. 162 RW_HANDLER mission/devices/RwHandler.h
0x52a3 RWHA_ExecutionFailed Command execution failed 163 RW_HANDLER mission/devices/RwHandler.h
0x52a4 RWHA_CrcError Reaction wheel reply has invalid crc 164 RW_HANDLER mission/devices/RwHandler.h
29 0x50a0 SYRLINKS_CrcFailure 160 SYRLINKS_HANDLER mission/devices/SyrlinksHandler.h
30 0x50a1 SYRLINKS_UartFraminOrParityErrorAck 161 SYRLINKS_HANDLER mission/devices/SyrlinksHandler.h
31 0x50a2 SYRLINKS_BadCharacterAck 162 SYRLINKS_HANDLER mission/devices/SyrlinksHandler.h

View File

@@ -94,23 +94,3 @@ def add_str_cmds(defs: TmtcDefinitionWrapper):
oce.add("70", "Star Tracker: Disable timestamp generation")
oce.add("71", "Star Tracker: Enable timestamp generation")
defs.add_service(CustomServiceList.STAR_TRACKER.value, "Star Tracker", oce)
@tmtc_definitions_provider
def add_system_cmds(defs: TmtcDefinitionWrapper):
import eive_tmtc.pus_tc.system.controllers as controllers
oce = OpCodeEntry()
oce.add(
keys=controllers.OpCode.THERMAL_CONTROLLER,
info=controllers.Info.THERMAL_CONTROLLER,
)
oce.add(
keys=controllers.OpCode.CORE_CONTROLLER,
info=controllers.Info.CORE_CONTROLLER,
)
defs.add_service(
name=CustomServiceList.CONTROLLERS.value,
info="Controllers",
op_code_entry=oce,
)

View File

@@ -6,10 +6,6 @@ from typing import cast
from eive_tmtc.tmtc.power.power import pack_power_commands
from eive_tmtc.tmtc.tcs.rtd import pack_rtd_commands
from eive_tmtc.tmtc.payload.scex import pack_scex_cmds
from eive_tmtc.pus_tc.system.controllers import (
pack_cmd_ctrl_to_prompted_mode,
get_object_from_op_code,
)
from eive_tmtc.tmtc.tcs.subsystem import pack_tcs_sys_commands
from tmtccmd import DefaultProcedureInfo, TcHandlerBase
from tmtccmd.config import CoreServiceList
@@ -194,15 +190,6 @@ def handle_default_procedure(
return pack_tcs_sys_commands(q=queue_helper, op_code=op_code)
if service == CustomServiceList.RW_ASSEMBLY.value:
return pack_rw_ass_cmds(q=queue_helper, object_id=RW_ASSEMBLY, op_code=op_code)
if service == CustomServiceList.CONTROLLERS.value:
from tmtcc import TcHandler
tc_handler = cast(TcHandler, tc_base)
return pack_cmd_ctrl_to_prompted_mode(
q=queue_helper,
object_id=get_object_from_op_code(op_code),
gui=tc_handler.gui,
)
if service == CustomServiceList.SCEX.value:
return pack_scex_cmds(
ServiceProviderParams(

View File

@@ -24,6 +24,7 @@ from eive_tmtc.tmtc.power.tm import (
handle_pdu_data,
handle_p60_hk_data,
handle_acu_hk_data,
handle_pcdu_hk,
)
from eive_tmtc.tmtc.acs.imtq import (
ImtqSetId,
@@ -92,9 +93,9 @@ def handle_regular_hk_print(
set_id = hk_packet.set_id
"""This function is called when a Service 3 Housekeeping packet is received."""
if objb in [obj_ids.RW1_ID, obj_ids.RW2_ID, obj_ids.RW3_ID, obj_ids.RW4_ID]:
handle_rw_hk_data(printer, object_id, set_id, hk_data)
return handle_rw_hk_data(printer, object_id, set_id, hk_data)
elif objb == obj_ids.SYRLINKS_HANDLER_ID:
handle_syrlinks_hk_data(printer=printer, hk_data=hk_data, set_id=set_id)
return handle_syrlinks_hk_data(printer=printer, hk_data=hk_data, set_id=set_id)
elif objb == obj_ids.IMTQ_HANDLER_ID:
if (set_id >= ImtqSetId.POSITIVE_X_TEST) and (
set_id <= ImtqSetId.NEGATIVE_Z_TEST
@@ -110,8 +111,10 @@ def handle_regular_hk_print(
_LOGGER.info("Service 3 TM: IMTQ handler reply with unknown set id")
elif objb == obj_ids.GPS_CONTROLLER:
return handle_gps_data(printer=printer, hk_data=hk_data)
elif objb == obj_ids.PCDU_HANDLER_ID:
return handle_pcdu_hk(printer=printer, set_id=set_id, hk_data=hk_data)
elif objb == obj_ids.BPX_HANDLER_ID:
handle_bpx_hk_data(hk_data=hk_data, set_id=set_id, printer=printer)
return handle_bpx_hk_data(hk_data=hk_data, set_id=set_id, printer=printer)
elif objb == obj_ids.CORE_CONTROLLER_ID:
return handle_core_hk_data(printer=printer, hk_data=hk_data, set_id=set_id)
elif objb == obj_ids.PDU_1_HANDLER_ID:
@@ -144,18 +147,18 @@ def handle_regular_hk_print(
obj_ids.SUS_10_R_LOC_XMYBZF_PT_ZF,
obj_ids.SUS_11_R_LOC_XBYMZB_PT_ZB,
]:
handle_sus_hk(
return handle_sus_hk(
object_id=object_id, hk_data=hk_data, printer=printer, set_id=set_id
)
elif objb == obj_ids.P60_DOCK_HANDLER:
handle_p60_hk_data(printer=printer, set_id=set_id, hk_data=hk_data)
return handle_p60_hk_data(printer=printer, set_id=set_id, hk_data=hk_data)
elif objb in [
obj_ids.GYRO_0_ADIS_HANDLER_ID,
obj_ids.GYRO_1_L3G_HANDLER_ID,
obj_ids.GYRO_2_ADIS_HANDLER_ID,
obj_ids.GYRO_3_L3G_HANDLER_ID,
]:
handle_gyros_hk_data(
return handle_gyros_hk_data(
object_id=object_id, hk_data=hk_data, printer=printer, set_id=set_id
)
elif objb in [
@@ -164,19 +167,19 @@ def handle_regular_hk_print(
obj_ids.MGM_2_LIS3_HANDLER_ID,
obj_ids.MGM_3_RM3100_HANDLER_ID,
]:
handle_mgm_hk_data(
return handle_mgm_hk_data(
object_id=object_id, hk_data=hk_data, printer=printer, set_id=set_id
)
elif objb == obj_ids.PL_PCDU_ID:
handle_plpcdu_hk(set_id=set_id, hk_data=hk_data, printer=printer)
return handle_plpcdu_hk(set_id=set_id, hk_data=hk_data, printer=printer)
elif objb == obj_ids.THERMAL_CONTROLLER_ID:
handle_thermal_controller_hk_data(
return handle_thermal_controller_hk_data(
object_id=object_id, printer=printer, set_id=set_id, hk_data=hk_data
)
elif objb == obj_ids.PLOC_SUPV_ID:
handle_supv_hk_data(set_id=set_id, hk_data=hk_data, printer=printer)
return handle_supv_hk_data(set_id=set_id, hk_data=hk_data, printer=printer)
elif objb == obj_ids.ACS_CONTROLLER:
handle_acs_ctrl_hk_data(printer, set_id, hk_data)
return handle_acs_ctrl_hk_data(printer, set_id, hk_data)
else:
_LOGGER.info(
f"Service 3 TM: Parsing for object {object_id} and set ID {set_id} "

View File

@@ -3,3 +3,4 @@ from .solar_array_deployment import add_sa_depl_cmds
from .test import add_test_defs
from .time import add_time_cmds
from .health import add_health_cmd_defs
from .system import add_system_cmd_defs

View File

@@ -668,6 +668,7 @@ def handle_gps_data_processed(pw: PrintWrapper, hk_data: bytes):
fmt_vec, hk_data[current_idx : current_idx + inc_len_vec]
)
]
current_idx += inc_len_vec
velo = [
f"{val:8.3f}"
for val in struct.unpack(
@@ -679,7 +680,7 @@ def handle_gps_data_processed(pw: PrintWrapper, hk_data: bytes):
pw.dlog(f"GPS Longitude: {long} [rad]")
pw.dlog(f"GPS Position: {pos} [m]")
pw.dlog(f"GPS Velocity: {velo} [m/s]")
pw.printer.print_validity_buffer(hk_data[current_idx:], num_vars=3)
pw.printer.print_validity_buffer(hk_data[current_idx:], num_vars=4)
def handle_mekf_data(pw: PrintWrapper, hk_data: bytes):

View File

@@ -52,6 +52,7 @@ class GsInfo:
class PowerInfo:
INFO_CORE = "Core Information"
INFO_AUX = "Auxiliary Information"
SWITCHER_HK = "Switcher State Information"
INFO_ALL = "All Information"
REQUEST_SWITCHER_SET = "Request Switcher Information"
ENABLE_INFO_HK = "Enable Core Info HK"
@@ -102,7 +103,7 @@ class PowerOpCodes:
REBOOT = ["reboot"]
INFO_CORE = ["info"]
REQUEST_SWITCHER_SET = ["request_switchers"]
SWITCHER_HK = ["switcher_states"]
ENABLE_INFO_HK = ["info_hk_on"]
DISABLE_INFO_HK = ["info_hk_off"]
INFO_AUX = ["info_aux"]

View File

@@ -13,7 +13,6 @@ from eive_tmtc.config.object_ids import (
ACU_HANDLER_ID,
PDU_1_HANDLER_ID,
PDU_2_HANDLER_ID,
PCDU_HANDLER_ID,
get_object_ids,
)
from eive_tmtc.tmtc.power.pdu1 import (
@@ -29,10 +28,15 @@ from eive_tmtc.tmtc.power.pdu2 import (
add_pdu2_cmds,
)
from tmtccmd.config import TmtcDefinitionWrapper, OpCodeEntry
from eive_tmtc.config.object_ids import PCDU_HANDLER_ID
from eive_tmtc.tmtc.power.p60dock import P60OpCode, P60Info, p60_dock_req_hk_cmds
from eive_tmtc.tmtc.power.acu import add_acu_cmds, acu_req_hk_cmds
from tmtccmd.tc.pus_3_fsfw_hk import create_request_one_diag_command, make_sid
from tmtccmd.tc.pus_3_fsfw_hk import (
create_request_one_diag_command,
make_sid,
create_request_one_hk_command,
)
from tmtccmd.config.tmtc import tmtc_definitions_provider
from tmtccmd.tc import DefaultPusQueueHelper
@@ -41,9 +45,20 @@ class SetId(enum.IntEnum):
SWITCHER_SET = 0
class PcduSetIds:
SWITCHER_SET = 0
def pack_power_commands(q: DefaultPusQueueHelper, op_code: str):
pdu1_switch_cmds(q, op_code)
pdu2_switch_cmds(q, op_code)
if op_code in PowerOpCodes.SWITCHER_HK:
q.add_log_cmd("Requesting switcher state HK")
q.add_pus_tc(
create_request_one_diag_command(
make_sid(PCDU_HANDLER_ID, PcduSetIds.SWITCHER_SET)
)
)
if op_code in PowerOpCodes.INFO_CORE:
pdu1_req_hk_cmds(q, PowerOpCodes.REQUEST_CORE_HK_ONCE[0])
pdu2_req_hk_cmds(q, PowerOpCodes.REQUEST_CORE_HK_ONCE[0])
@@ -73,13 +88,6 @@ def pack_power_commands(q: DefaultPusQueueHelper, op_code: str):
pack_reset_gnd_wdt_cmd(q, "PDU1", oids[PDU_1_HANDLER_ID])
pack_reset_gnd_wdt_cmd(q, "PDU2", oids[PDU_2_HANDLER_ID])
q.add_wait_seconds(5.0)
elif op_code in PowerOpCodes.REQUEST_SWITCHER_SET:
q.add_log_cmd("PCDU: Requesting Switcher Set")
q.add_pus_tc(
create_request_one_diag_command(
make_sid(PCDU_HANDLER_ID, SetId.SWITCHER_SET)
)
)
if q.empty():
logging.getLogger(__name__).info(
f"Queue is empty, no stack for op code {op_code}"
@@ -105,10 +113,10 @@ def add_power_cmd_defs(defs: TmtcDefinitionWrapper):
oce = OpCodeEntry()
add_pdu1_common_defs(oce)
add_pdu2_common_defs(oce)
oce.add(keys=PowerOpCodes.SWITCHER_HK, info=PowerInfo.SWITCHER_HK)
oce.add(keys=PowerOpCodes.INFO_ALL, info=PowerInfo.INFO_ALL)
oce.add(keys=PowerOpCodes.INFO_CORE, info=PowerInfo.INFO_CORE)
oce.add(keys=PowerOpCodes.INFO_AUX, info=PowerInfo.INFO_AUX)
oce.add(keys=PowerOpCodes.REQUEST_SWITCHER_SET, info=PowerInfo.REQUEST_SWITCHER_SET)
oce.add(keys=PowerOpCodes.RESET_ALL_GND_WDTS, info=PowerInfo.RESET_ALL_GND_WDTS)
defs.add_service(
name=CustomServiceList.POWER.value,

View File

@@ -7,6 +7,7 @@ from eive_tmtc.tmtc.power.common_power import (
unpack_array_in_data,
OBC_ENDIANNESS,
)
from eive_tmtc.tmtc.power.power import PcduSetIds
from tmtccmd.util import ObjectIdBase
from tmtccmd.util.tmtc_printer import FsfwTmTcPrinter
from eive_tmtc.pus_tm.defs import PrintWrapper
@@ -554,3 +555,24 @@ def parse_name_list(data: bytes, name_len: int):
idx += len(name)
idx += 1
return ch_list
def handle_pcdu_hk(printer: FsfwTmTcPrinter, set_id: int, hk_data: bytes):
pw = PrintWrapper(printer)
pw.dlog("Received PCDU HK")
if set_id == PcduSetIds.SWITCHER_SET:
current_idx = 0
pdu1_vals = [hk_data[i] for i in range(len(PDU1_CHANNELS_NAMES))]
current_idx += len(PDU1_CHANNELS_NAMES)
pdu2_vals = [hk_data[i + current_idx] for i in range(len(PDU2_CHANNELS_NAMES))]
current_idx += len(PDU2_CHANNELS_NAMES)
p60_stack_val = hk_data[current_idx]
current_idx += 1
pw.dlog("PDU1 Switcher States")
for name, val in zip(PDU1_CHANNELS_NAMES, pdu1_vals):
pw.dlog(f"{name.ljust(25)}: {val}")
pw.dlog("PDU2 Switcher States")
for name, val in zip(PDU2_CHANNELS_NAMES, pdu2_vals):
pw.dlog(f"{name.ljust(25)}: {val}")
pw.dlog(f"{'P60 Dock 5V Stack'.ljust(25)}: {p60_stack_val}")
pw.printer.print_validity_buffer(hk_data[current_idx:], 3)

47
eive_tmtc/tmtc/system.py Normal file
View File

@@ -0,0 +1,47 @@
from eive_tmtc.config.definitions import CustomServiceList
from eive_tmtc.tmtc.acs.subsystem import AcsMode
from tmtccmd.config.tmtc import (
tmtc_definitions_provider,
TmtcDefinitionWrapper,
OpCodeEntry,
)
from tmtccmd.tc import service_provider
from eive_tmtc.config.object_ids import EIVE_SYSTEM_ID
from tmtccmd.tc.pus_200_fsfw_mode import create_mode_command, Mode
from tmtccmd.tc.decorator import ServiceProviderParams
class OpCode:
SAFE_MODE = "safe"
IDLE_MODE = "idle"
class Info:
SAFE_MODE = "Command System into Safe Mode"
IDLE_MODE = "Command System into Idle Pointing Mode"
@service_provider(CustomServiceList.SYSTEM.value)
def build_system_cmds(p: ServiceProviderParams):
o = p.op_code
q = p.queue_helper
prefix = "EIVE System"
if o == OpCode.SAFE_MODE:
q.add_log_cmd(f"{prefix}: {Info.SAFE_MODE}")
q.add_pus_tc(create_mode_command(EIVE_SYSTEM_ID, AcsMode.SAFE, 0))
elif o == OpCode.IDLE_MODE:
q.add_log_cmd(f"{prefix}: {Info.IDLE_MODE}")
q.add_pus_tc(create_mode_command(EIVE_SYSTEM_ID, AcsMode.IDLE, 0))
@tmtc_definitions_provider
def add_system_cmd_defs(defs: TmtcDefinitionWrapper):
oce = OpCodeEntry()
oce.add(keys=OpCode.SAFE_MODE, info=Info.SAFE_MODE)
oce.add(keys=OpCode.IDLE_MODE, info=Info.IDLE_MODE)
defs.add_service(
name=CustomServiceList.SYSTEM.value,
info="EIVE system commands",
op_code_entry=oce,
)
pass