Compare commits

..

118 Commits
v6.0.0 ... main

Author SHA1 Message Date
Robin Müller 9a55686a26 Merge pull request 'Some more fixes' (#298) from some-more-fixes-for-tmtccmd-bump into main
EIVE/-/pipeline/head This commit looks good Details
Reviewed-on: #298
Reviewed-by: Marius Eggert <eggertm@irs.uni-stuttgart.de>
2024-05-13 14:06:00 +02:00
Robin Müller 067a016040
another small fix
EIVE/-/pipeline/head This commit looks good Details
EIVE/-/pipeline/pr-main This commit looks good Details
2024-05-08 10:56:16 +02:00
Robin Müller dccbf89da1
some more fixes
EIVE/-/pipeline/head This commit looks good Details
2024-05-08 10:49:20 +02:00
Robin Müller 5cf76c07e9 Merge pull request 'Bump tmtccmd and fix CFDP' (#297) from bump-tmtccmd-fix-cfdp into main
EIVE/-/pipeline/head This commit looks good Details
Reviewed-on: #297
Reviewed-by: Marius Eggert <eggertm@irs.uni-stuttgart.de>
2024-05-07 14:17:40 +02:00
Robin Müller bc53f7e81a Merge remote-tracking branch 'origin/main' into bump-tmtccmd-fix-cfdp
EIVE/-/pipeline/head Build started... Details
2024-05-07 14:10:05 +02:00
Robin Müller d6b879da67 bump tmtccmd and fix CFDP code
EIVE/-/pipeline/head Build started... Details
2024-05-07 14:07:18 +02:00
Robin Müller 9a06c64dfa prep v7.0.0
EIVE/-/pipeline/head This commit looks good Details
2024-05-06 14:18:57 +02:00
Robin Müller cc7837a55b Merge pull request 'MPSoC Overhaul' (#296) from mpsoc-overhaul into main
EIVE/-/pipeline/head This commit looks good Details
Reviewed-on: #296
Reviewed-by: Marius Eggert <eggertm@irs.uni-stuttgart.de>
2024-05-06 14:18:02 +02:00
Robin Müller 9cc4fa702c renaming
EIVE/-/pipeline/pr-main Build started... Details
2024-05-06 14:10:30 +02:00
Robin Müller ada099cab1 events
EIVE/-/pipeline/pr-main This commit looks good Details
2024-05-06 13:48:22 +02:00
Robin Müller 376f94b167 update events
EIVE/-/pipeline/pr-main This commit looks good Details
2024-05-06 13:18:27 +02:00
Robin Müller 86a68e25f7 need to fix action reply handler
EIVE/-/pipeline/head This commit looks good Details
2024-05-06 11:23:31 +02:00
Robin Müller 5e1b12fa52 Merge remote-tracking branch 'origin/main' into mpsoc-overhaul
EIVE/-/pipeline/pr-main This commit looks good Details
2024-04-30 14:36:41 +02:00
Robin Müller de34952df5 less confusing cmd names 2024-04-30 14:36:11 +02:00
Marius Eggert 5da55c3c99 Merge pull request 'PLOC SUPV TM handling' (#293) from ploc-supv-tm-handling into main
EIVE/-/pipeline/head This commit looks good Details
Reviewed-on: #293
Reviewed-by: Marius Eggert <eggertm@irs.uni-stuttgart.de>
2024-04-29 11:44:20 +02:00
Marius Eggert 3b903e5639 Merge branch 'main' into ploc-supv-tm-handling
EIVE/-/pipeline/pr-main Build queued... Details
2024-04-29 11:43:14 +02:00
Marius Eggert da35c7fdf1 Merge pull request 'added missing act cmd' (#295) from gnss-improv into main
EIVE/-/pipeline/head This commit looks good Details
Reviewed-on: #295
2024-04-29 11:42:51 +02:00
Marius Eggert 8c7cbd1bd6 changelog
EIVE/-/pipeline/pr-main Build queued... Details
2024-04-29 11:41:03 +02:00
Marius Eggert ba0a3e35d2 cleanup
EIVE/-/pipeline/pr-main Build started... Details
2024-04-29 11:40:00 +02:00
Marius Eggert fc2667c150 Merge branch 'main' into gnss-improv
EIVE/-/pipeline/pr-main Build started... Details
2024-04-29 11:33:10 +02:00
Robin Müller f9041f215a how the fuck did that work the last time?
EIVE/-/pipeline/pr-main This commit looks good Details
2024-04-26 15:27:44 +02:00
Robin Müller a59aceda75 odd things happening here
EIVE/-/pipeline/pr-main This commit looks good Details
2024-04-26 14:36:02 +02:00
Robin Müller c50f8c2ce2 some fixes
EIVE/-/pipeline/pr-main This commit looks good Details
2024-04-26 13:53:39 +02:00
Robin Müller dfa45dbdba
added some commands for preparing flash
EIVE/-/pipeline/pr-main This commit looks good Details
2024-04-25 17:26:57 +02:00
Robin Müller 36d9323b57
added commands for flash formatting
EIVE/-/pipeline/pr-main This commit looks good Details
2024-04-25 12:11:18 +02:00
Robin Müller e04b5bf9d7
Merge remote-tracking branch 'origin/main' into mpsoc-overhaul
EIVE/-/pipeline/pr-main This commit looks good Details
2024-04-25 12:04:37 +02:00
Marius Eggert 3c0ac91227 Merge pull request 'CLock Events' (#291) from clock-events into main
EIVE/-/pipeline/head This commit looks good Details
Reviewed-on: #291
Reviewed-by: Marius Eggert <eggertm@irs.uni-stuttgart.de>
2024-04-17 16:43:29 +02:00
Robin Müller f61c485979 Merge branch 'main' into clock-events
EIVE/-/pipeline/pr-main This commit looks good Details
2024-04-17 16:20:09 +02:00
Robin Müller 2ebbf750bd
handling for new clock events 2024-04-17 16:19:58 +02:00
Robin Müller 847fccbe66 Merge pull request 'test script' (#294) from bestest-script into main
EIVE/-/pipeline/head This commit looks good Details
Reviewed-on: #294
Reviewed-by: Marius Eggert <eggertm@irs.uni-stuttgart.de>
2024-04-17 16:19:24 +02:00
Robin Müller c8292f4ee1 Merge branch 'main' into bestest-script
EIVE/-/pipeline/pr-main This commit looks good Details
2024-04-17 15:05:45 +02:00
Robin Müller 3700769e46 Merge remote-tracking branch 'origin/main' into ploc-supv-tm-handling
EIVE/-/pipeline/head Build queued... Details
EIVE/-/pipeline/pr-main There was a failure building this commit Details
2024-04-17 15:04:57 +02:00
Robin Müller 69fda96d7a
bump major version
EIVE/-/pipeline/head This commit looks good Details
EIVE/-/pipeline/pr-main This commit looks good Details
2024-04-17 15:02:20 +02:00
Robin Müller 0c51cad813
remove old boot verification cmd
EIVE/-/pipeline/head This commit looks good Details
2024-04-17 14:51:44 +02:00
Robin Müller 05d5955236
split up in store file and stream file
EIVE/-/pipeline/head This commit looks good Details
2024-04-17 14:43:15 +02:00
Robin Müller 18860ec2c6
tricky
EIVE/-/pipeline/head This commit looks good Details
2024-04-17 13:20:46 +02:00
Robin Müller fc5fb0eed3
add new submode commands
EIVE/-/pipeline/head This commit looks good Details
2024-04-17 13:10:13 +02:00
Robin Müller d5bb6fe6c5
re-run generators
EIVE/-/pipeline/head This commit looks good Details
2024-04-17 11:22:41 +02:00
Robin Müller 37eafb722b
this should do the job
EIVE/-/pipeline/head This commit looks good Details
2024-04-11 10:52:14 +02:00
Robin Müller 1cafdc817f
clock events
EIVE/-/pipeline/head This commit looks good Details
EIVE/-/pipeline/pr-main This commit looks good Details
2024-04-10 17:34:54 +02:00
Robin Müller 5967dede97
add new events for clock handling
EIVE/-/pipeline/head This commit looks good Details
2024-04-10 17:27:24 +02:00
Marius Eggert a8d0143b1e Merge pull request 'Prep v6.2.0' (#290) from prep-v6.2.0 into main
EIVE/-/pipeline/head This commit looks good Details
Reviewed-on: #290
2024-04-10 11:51:24 +02:00
Marius Eggert a0ad5f8948 reran gens 2024-04-10 11:50:15 +02:00
Marius Eggert 20ecef5838 linter
EIVE/-/pipeline/head Build queued... Details
2024-04-10 11:48:04 +02:00
Marius Eggert 6d97841cbf bump version
EIVE/-/pipeline/head Build queued... Details
2024-04-10 11:47:05 +02:00
Marius Eggert 512f0e4530 changelog 2024-04-10 11:46:35 +02:00
Marius Eggert e2f0221681 Merge pull request 'GNSS Fixes' (#289) from gnss-fixes into main
EIVE/-/pipeline/head This commit looks good Details
Reviewed-on: #289
Reviewed-by: Robin Müller <muellerr@irs.uni-stuttgart.de>
2024-04-10 11:34:58 +02:00
Marius Eggert e9eb45c088 Merge branch 'main' into gnss-fixes 2024-04-10 11:34:39 +02:00
Marius Eggert ea72087d87 Merge pull request 'allow setting health for payload components' (#287) from set-health-cmd-payload into main
EIVE/-/pipeline/head This commit looks good Details
Reviewed-on: #287
Reviewed-by: Marius Eggert <eggertm@irs.uni-stuttgart.de>
2024-04-10 11:34:30 +02:00
Robin Müller d48c029b85 Merge branch 'main' into gnss-fixes
EIVE/-/pipeline/pr-main Build queued... Details
2024-04-10 11:30:01 +02:00
Robin Müller b5f4f2ddab
changelog
EIVE/-/pipeline/pr-main Build started... Details
2024-04-10 11:29:19 +02:00
Robin Müller 64dd19bd12 Merge branch 'main' into set-health-cmd-payload
EIVE/-/pipeline/pr-main Build started... Details
2024-04-10 11:28:43 +02:00
Marius Eggert 102821fc71 Merge pull request 'Some PLOC commanding fixes' (#288) from ploc-tree-test into main
EIVE/-/pipeline/head This commit looks good Details
Reviewed-on: #288
Reviewed-by: Marius Eggert <eggertm@irs.uni-stuttgart.de>
2024-04-09 14:41:10 +02:00
Marius Eggert 24f3abdd5a Merge branch 'main' into ploc-tree-test 2024-04-09 14:40:36 +02:00
Marius Eggert a880db5655 changelog
EIVE/-/pipeline/pr-main This commit looks good Details
2024-04-09 14:34:23 +02:00
Marius Eggert 4e0cbb1034 Merge branch 'main' into gnss-fixes 2024-04-09 14:33:33 +02:00
Robin Müller 96636d59e9 Merge pull request 'relative timeshift' (#286) from relative-timeshift into main
EIVE/-/pipeline/head This commit looks good Details
Reviewed-on: #286
Reviewed-by: Marius Eggert <eggertm@irs.uni-stuttgart.de>
2024-04-09 14:32:28 +02:00
Robin Müller 7dfdd40963 fixed PLOC mode commanding
EIVE/-/pipeline/pr-main Build queued... Details
2024-04-09 14:31:41 +02:00
Marius Eggert 6282686f2f lets just change the tmtc structure he said. everything will still work he said
EIVE/-/pipeline/head This commit looks good Details
2024-04-09 13:29:01 +02:00
Robin Müller b160f079b1 small bugfix
EIVE/-/pipeline/head This commit looks good Details
2024-04-09 13:19:25 +02:00
Robin Müller 11d7ad0f8d start fixing PLOC tree
EIVE/-/pipeline/head This commit looks good Details
2024-04-09 11:32:57 +02:00
Robin Müller 5af69eb14e add supervisor
EIVE/-/pipeline/pr-main This commit looks good Details
2024-04-08 13:40:37 +02:00
Robin Müller 5a0edbefa8 fix comment block
EIVE/-/pipeline/pr-main This commit looks good Details
2024-04-08 13:38:28 +02:00
Robin Müller 5bdba2dbad update events
EIVE/-/pipeline/pr-main This commit looks good Details
2024-04-08 13:35:34 +02:00
Robin Müller 3ae6ccfb77 this should do the job 2024-04-08 13:35:06 +02:00
Robin Müller de84bf112b changelog
EIVE/-/pipeline/pr-main This commit looks good Details
2024-04-08 13:25:45 +02:00
Robin Müller d182a9d5ec re-run black 2024-04-08 13:24:40 +02:00
Robin Müller c72a04b262 allow setting health for payload components
EIVE/-/pipeline/head This commit looks good Details
2024-04-08 11:36:25 +02:00
Robin Müller 492d364246 relative timeshift
EIVE/-/pipeline/head This commit looks good Details
2024-04-08 11:35:05 +02:00
Robin Müller 33cf7b1613 Merge pull request 'Fix for Heater Cmd' (#284) from heater-health into main
EIVE/-/pipeline/head This commit looks good Details
Reviewed-on: #284
2024-04-02 13:28:06 +02:00
Robin Müller d8c49aed80 Merge branch 'main' into heater-health 2024-04-02 13:27:56 +02:00
Marius Eggert 97afd24e52 Merge pull request 'EPS command bugfix' (#285) from eps-bugfix into main
EIVE/-/pipeline/head This commit looks good Details
Reviewed-on: #285
Reviewed-by: Marius Eggert <eggertm@irs.uni-stuttgart.de>
2024-03-27 09:01:22 +01:00
Robin Müller 4704616ca7 changelog
EIVE/-/pipeline/head This commit looks good Details
2024-03-26 17:52:41 +01:00
Robin Müller 92c0172b59 bugfix for EPS
EIVE/-/pipeline/head This commit looks good Details
2024-03-26 17:50:37 +01:00
Robin Müller 344f16099e test script
EIVE/-/pipeline/head This commit looks good Details
2024-03-19 11:48:24 +01:00
Marius Eggert 49b55f01e3 s
EIVE/-/pipeline/head This commit looks good Details
EIVE/-/pipeline/pr-main This commit looks good Details
2024-03-18 11:11:20 +01:00
Robin Müller f87095bf68 Merge pull request 'STR Improv' (#283) from str-version into main
EIVE/-/pipeline/head This commit looks good Details
Reviewed-on: #283
Reviewed-by: Robin Müller <muellerr@irs.uni-stuttgart.de>
2024-03-14 10:55:59 +01:00
Marius Eggert 928759d1bc changelog
EIVE/-/pipeline/pr-main This commit looks good Details
2024-03-13 13:47:02 +01:00
Marius Eggert dc17919108 smoll fix
EIVE/-/pipeline/head Build started... Details
2024-03-13 13:44:15 +01:00
Marius Eggert 5f71f27f0e size check
EIVE/-/pipeline/head This commit looks good Details
2024-03-13 10:18:37 +01:00
Marius Eggert f8d63e56cb version set
EIVE/-/pipeline/head This commit looks good Details
2024-03-13 10:00:45 +01:00
Marius Eggert c843356c8a Merge pull request 'Prep v6.1.1' (#282) from prep-v6.1.1 into main
EIVE/-/pipeline/head This commit looks good Details
Reviewed-on: #282
2024-03-06 11:03:24 +01:00
Marius Eggert 49a614db10 cleanup
EIVE/-/pipeline/head Build started... Details
2024-03-06 11:02:10 +01:00
Marius Eggert c90dd92162 bump version 2024-03-06 10:59:31 +01:00
Marius Eggert bcb6a8b34e changelog 2024-03-06 10:59:09 +01:00
Marius Eggert ed15bcaf35 Merge pull request 'Leap Seconds' (#281) from leap-seconds into main
EIVE/-/pipeline/head This commit looks good Details
Reviewed-on: #281
Reviewed-by: Robin Müller <muellerr@irs.uni-stuttgart.de>
2024-03-06 10:53:57 +01:00
Marius Eggert 89202f2cfe changelog
EIVE/-/pipeline/pr-main This commit looks good Details
2024-03-06 09:51:03 +01:00
Marius Eggert 40c2a4b1f3 remove printout
EIVE/-/pipeline/head This commit looks good Details
2024-03-05 11:53:00 +01:00
Marius Eggert 811786fd78 update leap seconds act cmd
EIVE/-/pipeline/head This commit looks good Details
2024-03-05 11:43:18 +01:00
Marius Eggert baf1b44d23 added missing act cmd
EIVE/-/pipeline/head This commit looks good Details
EIVE/-/pipeline/pr-main This commit looks good Details
2024-03-01 10:20:07 +01:00
Marius Eggert 73a4260f33 Merge pull request 'Prep v6.1.0' (#280) from prep-v6.1.0 into main
EIVE/-/pipeline/head This commit looks good Details
Reviewed-on: #280
2024-02-29 13:24:27 +01:00
Marius Eggert 3358de3e3e changelog
EIVE/-/pipeline/pr-main Build queued... Details
2024-02-29 13:22:06 +01:00
Marius Eggert 211e79c83e bumped version number 2024-02-29 13:20:07 +01:00
Marius Eggert 7f10e5c777 Merge branch 'main' into prep-v6.1.0 2024-02-29 13:19:44 +01:00
Marius Eggert aab35c26c2 reran gens
EIVE/-/pipeline/pr-main Build queued... Details
2024-02-29 13:12:30 +01:00
Robin Müller 6ade001d3d Merge pull request 'New ACS Ctrl Act Cmd' (#278) from acs-ctrl-new-stuff into main
EIVE/-/pipeline/head This commit looks good Details
Reviewed-on: #278
Reviewed-by: Robin Müller <muellerr@irs.uni-stuttgart.de>
2024-02-29 12:34:50 +01:00
Robin Müller 098bdcf82b
changelog 2024-02-29 12:34:04 +01:00
Robin Müller b131415ea7 Merge branch 'main' into acs-ctrl-new-stuff 2024-02-29 12:33:44 +01:00
Marius Eggert b1dd5aa7d0 Merge pull request 'Add BlobStats TM handling STR' (#279) from add-blob-stats-str into main
EIVE/-/pipeline/head This commit looks good Details
Reviewed-on: #279
Reviewed-by: Marius Eggert <eggertm@irs.uni-stuttgart.de>
2024-02-29 12:33:31 +01:00
Robin Müller 0201eb27c4
changelog
EIVE/-/pipeline/pr-main Build queued... Details
2024-02-29 12:27:27 +01:00
Robin Müller c070f18c5d
small fix
EIVE/-/pipeline/head Build queued... Details
2024-02-29 12:26:02 +01:00
Robin Müller 00876ed0e0
tweak for HK filter feature 2024-02-29 12:09:53 +01:00
Robin Müller 68ea889d0f
added blob stats set for STR
EIVE/-/pipeline/head This commit looks good Details
2024-02-29 12:07:03 +01:00
Marius Eggert 771199e542 added new act cmd
EIVE/-/pipeline/head This commit looks good Details
EIVE/-/pipeline/pr-main This commit looks good Details
2024-02-27 16:26:06 +01:00
Marius Eggert 588d7a8079 Merge pull request 'RW commanding fix' (#277) from rw-commanding-fix into main
EIVE/-/pipeline/head Build queued... Details
Reviewed-on: #277
2024-02-26 14:03:52 +01:00
Marius Eggert 83aff8bea5 Merge branch 'main' into rw-commanding-fix 2024-02-26 14:03:22 +01:00
Marius Eggert 1d982785e6 Merge pull request 'STR secondary firmware slot commands' (#276) from str-secondary-fw-slot-update into main
EIVE/-/pipeline/head This commit looks good Details
Reviewed-on: #276
Reviewed-by: Marius Eggert <eggertm@irs.uni-stuttgart.de>
2024-02-26 14:01:34 +01:00
Robin Müller d062a22a7a delete old function
EIVE/-/pipeline/pr-main This commit looks good Details
2024-02-20 11:29:20 +01:00
Robin Müller f8c3172e7a changelog
EIVE/-/pipeline/head This commit looks good Details
2024-02-20 11:26:54 +01:00
Robin Müller 7a56c604a6 RW commanding fixes 2024-02-20 11:26:36 +01:00
Robin Müller bbde4b5b20
changelog
EIVE/-/pipeline/pr-main This commit looks good Details
2024-02-19 17:25:06 +01:00
Robin Müller 85fc106a9b
add commanding nodes
EIVE/-/pipeline/head This commit looks good Details
2024-02-19 15:58:34 +01:00
Robin Müller d35bc01397
added command to select STR slot
EIVE/-/pipeline/head This commit looks good Details
2024-02-19 15:27:27 +01:00
Robin Müller d811735b8d
add som enums
EIVE/-/pipeline/head This commit looks good Details
2024-02-19 12:20:32 +01:00
Robin Müller 265077a758
add command for second slot update
EIVE/-/pipeline/head This commit looks good Details
2024-02-19 12:17:34 +01:00
Robin Müller 1cd566a94c Merge pull request 'Fix the Errors of muellerr' (#275) from tm-store-fix into main
EIVE/-/pipeline/head This commit looks good Details
Reviewed-on: #275
Reviewed-by: Robin Müller <muellerr@irs.uni-stuttgart.de>
2024-02-12 10:40:34 +01:00
Marius Eggert 9aa891ef78 fix the errors of muellerr
EIVE/-/pipeline/head This commit looks good Details
EIVE/-/pipeline/pr-main This commit looks good Details
2024-02-09 12:06:38 +01:00
Robin Müller 342a3bbcc9 update PLOC Supversisor TM handling
EIVE/-/pipeline/head This commit looks good Details
2023-12-12 15:28:32 +01:00
48 changed files with 769 additions and 676 deletions

View File

@ -10,6 +10,53 @@ list yields a list of all related PRs for each release.
# [unreleased]
# [v7.0.0] 2024-05-06
- Reworked PLOC MPSoC commanding to be inline with OBSW update.
## Fixed
- GNSS commands working again (again).
## Added
- Added handling for new clock events.
# [v6.2.0] 2024-04-10
## Added
- Added version set for STR.
- Command for relative timeshift.
- Health commands for payload components.
## Fixed
- EPS power commands working again.
- GNSS commands working again.
## Changed
- Fixed PLOC commanding
# [v6.1.1] 2024-03-06
## Added
- Added Core Ctrl cmd to update leap seconds.
# [v6.1.0] 2024-02-29
## Added
- Added commands to unlock and use STR secondary firmware slot.
- STR BlobStats TM handling
- New ACS CTRL commands.
## Fixed
- RW commanding
# [v6.0.0] 2024-02-08
## Changed

View File

@ -62,13 +62,7 @@ class CfdpHandler:
)
def put_request(self, request: PutRequest):
if not self.remote_cfg_table.get_cfg(request.destination_id):
raise ValueError(
f"No remote CFDP config found for entity ID {request.destination_id}"
)
self.source_handler.put_request(
request, self.remote_cfg_table.get_cfg(request.destination_id) # type: ignore
)
self.source_handler.put_request(request)
def pull_next_source_packet(self) -> Optional[PduHolder]:
res = self.source_handler.state_machine()

View File

@ -3,6 +3,7 @@
@details Template configuration file. Copy this folder to the TMTC commander root and adapt
it to your needs.
"""
import enum
from tmtccmd import CcsdsTmtcBackend

View File

@ -15,6 +15,10 @@ TM_DB_PATH = "tm.db"
# Separate DB or not? Not sure..
# 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
CFDP_APID = 0x66
PUS_PACKET_ID = PacketId(PacketType.TM, True, PUS_APID)

View File

@ -75,9 +75,12 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path
7902;0x1ede;BIT_LOCK;INFO;A Bit Lock signal. Was detected. P1: raw BLO state, P2: 0;fsfw/src/fsfw/datalinklayer/DataLinkLayer.h
7903;0x1edf;BIT_LOCK_LOST;INFO;A previously found Bit Lock signal was lost. P1: raw BLO state, P2: 0;fsfw/src/fsfw/datalinklayer/DataLinkLayer.h
7905;0x1ee1;FRAME_PROCESSING_FAILED;LOW;The CCSDS Board could not interpret a TC;fsfw/src/fsfw/datalinklayer/DataLinkLayer.h
8900;0x22c4;CLOCK_SET;INFO;No description;fsfw/src/fsfw/pus/Service9TimeManagement.h
8901;0x22c5;CLOCK_DUMP;INFO;No description;fsfw/src/fsfw/pus/Service9TimeManagement.h
8902;0x22c6;CLOCK_SET_FAILURE;LOW;No description;fsfw/src/fsfw/pus/Service9TimeManagement.h
8900;0x22c4;CLOCK_SET;INFO;Clock has been set. P1: old timeval seconds. P2: new timeval seconds.;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
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
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
@ -98,6 +101,7 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path
11208;0x2bc8;TLE_TOO_OLD;INFO;The TLE for the SGP4 Propagator has become too old.;mission/acs/defs.h
11209;0x2bc9;TLE_FILE_READ_FAILED;LOW;The TLE could not be read from the filesystem.;mission/acs/defs.h
11210;0x2bca;PTG_RATE_VIOLATION;MEDIUM;The limits for the rotation in pointing mode were violated.;mission/acs/defs.h
11211;0x2bcb;DETUMBLE_TRANSITION_FAILED;HIGH;The detumble transition has failed. //! P1: Last detumble state before failure.;mission/acs/defs.h
11300;0x2c24;SWITCH_CMD_SENT;INFO;Indicates that a FSFW object requested setting a switch P1: 1 if on was requested, 0 for off | P2: Switch Index;mission/power/defs.h
11301;0x2c25;SWITCH_HAS_CHANGED;INFO;Indicated that a switch state has changed P1: New switch state, 1 for on, 0 for off | P2: Switch Index;mission/power/defs.h
11302;0x2c26;SWITCHING_Q7S_DENIED;MEDIUM;No description;mission/power/defs.h
@ -124,14 +128,15 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path
11506;0x2cf2;DEPL_SA1_GPIO_SWTICH_OFF_FAILED;HIGH;No description;mission/SolarArrayDeploymentHandler.h
11507;0x2cf3;DEPL_SA2_GPIO_SWTICH_OFF_FAILED;HIGH;No description;mission/SolarArrayDeploymentHandler.h
11508;0x2cf4;AUTONOMOUS_DEPLOYMENT_COMPLETED;INFO;No description;mission/SolarArrayDeploymentHandler.h
11601;0x2d51;MEMORY_READ_RPT_CRC_FAILURE;LOW;PLOC crc failure in telemetry packet;linux/payload/PlocMpsocHandler.h
11602;0x2d52;ACK_FAILURE;LOW;PLOC receive acknowledgment failure report P1: Command Id which leads the acknowledgment failure report P2: The status field inserted by the MPSoC into the data field;linux/payload/PlocMpsocHandler.h
11603;0x2d53;EXE_FAILURE;LOW;PLOC receive execution failure report P1: Command Id which leads the execution failure report P2: The status field inserted by the MPSoC into the data field;linux/payload/PlocMpsocHandler.h
11604;0x2d54;MPSOC_HANDLER_CRC_FAILURE;LOW;PLOC reply has invalid crc;linux/payload/PlocMpsocHandler.h
11605;0x2d55;MPSOC_HANDLER_SEQUENCE_COUNT_MISMATCH;LOW;Packet sequence count in received space packet does not match expected count P1: Expected sequence count P2: Received sequence count;linux/payload/PlocMpsocHandler.h
11606;0x2d56;MPSOC_SHUTDOWN_FAILED;HIGH;Supervisor fails to shutdown MPSoC. Requires to power off the PLOC and thus also to shutdown the supervisor.;linux/payload/PlocMpsocHandler.h
11607;0x2d57;SUPV_NOT_ON;LOW;SUPV not on for boot or shutdown process. P1: 0 for OFF transition, 1 for ON transition.;linux/payload/PlocMpsocHandler.h
11608;0x2d58;SUPV_REPLY_TIMEOUT;LOW;No description;linux/payload/PlocMpsocHandler.h
11601;0x2d51;MEMORY_READ_RPT_CRC_FAILURE;LOW;PLOC crc failure in telemetry packet;linux/payload/plocMpsocHelpers.h
11602;0x2d52;ACK_FAILURE;LOW;PLOC receive acknowledgment failure report P1: Command Id which leads the acknowledgment failure report P2: The status field inserted by the MPSoC into the data field;linux/payload/plocMpsocHelpers.h
11603;0x2d53;EXE_FAILURE;LOW;PLOC receive execution failure report P1: Command Id which leads the execution failure report P2: The status field inserted by the MPSoC into the data field;linux/payload/plocMpsocHelpers.h
11604;0x2d54;MPSOC_HANDLER_CRC_FAILURE;LOW;PLOC reply has invalid crc;linux/payload/plocMpsocHelpers.h
11605;0x2d55;MPSOC_HANDLER_SEQUENCE_COUNT_MISMATCH;LOW;Packet sequence count in received space packet does not match expected count P1: Expected sequence count P2: Received sequence count;linux/payload/plocMpsocHelpers.h
11606;0x2d56;MPSOC_SHUTDOWN_FAILED;HIGH;Supervisor fails to shutdown MPSoC. Requires to power off the PLOC and thus also to shutdown the supervisor.;linux/payload/plocMpsocHelpers.h
11607;0x2d57;SUPV_NOT_ON;LOW;SUPV not on for boot or shutdown process. P1: 0 for OFF transition, 1 for ON transition.;linux/payload/plocMpsocHelpers.h
11608;0x2d58;SUPV_REPLY_TIMEOUT;LOW;SUPV reply timeout.;linux/payload/plocMpsocHelpers.h
11609;0x2d59;CAM_MUST_BE_ON_FOR_SNAPSHOT_MODE;LOW;Camera must be commanded on first.;linux/payload/plocMpsocHelpers.h
11701;0x2db5;SELF_TEST_I2C_FAILURE;LOW;Get self test result returns I2C failure 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/acs/ImtqHandler.h
11702;0x2db6;SELF_TEST_SPI_FAILURE;LOW;Get self test result returns SPI failure. This concerns the MTM connectivity. 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/acs/ImtqHandler.h
11703;0x2db7;SELF_TEST_ADC_FAILURE;LOW;Get self test result returns failure in measurement of current and temperature. 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/acs/ImtqHandler.h
@ -232,8 +237,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
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
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
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
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;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
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

1 Event ID (dec) Event ID (hex) Name Severity Description File Path
75 7902 0x1ede BIT_LOCK INFO A Bit Lock signal. Was detected. P1: raw BLO state, P2: 0 fsfw/src/fsfw/datalinklayer/DataLinkLayer.h
76 7903 0x1edf BIT_LOCK_LOST INFO A previously found Bit Lock signal was lost. P1: raw BLO state, P2: 0 fsfw/src/fsfw/datalinklayer/DataLinkLayer.h
77 7905 0x1ee1 FRAME_PROCESSING_FAILED LOW The CCSDS Board could not interpret a TC fsfw/src/fsfw/datalinklayer/DataLinkLayer.h
78 8900 0x22c4 CLOCK_SET INFO No description Clock has been set. P1: old timeval seconds. P2: new timeval seconds. fsfw/src/fsfw/pus/Service9TimeManagement.h
79 8901 0x22c5 CLOCK_DUMP CLOCK_DUMP_LEGACY INFO No description Clock dump event. P1: timeval seconds P2: timeval milliseconds. fsfw/src/fsfw/pus/Service9TimeManagement.h
80 8902 0x22c6 CLOCK_SET_FAILURE LOW No description 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
101 11208 0x2bc8 TLE_TOO_OLD INFO The TLE for the SGP4 Propagator has become too old. mission/acs/defs.h
102 11209 0x2bc9 TLE_FILE_READ_FAILED LOW The TLE could not be read from the filesystem. mission/acs/defs.h
103 11210 0x2bca PTG_RATE_VIOLATION MEDIUM The limits for the rotation in pointing mode were violated. mission/acs/defs.h
104 11211 0x2bcb DETUMBLE_TRANSITION_FAILED HIGH The detumble transition has failed. //! P1: Last detumble state before failure. mission/acs/defs.h
105 11300 0x2c24 SWITCH_CMD_SENT INFO Indicates that a FSFW object requested setting a switch P1: 1 if on was requested, 0 for off | P2: Switch Index mission/power/defs.h
106 11301 0x2c25 SWITCH_HAS_CHANGED INFO Indicated that a switch state has changed P1: New switch state, 1 for on, 0 for off | P2: Switch Index mission/power/defs.h
107 11302 0x2c26 SWITCHING_Q7S_DENIED MEDIUM No description mission/power/defs.h
128 11506 0x2cf2 DEPL_SA1_GPIO_SWTICH_OFF_FAILED HIGH No description mission/SolarArrayDeploymentHandler.h
129 11507 0x2cf3 DEPL_SA2_GPIO_SWTICH_OFF_FAILED HIGH No description mission/SolarArrayDeploymentHandler.h
130 11508 0x2cf4 AUTONOMOUS_DEPLOYMENT_COMPLETED INFO No description mission/SolarArrayDeploymentHandler.h
131 11601 0x2d51 MEMORY_READ_RPT_CRC_FAILURE LOW PLOC crc failure in telemetry packet linux/payload/PlocMpsocHandler.h linux/payload/plocMpsocHelpers.h
132 11602 0x2d52 ACK_FAILURE LOW PLOC receive acknowledgment failure report P1: Command Id which leads the acknowledgment failure report P2: The status field inserted by the MPSoC into the data field linux/payload/PlocMpsocHandler.h linux/payload/plocMpsocHelpers.h
133 11603 0x2d53 EXE_FAILURE LOW PLOC receive execution failure report P1: Command Id which leads the execution failure report P2: The status field inserted by the MPSoC into the data field linux/payload/PlocMpsocHandler.h linux/payload/plocMpsocHelpers.h
134 11604 0x2d54 MPSOC_HANDLER_CRC_FAILURE LOW PLOC reply has invalid crc linux/payload/PlocMpsocHandler.h linux/payload/plocMpsocHelpers.h
135 11605 0x2d55 MPSOC_HANDLER_SEQUENCE_COUNT_MISMATCH LOW Packet sequence count in received space packet does not match expected count P1: Expected sequence count P2: Received sequence count linux/payload/PlocMpsocHandler.h linux/payload/plocMpsocHelpers.h
136 11606 0x2d56 MPSOC_SHUTDOWN_FAILED HIGH Supervisor fails to shutdown MPSoC. Requires to power off the PLOC and thus also to shutdown the supervisor. linux/payload/PlocMpsocHandler.h linux/payload/plocMpsocHelpers.h
137 11607 0x2d57 SUPV_NOT_ON LOW SUPV not on for boot or shutdown process. P1: 0 for OFF transition, 1 for ON transition. linux/payload/PlocMpsocHandler.h linux/payload/plocMpsocHelpers.h
138 11608 0x2d58 SUPV_REPLY_TIMEOUT LOW No description SUPV reply timeout. linux/payload/PlocMpsocHandler.h linux/payload/plocMpsocHelpers.h
139 11609 0x2d59 CAM_MUST_BE_ON_FOR_SNAPSHOT_MODE LOW Camera must be commanded on first. linux/payload/plocMpsocHelpers.h
140 11701 0x2db5 SELF_TEST_I2C_FAILURE LOW Get self test result returns I2C failure 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/acs/ImtqHandler.h
141 11702 0x2db6 SELF_TEST_SPI_FAILURE LOW Get self test result returns SPI failure. This concerns the MTM connectivity. 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/acs/ImtqHandler.h
142 11703 0x2db7 SELF_TEST_ADC_FAILURE LOW Get self test result returns failure in measurement of current and temperature. 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/acs/ImtqHandler.h
237 12902 0x3266 POWER_STATE_MACHINE_TIMEOUT MEDIUM No description mission/system/acs/SusAssembly.h
238 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
239 13000 0x32c8 CHILDREN_LOST_MODE MEDIUM No description mission/system/tcs/TcsBoardAssembly.h
240 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
241 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
242 13102 0x332e RESET_FAIL HIGH Failed to reset an GNNS Device. P1: Board-Side. linux/acs/GPSDefinitions.h
243 13200 0x3390 P60_BOOT_COUNT INFO P60 boot count is broadcasted once at SW startup. P1: Boot count mission/power/P60DockHandler.h
244 13201 0x3391 BATT_MODE INFO Battery mode is broadcasted at startup. P1: Mode mission/power/P60DockHandler.h
245 13202 0x3392 BATT_MODE_CHANGED MEDIUM Battery mode has changed. P1: Old mode. P2: New mode mission/power/P60DockHandler.h

View File

@ -3,6 +3,7 @@
@details Template configuration file. Copy this folder to the TMTC commander root and adapt
it to your needs.
"""
import logging
import os.path
from typing import Dict

View File

@ -56,6 +56,7 @@
0x44330015;PLOC_MPSOC_HANDLER
0x44330016;PLOC_SUPERVISOR_HANDLER
0x44330017;PLOC_SUPERVISOR_HELPER
0x44330018;PLOC_MPSOC_COMMUNICATION
0x44330032;SCEX
0x444100A2;SOLAR_ARRAY_DEPL_HANDLER
0x444100A4;HEATER_HANDLER

1 0x00005060 P60DOCK_TEST_TASK
56 0x44330015 PLOC_MPSOC_HANDLER
57 0x44330016 PLOC_SUPERVISOR_HANDLER
58 0x44330017 PLOC_SUPERVISOR_HELPER
59 0x44330018 PLOC_MPSOC_COMMUNICATION
60 0x44330032 SCEX
61 0x444100A2 SOLAR_ARRAY_DEPL_HANDLER
62 0x444100A4 HEATER_HANDLER

View File

@ -561,16 +561,17 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path
0x67a2;SADPL_MainSwitchTimeoutFailure;No description;162;SA_DEPL_HANDLER;mission/SolarArrayDeploymentHandler.h
0x67a3;SADPL_SwitchingDeplSa1Failed;No description;163;SA_DEPL_HANDLER;mission/SolarArrayDeploymentHandler.h
0x67a4;SADPL_SwitchingDeplSa2Failed;No description;164;SA_DEPL_HANDLER;mission/SolarArrayDeploymentHandler.h
0x68a0;MPSOCRTVIF_CrcFailure;Space Packet received from PLOC has invalid CRC;160;MPSOC_RETURN_VALUES_IF;linux/payload/mpsocRetvals.h
0x68a1;MPSOCRTVIF_ReceivedAckFailure;Received ACK failure reply from PLOC;161;MPSOC_RETURN_VALUES_IF;linux/payload/mpsocRetvals.h
0x68a2;MPSOCRTVIF_ReceivedExeFailure;Received execution failure reply from PLOC;162;MPSOC_RETURN_VALUES_IF;linux/payload/mpsocRetvals.h
0x68a3;MPSOCRTVIF_InvalidApid;Received space packet with invalid APID from PLOC;163;MPSOC_RETURN_VALUES_IF;linux/payload/mpsocRetvals.h
0x68a4;MPSOCRTVIF_InvalidLength;Received command with invalid length;164;MPSOC_RETURN_VALUES_IF;linux/payload/mpsocRetvals.h
0x68a5;MPSOCRTVIF_FilenameTooLong;Filename of file in OBC filesystem is too long;165;MPSOC_RETURN_VALUES_IF;linux/payload/mpsocRetvals.h
0x68a6;MPSOCRTVIF_MpsocHelperExecuting;MPSoC helper is currently executing a command;166;MPSOC_RETURN_VALUES_IF;linux/payload/mpsocRetvals.h
0x68a7;MPSOCRTVIF_MpsocFilenameTooLong;Filename of MPSoC file is to long (max. 256 bytes);167;MPSOC_RETURN_VALUES_IF;linux/payload/mpsocRetvals.h
0x68a8;MPSOCRTVIF_InvalidParameter;Command has invalid parameter;168;MPSOC_RETURN_VALUES_IF;linux/payload/mpsocRetvals.h
0x68a9;MPSOCRTVIF_NameTooLong;Received command has file string with invalid length;169;MPSOC_RETURN_VALUES_IF;linux/payload/mpsocRetvals.h
0x6810;MPSOCRTVIF_CommandTimeout;Command has timed out.;16;MPSOC_RETURN_VALUES_IF;linux/payload/plocMpsocHelpers.h
0x68a0;MPSOCRTVIF_CrcFailure;Space Packet received from PLOC has invalid CRC;160;MPSOC_RETURN_VALUES_IF;linux/payload/plocMpsocHelpers.h
0x68a1;MPSOCRTVIF_ReceivedAckFailure;Received ACK failure reply from PLOC;161;MPSOC_RETURN_VALUES_IF;linux/payload/plocMpsocHelpers.h
0x68a2;MPSOCRTVIF_ReceivedExeFailure;Received execution failure reply from PLOC;162;MPSOC_RETURN_VALUES_IF;linux/payload/plocMpsocHelpers.h
0x68a3;MPSOCRTVIF_InvalidApid;Received space packet with invalid APID from PLOC;163;MPSOC_RETURN_VALUES_IF;linux/payload/plocMpsocHelpers.h
0x68a4;MPSOCRTVIF_InvalidLength;Received command with invalid length;164;MPSOC_RETURN_VALUES_IF;linux/payload/plocMpsocHelpers.h
0x68a5;MPSOCRTVIF_FilenameTooLong;Filename of file in OBC filesystem is too long;165;MPSOC_RETURN_VALUES_IF;linux/payload/plocMpsocHelpers.h
0x68a6;MPSOCRTVIF_MpsocHelperExecuting;MPSoC helper is currently executing a command;166;MPSOC_RETURN_VALUES_IF;linux/payload/plocMpsocHelpers.h
0x68a7;MPSOCRTVIF_MpsocFilenameTooLong;Filename of MPSoC file is to long (max. 256 bytes);167;MPSOC_RETURN_VALUES_IF;linux/payload/plocMpsocHelpers.h
0x68a8;MPSOCRTVIF_InvalidParameter;Command has invalid parameter;168;MPSOC_RETURN_VALUES_IF;linux/payload/plocMpsocHelpers.h
0x68a9;MPSOCRTVIF_NameTooLong;Received command has file string with invalid length;169;MPSOC_RETURN_VALUES_IF;linux/payload/plocMpsocHelpers.h
0x69a0;SPVRTVIF_CrcFailure;Space Packet received from PLOC supervisor has invalid CRC;160;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h
0x69a1;SPVRTVIF_InvalidServiceId;No description;161;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h
0x69a2;SPVRTVIF_ReceivedAckFailure;Received ACK failure reply from PLOC supervisor;162;SUPV_RETURN_VALUES_IF;linux/payload/plocSupvDefs.h
@ -626,4 +627,7 @@ Full ID (hex); Name; Description; Unique ID; Subsytem Name; File Path
0x6f02;TMS_NoWriteActive;No description;2;TM_SINK;mission/tmtc/DirectTmSinkIF.h
0x6f03;TMS_Timeout;No description;3;TM_SINK;mission/tmtc/DirectTmSinkIF.h
0x7000;VCS_ChannelDoesNotExist;No description;0;VIRTUAL_CHANNEL;mission/com/VirtualChannel.h
0x7200;SCBU_KeyNotFound;No description;0;SCRATCH_BUFFER;bsp_q7s/memory/scratchApi.h
0x7100;PLMPCOM_PacketReceived;No description;0;PLOC_MPSOC_COM;linux/payload/MpsocCommunication.h
0x7101;PLMPCOM_FaultyPacketSize;No description;1;PLOC_MPSOC_COM;linux/payload/MpsocCommunication.h
0x7102;PLMPCOM_CrcCheckFailed;No description;2;PLOC_MPSOC_COM;linux/payload/MpsocCommunication.h
0x7300;SCBU_KeyNotFound;No description;0;SCRATCH_BUFFER;bsp_q7s/memory/scratchApi.h

1 Full ID (hex) Name Description Unique ID Subsytem Name File Path
561 0x67a2 SADPL_MainSwitchTimeoutFailure No description 162 SA_DEPL_HANDLER mission/SolarArrayDeploymentHandler.h
562 0x67a3 SADPL_SwitchingDeplSa1Failed No description 163 SA_DEPL_HANDLER mission/SolarArrayDeploymentHandler.h
563 0x67a4 SADPL_SwitchingDeplSa2Failed No description 164 SA_DEPL_HANDLER mission/SolarArrayDeploymentHandler.h
564 0x68a0 0x6810 MPSOCRTVIF_CrcFailure MPSOCRTVIF_CommandTimeout Space Packet received from PLOC has invalid CRC Command has timed out. 160 16 MPSOC_RETURN_VALUES_IF linux/payload/mpsocRetvals.h linux/payload/plocMpsocHelpers.h
565 0x68a1 0x68a0 MPSOCRTVIF_ReceivedAckFailure MPSOCRTVIF_CrcFailure Received ACK failure reply from PLOC Space Packet received from PLOC has invalid CRC 161 160 MPSOC_RETURN_VALUES_IF linux/payload/mpsocRetvals.h linux/payload/plocMpsocHelpers.h
566 0x68a2 0x68a1 MPSOCRTVIF_ReceivedExeFailure MPSOCRTVIF_ReceivedAckFailure Received execution failure reply from PLOC Received ACK failure reply from PLOC 162 161 MPSOC_RETURN_VALUES_IF linux/payload/mpsocRetvals.h linux/payload/plocMpsocHelpers.h
567 0x68a3 0x68a2 MPSOCRTVIF_InvalidApid MPSOCRTVIF_ReceivedExeFailure Received space packet with invalid APID from PLOC Received execution failure reply from PLOC 163 162 MPSOC_RETURN_VALUES_IF linux/payload/mpsocRetvals.h linux/payload/plocMpsocHelpers.h
568 0x68a4 0x68a3 MPSOCRTVIF_InvalidLength MPSOCRTVIF_InvalidApid Received command with invalid length Received space packet with invalid APID from PLOC 164 163 MPSOC_RETURN_VALUES_IF linux/payload/mpsocRetvals.h linux/payload/plocMpsocHelpers.h
569 0x68a5 0x68a4 MPSOCRTVIF_FilenameTooLong MPSOCRTVIF_InvalidLength Filename of file in OBC filesystem is too long Received command with invalid length 165 164 MPSOC_RETURN_VALUES_IF linux/payload/mpsocRetvals.h linux/payload/plocMpsocHelpers.h
570 0x68a6 0x68a5 MPSOCRTVIF_MpsocHelperExecuting MPSOCRTVIF_FilenameTooLong MPSoC helper is currently executing a command Filename of file in OBC filesystem is too long 166 165 MPSOC_RETURN_VALUES_IF linux/payload/mpsocRetvals.h linux/payload/plocMpsocHelpers.h
571 0x68a7 0x68a6 MPSOCRTVIF_MpsocFilenameTooLong MPSOCRTVIF_MpsocHelperExecuting Filename of MPSoC file is to long (max. 256 bytes) MPSoC helper is currently executing a command 167 166 MPSOC_RETURN_VALUES_IF linux/payload/mpsocRetvals.h linux/payload/plocMpsocHelpers.h
572 0x68a8 0x68a7 MPSOCRTVIF_InvalidParameter MPSOCRTVIF_MpsocFilenameTooLong Command has invalid parameter Filename of MPSoC file is to long (max. 256 bytes) 168 167 MPSOC_RETURN_VALUES_IF linux/payload/mpsocRetvals.h linux/payload/plocMpsocHelpers.h
573 0x68a9 0x68a8 MPSOCRTVIF_NameTooLong MPSOCRTVIF_InvalidParameter Received command has file string with invalid length Command has invalid parameter 169 168 MPSOC_RETURN_VALUES_IF linux/payload/mpsocRetvals.h linux/payload/plocMpsocHelpers.h
574 0x68a9 MPSOCRTVIF_NameTooLong Received command has file string with invalid length 169 MPSOC_RETURN_VALUES_IF linux/payload/plocMpsocHelpers.h
575 0x69a0 SPVRTVIF_CrcFailure Space Packet received from PLOC supervisor has invalid CRC 160 SUPV_RETURN_VALUES_IF linux/payload/plocSupvDefs.h
576 0x69a1 SPVRTVIF_InvalidServiceId No description 161 SUPV_RETURN_VALUES_IF linux/payload/plocSupvDefs.h
577 0x69a2 SPVRTVIF_ReceivedAckFailure Received ACK failure reply from PLOC supervisor 162 SUPV_RETURN_VALUES_IF linux/payload/plocSupvDefs.h
627 0x6f02 TMS_NoWriteActive No description 2 TM_SINK mission/tmtc/DirectTmSinkIF.h
628 0x6f03 TMS_Timeout No description 3 TM_SINK mission/tmtc/DirectTmSinkIF.h
629 0x7000 VCS_ChannelDoesNotExist No description 0 VIRTUAL_CHANNEL mission/com/VirtualChannel.h
630 0x7200 0x7100 SCBU_KeyNotFound PLMPCOM_PacketReceived No description 0 SCRATCH_BUFFER PLOC_MPSOC_COM bsp_q7s/memory/scratchApi.h linux/payload/MpsocCommunication.h
631 0x7101 PLMPCOM_FaultyPacketSize No description 1 PLOC_MPSOC_COM linux/payload/MpsocCommunication.h
632 0x7102 PLMPCOM_CrcCheckFailed No description 2 PLOC_MPSOC_COM linux/payload/MpsocCommunication.h
633 0x7300 SCBU_KeyNotFound No description 0 SCRATCH_BUFFER bsp_q7s/memory/scratchApi.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

@ -1,9 +1,10 @@
"""Hook function which packs telecommands based on service and operation code string
"""
import logging
from typing import List, cast
from tmtccmd import DefaultProcedureInfo
from tmtccmd import TreeCommandingProcedure
from tmtccmd.tmtc import DefaultPusQueueHelper
from tmtccmd.util import ObjectIdU32
@ -51,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.core import pack_core_commands
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_supervisor import pack_ploc_supv_commands
from eive_tmtc.tmtc.payload.plpcdu import pack_pl_pcdu_commands
@ -70,12 +72,13 @@ from eive_tmtc.tmtc.tcs.subsystem import pack_tcs_sys_commands
from eive_tmtc.tmtc.tcs.tmp1075 import pack_tmp1075_test_into
from eive_tmtc.tmtc.test import build_test_commands
from eive_tmtc.tmtc.time import pack_time_management_cmd
from eive_tmtc.tmtc.tm_store import pack_tm_store_commands
from eive_tmtc.tmtc.wdt import pack_wdt_commands
from eive_tmtc.utility.input_helper import InputHelper
def handle_pus_procedure(
info: DefaultProcedureInfo,
info: TreeCommandingProcedure,
queue_helper: DefaultPusQueueHelper,
):
cmd_path = info.cmd_path
@ -115,9 +118,9 @@ def handle_pus_procedure(
def handle_eps_procedure(queue_helper: DefaultPusQueueHelper, cmd_path_list: List[str]):
obj_id_man = get_object_ids()
if len(cmd_path_list) == 1:
return pack_power_commands(queue_helper, cmd_path_list[0])
assert len(cmd_path_list) >= 2
assert len(cmd_path_list) >= 1
if cmd_path_list[0] == "power":
return pack_power_commands(queue_helper, cmd_path_list[1])
if cmd_path_list[0] == "pwr_ctrl":
return pack_power_ctrl_command(queue_helper, cmd_path_list[1])
if cmd_path_list[0] == "p60_dock":
@ -197,34 +200,34 @@ def handle_acs_procedure(queue_helper: DefaultPusQueueHelper, cmd_path_list: Lis
)
if cmd_path_list[0] == "rws":
assert len(cmd_path_list) >= 3
assert len(cmd_path_list) >= 2
if cmd_path_list[1] == "rw_assy":
assert len(cmd_path_list) >= 4
assert len(cmd_path_list) >= 3
return pack_rw_ass_cmds(
q=queue_helper, object_id=RW_ASSEMBLY, cmd_str=cmd_path_list[2]
)
if cmd_path_list[1] == "rw_1":
assert len(cmd_path_list) >= 4
assert len(cmd_path_list) >= 3
return create_single_rw_cmd(
object_id=RW1_ID, rw_idx=1, q=queue_helper, cmd_str=cmd_path_list[2]
)
if cmd_path_list[1] == "rw_2":
assert len(cmd_path_list) >= 4
assert len(cmd_path_list) >= 3
return create_single_rw_cmd(
object_id=RW2_ID, rw_idx=2, q=queue_helper, cmd_str=cmd_path_list[2]
)
if cmd_path_list[1] == "rw_3":
assert len(cmd_path_list) >= 4
assert len(cmd_path_list) >= 3
return create_single_rw_cmd(
object_id=RW3_ID, rw_idx=3, q=queue_helper, cmd_str=cmd_path_list[2]
)
if cmd_path_list[1] == "rw_4":
assert len(cmd_path_list) >= 4
assert len(cmd_path_list) >= 3
return create_single_rw_cmd(
object_id=RW4_ID, rw_idx=4, q=queue_helper, cmd_str=cmd_path_list[2]
)
if cmd_path_list[0] == "gnss_devs":
if cmd_path_list[0] == "gnss_ctrl":
return pack_gps_command(
object_id=oids.GPS_CONTROLLER, q=queue_helper, cmd_str=cmd_path_list[1]
)
@ -250,7 +253,8 @@ def handle_payload_procedure(
queue_helper: DefaultPusQueueHelper, cmd_path_list: List[str]
):
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":
return pack_ploc_mpsoc_commands(queue_helper, cmd_path_list[1])
if cmd_path_list[0] == "ploc_supv":
@ -262,7 +266,6 @@ def handle_payload_procedure(
object_id=object_id, q=queue_helper, cmd_str=cmd_path_list[1]
)
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])
if cmd_path_list[0] == "scex":
return pack_scex_cmds(
@ -281,6 +284,8 @@ def handle_obdh_procedure(
return pack_wdt_commands(queue_helper, cmd_path_list[1])
if cmd_path_list[0] == "time":
return pack_time_management_cmd(queue_helper, cmd_path_list[1])
if cmd_path_list[0] == "tm_store":
return pack_tm_store_commands(queue_helper, cmd_path_list[1])
def handle_com_procedure(queue_helper: DefaultPusQueueHelper, cmd_path_list: List[str]):

View File

@ -68,8 +68,8 @@ class TcHandler(TcHandlerBase):
def feed_cb(self, info: ProcedureWrapper, wrapper: FeedWrapper):
self.queue_helper.queue_wrapper = wrapper.queue_wrapper
if info.proc_type == TcProcedureType.DEFAULT:
handle_pus_procedure(info.to_def_procedure(), self.queue_helper)
if info.proc_type == TcProcedureType.TREE_COMMANDING:
handle_pus_procedure(info.to_tree_commanding_procedure(), self.queue_helper)
elif info.proc_type == TcProcedureType.CFDP:
self.handle_cfdp_procedure(info)
@ -155,7 +155,7 @@ class TcHandler(TcHandlerBase):
def queue_finished_cb(self, info: ProcedureWrapper):
if info is not None:
if info.proc_type == TcQueueEntryType.PUS_TC:
def_proc = info.to_def_procedure()
def_proc = info.to_tree_commanding_procedure()
_LOGGER.info(f"Finished queue for command {def_proc.cmd_path}")
elif info.proc_type == TcProcedureType.CFDP:
_LOGGER.info("Finished CFDP queue")

View File

@ -1,5 +1,8 @@
import logging
import struct
from spacepackets.ecss import PusTm
from tmtccmd.pus.s8_fsfw_action_defs import CustomSubservice
from eive_tmtc.config.object_ids import (
ACU_HANDLER_ID,
PDU_1_HANDLER_ID,
@ -20,56 +23,74 @@ from eive_tmtc.tmtc.payload.ploc_supervisor import SupvActionId
from eive_tmtc.tmtc.acs.star_tracker import handle_star_tracker_action_replies
from eive_tmtc.tmtc.acs.acs_ctrl import handle_acs_ctrl_action_replies
from eive_tmtc.tmtc.power.tm import handle_get_param_data_reply
from tmtccmd.pus.s8_fsfw_action import Service8FsfwTm
from tmtccmd.fsfw.tmtc_printer import FsfwTmTcPrinter
from spacepackets.ccsds.time import CdsShortTimestamp
from tmtccmd.util import ObjectIdDictT
from tmtccmd.util import ObjectIdBase, ObjectIdDictT, ObjectIdU32
_LOGGER = logging.getLogger(__name__)
def handle_action_reply(
raw_tm: bytes, printer: FsfwTmTcPrinter, obj_id_dict: ObjectIdDictT
_LOGGER = logging.getLogger(__name__)
def handle_action_service_tm(
raw_tm: bytes, pw: PrintWrapper, obj_id_dict: ObjectIdDictT
):
"""Core Action reply handler
:return:
"""
tm_packet = Service8FsfwTm.unpack(
raw_telemetry=raw_tm, time_reader=CdsShortTimestamp.empty()
)
object_id = obj_id_dict.get(tm_packet.source_object_id_as_bytes)
pw = PrintWrapper(printer.file_logger)
custom_data = tm_packet.custom_data
action_id = tm_packet.action_id
generic_print_str = printer.generic_action_packet_tm_print(
packet=tm_packet, obj_id=object_id
)
pw.dlog(generic_print_str)
if object_id.as_bytes == IMTQ_HANDLER_ID:
return handle_imtq_replies(action_id, pw, custom_data)
elif object_id.as_bytes == PLOC_MPSOC_ID:
return handle_mpsoc_data_reply(action_id, pw, custom_data)
elif object_id.as_bytes == PLOC_SUPV_ID:
return handle_supervisor_replies(action_id, pw, custom_data)
elif object_id.as_bytes == CORE_CONTROLLER_ID:
return handle_core_ctrl_action_replies(action_id, pw, custom_data)
elif object_id.as_bytes == STAR_TRACKER_ID:
return handle_star_tracker_action_replies(action_id, pw, custom_data)
elif object_id.as_bytes == ACS_CONTROLLER:
return handle_acs_ctrl_action_replies(action_id, pw, custom_data)
elif object_id.as_bytes in [
ACU_HANDLER_ID,
PDU_1_HANDLER_ID,
PDU_2_HANDLER_ID,
P60_DOCK_HANDLER,
]:
return handle_get_param_data_reply(object_id, action_id, pw, custom_data)
tm_packet = PusTm.unpack(raw_tm, timestamp_len=CdsShortTimestamp.TIMESTAMP_SIZE)
if len(tm_packet.source_data) < 8:
_LOGGER.warning(
"received action service reply with source data smaller than 8 bytes"
)
return
object_id_raw = struct.unpack("!I", tm_packet.source_data[0:4])[0]
action_id = struct.unpack("!I", tm_packet.source_data[4:8])[0]
object_id = obj_id_dict.get(object_id_raw)
custom_data = tm_packet.source_data[8:]
if object_id is None:
object_id = ObjectIdU32(object_id_raw, "Unknown ID")
if tm_packet.subservice == CustomSubservice.TM_DATA_REPLY:
if object_id.as_bytes == IMTQ_HANDLER_ID:
return handle_imtq_replies(action_id, pw, custom_data)
elif object_id.as_bytes == PLOC_MPSOC_ID:
return handle_mpsoc_data_reply(action_id, pw, custom_data)
elif object_id.as_bytes == PLOC_SUPV_ID:
return handle_supervisor_replies(action_id, pw, custom_data)
elif object_id.as_bytes == CORE_CONTROLLER_ID:
return handle_core_ctrl_action_replies(action_id, pw, custom_data)
elif object_id.as_bytes == STAR_TRACKER_ID:
return handle_star_tracker_action_replies(action_id, pw, custom_data)
elif object_id.as_bytes == ACS_CONTROLLER:
return handle_acs_ctrl_action_replies(action_id, pw, custom_data)
elif object_id.as_bytes in [
ACU_HANDLER_ID,
PDU_1_HANDLER_ID,
PDU_2_HANDLER_ID,
P60_DOCK_HANDLER,
]:
return handle_get_param_data_reply(object_id, action_id, pw, custom_data)
else:
# TODO: Could add a handler here depending on action ID and object ID.
handle_action_data_reply(tm_packet, object_id, action_id, pw)
else:
pw.dlog(f"No dedicated action reply handler found for reply from {object_id}")
pw.dlog(f"Raw Data: {tm_packet.custom_data.hex(sep=',')}")
pw.dlog(
f"service 8 packet from {object_id} with action ID {action_id} "
f"and unknown subservice {tm_packet.subservice}"
)
def handle_imtq_replies(action_id: int, pw: PrintWrapper, custom_data: bytearray):
def handle_action_data_reply(
tm_packet: PusTm, named_obj_id: ObjectIdBase, action_id: int, printer: PrintWrapper
):
print_string = (
f"service 8 data reply from {named_obj_id} with action ID {action_id} "
f"and data size {len(tm_packet.tm_data[8:])}"
)
printer.dlog(print_string)
def handle_imtq_replies(action_id: int, pw: PrintWrapper, custom_data: bytes):
if action_id == struct.unpack("!I", ImtqActionId.get_commanded_dipole)[0]:
header_list = [
"Commanded X-Dipole",
@ -82,7 +103,7 @@ def handle_imtq_replies(action_id: int, pw: PrintWrapper, custom_data: bytearray
pw.dlog(f"{content_list}")
def handle_supervisor_replies(action_id: int, pw: PrintWrapper, custom_data: bytearray):
def handle_supervisor_replies(action_id: int, pw: PrintWrapper, custom_data: bytes):
if action_id == SupvActionId.DUMP_MRAM:
header_list = ["MRAM Dump"]
content_list = [custom_data[: len(custom_data)]]

View File

@ -1,7 +1,9 @@
import logging
import datetime
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.object_ids import get_object_ids
from eive_tmtc.pus_tm.defs import PrintWrapper
@ -21,7 +23,9 @@ _LOGGER = logging.getLogger(__name__)
def handle_event_packet( # noqa C901: Complexity okay here
raw_tm: bytes, pw: PrintWrapper
): # noqa C901: Complexity okay here
tm = Service5Tm.unpack(data=raw_tm, time_reader=CdsShortTimestamp.empty())
if PRINT_RAW_EVENTS_B64_STR:
print(f"PUS Event TM Base64: {base64.b64encode(raw_tm)}")
tm = Service5Tm.unpack(data=raw_tm, timestamp_len=CdsShortTimestamp.TIMESTAMP_SIZE)
event_dict = get_event_dict()
event_def = tm.event_definition
info = event_dict.get(event_def.event_id)
@ -36,9 +40,10 @@ def handle_event_packet( # noqa C901: Complexity okay here
obj_name = event_def.reporter_id.hex(sep=",")
else:
obj_name = obj_id_obj.name
timestamp = CdsShortTimestamp.unpack(tm.timestamp)
generic_event_string = (
f"Object {obj_name} generated Event {info.name} (ID: {event_def.event_id:#04x})"
f" at {tm.time_provider.as_date_time()}"
f" at {timestamp.as_date_time()}"
)
_LOGGER.info(generic_event_string)
pw.file_logger.info(
@ -122,12 +127,22 @@ def handle_event_packet( # noqa C901: Complexity okay here
new_time_dt = datetime.datetime.fromtimestamp(new_time, datetime.timezone.utc)
pw.dlog(f"Old time (UTC): {old_time_dt}")
pw.dlog(f"New time (UTC): {new_time_dt}")
if info.name == "CLOCK_DUMP":
if info.name == "CLOCK_DUMP_LEGACY":
specific_handler = True
# param 1 is timeval seconds, param 2 is timeval subsecond milliseconds
time = event_def.param1 + event_def.param2 / 1000.0
time_dt = datetime.datetime.fromtimestamp(time, datetime.timezone.utc)
pw.dlog(f"Current time: {time_dt}")
if (
info.name == "CLOCK_DUMP"
or info.name == "CLOCK_DUMP_BEFORE_SETTING_TIME"
or info.name == "CLOCK_DUMP_AFTER_SETTING_TIME"
):
specific_handler = True
# param 1 is timeval seconds, param 2 is timeval subsecond microseconds
time = event_def.param1 + event_def.param2 / 1000000.0
time_dt = datetime.datetime.fromtimestamp(time, datetime.timezone.utc)
pw.dlog(f"Clock dump event {info.name}. Current time: {time_dt}")
if info.name == "ACTIVE_SD_INFO":
sd_0_state = (event_def.param2 >> 16) & 0xFFFF
sd_1_state = event_def.param2 & 0xFFFF

View File

@ -2,20 +2,17 @@ import uuid
import dataclasses
import datetime
import sqlite3
from tmtccmd.pus.tm.s3_fsfw_hk import Service3FsfwTm
from spacepackets.ecss.tm import CdsShortTimestamp, PusTm
@dataclasses.dataclass
class HkTmInfo:
packet_uuid: uuid.UUID
hk_packet: Service3FsfwTm
hk_packet: PusTm
set_id: int
db_con: sqlite3.Connection
hk_data: bytes
@property
def packet_datetime(self) -> datetime.datetime:
return self.hk_packet.pus_tm.time_provider.as_datetime()
@property
def set_id(self) -> int:
return self.hk_packet.set_id
return CdsShortTimestamp.unpack(self.hk_packet.timestamp).as_datetime()

View File

@ -1,10 +1,16 @@
"""HK Handling for EIVE OBSW"""
import dataclasses
import logging
import base64 # noqa
import base64
import sqlite3
import struct
from typing import List, cast
from uuid import UUID
from spacepackets.ccsds.time import CdsShortTimestamp
from spacepackets.ecss import PusTm
from eive_tmtc.config.definitions import PRINT_RAW_HK_B64_STR
from eive_tmtc.pus_tm.hk import HkTmInfo
from eive_tmtc.tmtc.acs.acs_ctrl import handle_acs_ctrl_hk_data
@ -21,9 +27,6 @@ from eive_tmtc.tmtc.power.pwr_ctrl import handle_pwr_ctrl_hk_data
from eive_tmtc.tmtc.com.syrlinks_handler import handle_syrlinks_hk_data
from eive_tmtc.tmtc.tcs import handle_thermal_controller_hk_data
from eive_tmtc.tmtc.tcs.tmp1075 import handle_tmp_1075_hk_data
from tmtccmd.pus.tm.s3_fsfw_hk import (
Service3FsfwTm,
)
from tmtccmd.pus.tm.s3_hk_base import HkContentType
from tmtccmd.util.obj_id import ObjectIdU32, ObjectIdDictT
@ -53,7 +56,7 @@ FORWARD_SENSOR_TEMPS = False
@dataclasses.dataclass
class HkFilter:
object_ids: List[ObjectIdU32]
object_ids: List[bytes]
set_ids: List[int]
@ -66,17 +69,20 @@ def handle_hk_packet(
hk_level: int,
db_con: sqlite3.Connection,
):
tm_packet = Service3FsfwTm.unpack(raw_telemetry=raw_tm, custom_hk_handling=False)
named_obj_id = cast(ObjectIdU32, obj_id_dict.get(tm_packet.object_id.as_bytes))
tm_packet = PusTm.unpack(raw_tm, CdsShortTimestamp.TIMESTAMP_SIZE)
obj_id_raw = struct.unpack("!I", tm_packet.tm_data[0:4])[0]
named_obj_id = cast(ObjectIdU32, obj_id_dict.get(obj_id_raw))
if named_obj_id is None:
named_obj_id = tm_packet.object_id
named_obj_id = ObjectIdU32(obj_id_raw, "Unknown ID")
if tm_packet.subservice == 25 or tm_packet.subservice == 26:
set_id = struct.unpack("!I", tm_packet.tm_data[4:8])[0]
hk_data = tm_packet.tm_data[8:]
if named_obj_id in hk_filter.object_ids:
# print(f"PUS TM Base64: {base64.b64encode(raw_tm)}")
if named_obj_id.as_bytes in hk_filter.object_ids:
if PRINT_RAW_HK_B64_STR:
print(f"PUS TM Base64: {base64.b64encode(raw_tm)}")
handle_regular_hk_print(
printer=printer,
set_id=set_id,
packet_uuid=packet_uuid,
object_id=named_obj_id,
hk_packet=tm_packet,
@ -87,11 +93,12 @@ def handle_hk_packet(
try:
if hk_level >= 1:
printer.generic_hk_tm_print(
HkContentType.HK, named_obj_id, tm_packet.set_id, hk_data
HkContentType.HK, named_obj_id, set_id, hk_data
)
if hk_level >= 1:
handle_regular_hk_print(
printer=printer,
set_id=set_id,
packet_uuid=packet_uuid,
object_id=named_obj_id,
hk_packet=tm_packet,
@ -107,7 +114,8 @@ def handle_hk_packet(
def handle_regular_hk_print( # noqa C901: Complexity okay here
hk_packet: Service3FsfwTm,
hk_packet: PusTm,
set_id: int,
packet_uuid: UUID,
hk_data: bytes,
db: sqlite3.Connection,
@ -115,12 +123,15 @@ def handle_regular_hk_print( # noqa C901: Complexity okay here
printer: FsfwTmTcPrinter,
):
objb = object_id.as_bytes
set_id = hk_packet.set_id
hk_info = HkTmInfo(
packet_uuid=packet_uuid, hk_packet=hk_packet, db_con=db, hk_data=hk_data
packet_uuid=packet_uuid,
hk_packet=hk_packet,
db_con=db,
hk_data=hk_data,
set_id=set_id,
)
assert hk_packet.pus_tm.time_provider is not None
packet_dt = hk_packet.pus_tm.time_provider.as_date_time()
timestamp = CdsShortTimestamp.unpack(hk_packet.timestamp)
packet_dt = timestamp.as_datetime()
pw = PrintWrapper(printer.file_logger)
"""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]:
@ -137,7 +148,7 @@ def handle_regular_hk_print( # noqa C901: Complexity okay here
pw=pw,
set_id=set_id,
hk_data=hk_data,
packet_time=packet_dt,
packet_time=timestamp.as_datetime(),
)
elif objb == obj_ids.PCDU_HANDLER_ID:
return handle_pcdu_hk(pw=pw, set_id=set_id, hk_data=hk_data)

View File

@ -1,5 +1,6 @@
"""Core EIVE TM handler module
"""
import logging
import sqlite3
import uuid
@ -21,7 +22,7 @@ from eive_tmtc.config.definitions import TM_DB_PATH, PUS_APID
from eive_tmtc.config.object_ids import get_object_ids
from .action_reply_handler import handle_action_reply
from .action_reply_handler import handle_action_service_tm
from .defs import PrintWrapper
from .event_handler import handle_event_packet
from .hk_handler import HkFilter, handle_hk_packet
@ -62,15 +63,22 @@ class PusHandler(SpecificApidHandlerBase):
_LOGGER.warning("Detected packet shorter than 8 bytes!")
return
try:
tm_packet = PusTelemetry.unpack(packet, CdsShortTimestamp.empty())
tm_packet = PusTelemetry.unpack(packet, CdsShortTimestamp.TIMESTAMP_SIZE)
# _LOGGER.info(f"Sequence count: {tm_packet.seq_count}")
except ValueError as value_error:
_LOGGER.warning(f"{value_error}")
_LOGGER.warning("Could not generate PUS TM object from raw data")
_LOGGER.warning(f"Raw Packet: [{packet.hex(sep=',')}], REPR: {packet!r}")
return
timestamp = CdsShortTimestamp.unpack(tm_packet.timestamp)
db_con = sqlite3.connect(TM_DB_PATH)
self._store_packet_in_db(db_con, packet, tm_packet, packet_uuid)
self._store_packet_in_db(
db_con=db_con,
packet=packet,
tm_packet=tm_packet,
timestamp=timestamp,
packet_uuid=packet_uuid,
)
service = tm_packet.service
dedicated_handler = True
if service == 1:
@ -88,12 +96,12 @@ class PusHandler(SpecificApidHandlerBase):
elif service == 5:
handle_event_packet(raw_tm=packet, pw=self.pw)
elif service == 8:
handle_action_reply(
raw_tm=packet, printer=self.printer, obj_id_dict=self.obj_id_dict
handle_action_service_tm(
raw_tm=packet, pw=self.pw, obj_id_dict=self.obj_id_dict
)
elif service == 17:
pus17_tm = Service17Tm.unpack(
data=packet, time_reader=CdsShortTimestamp.empty()
data=packet, timestamp_len=CdsShortTimestamp.TIMESTAMP_SIZE
)
if pus17_tm.subservice == 2:
self.verif_wrapper.dlog("Received Ping Reply TM[17,2]")
@ -118,11 +126,11 @@ class PusHandler(SpecificApidHandlerBase):
self,
db_con: sqlite3.Connection,
packet: bytes,
timestamp: CdsShortTimestamp,
tm_packet: PusTelemetry,
packet_uuid: uuid.UUID,
):
cursor = db_con.cursor()
assert tm_packet.time_provider is not None
cursor.execute(
"""
CREATE TABLE IF NOT EXISTS pus_tm(
@ -138,7 +146,7 @@ class PusHandler(SpecificApidHandlerBase):
"INSERT INTO pus_tm VALUES(?, ?, ?, ?, ?, ?)",
(
str(packet_uuid),
tm_packet.time_provider.as_datetime(),
timestamp.as_datetime(),
tm_packet.service,
tm_packet.subservice,
len(packet),
@ -149,7 +157,7 @@ class PusHandler(SpecificApidHandlerBase):
def _handle_param_packet(self, raw_data: bytes, tm_packet: PusTelemetry):
param_packet = Service20FsfwTm.unpack(
raw_telemetry=raw_data, time_reader=CdsShortTimestamp.empty()
raw_telemetry=raw_data, timestamp_len=CdsShortTimestamp.TIMESTAMP_SIZE
)
if tm_packet.subservice == ParamSubservice.TM_DUMP_REPLY:
param_wrapper = Service20ParamDumpWrapper(param_tm=param_packet)

View File

@ -17,7 +17,7 @@ def handle_service_1_fsfw_packet(wrapper: VerificationWrapper, raw_tm: bytes):
)
# Error code with length 2 is FSFW specific
tm_packet = Service1Tm.unpack(
data=raw_tm, params=UnpackParams(CdsShortTimestamp.empty(), 1, 2)
data=raw_tm, params=UnpackParams(CdsShortTimestamp.TIMESTAMP_SIZE, 1, 2)
)
fsfw_wrapper = Service1FsfwWrapper(tm_packet)
res = wrapper.verificator.add_tm(tm_packet)

View File

@ -7,13 +7,8 @@ import struct
from socket import AF_INET
from typing import Tuple
from tmtccmd.config.tmtc import (
CmdTreeNode,
OpCodeEntry,
TmtcDefinitionWrapper,
tmtc_definitions_provider,
)
from tmtccmd.fsfw.tmtc_printer import FsfwTmTcPrinter
from tmtccmd.config.tmtc import CmdTreeNode
from tmtccmd.fsfw.tmtc_printer import get_validity_buffer_str
from tmtccmd.pus.s8_fsfw_action import create_action_cmd
from tmtccmd.pus.s20_fsfw_param import create_load_param_cmd
from tmtccmd.pus.s20_fsfw_param_defs import (
@ -37,7 +32,6 @@ from tmtccmd.pus.tc.s3_fsfw_hk import (
)
from tmtccmd.tmtc.queue import DefaultPusQueueHelper
from eive_tmtc.config.definitions import CustomServiceList
from eive_tmtc.config.object_ids import ACS_CONTROLLER
from eive_tmtc.pus_tm.defs import PrintWrapper
from eive_tmtc.tmtc.acs.defs import AcsMode, SafeSubmode
@ -72,6 +66,7 @@ class ActionId(enum.IntEnum):
RESTORE_MEKF_NONFINITE_RECOVERY = 2
UPDATE_TLE = 3
READ_TLE = 4
UPDATE_MEKF_STANDARD_DEVIATIONS = 5
CTRL_STRAT_DICT = {
@ -126,6 +121,7 @@ class OpCodes:
RESTORE_MEKF_NONFINITE_RECOVERY = "restore_mekf_nonfinite_recovery"
UPDATE_TLE = "update_tle"
READ_TLE = "read_tle"
UPDATE_MEKF_STANDARD_DEVIATIONS = "update_mekf_standard_deviations"
SET_PARAMETER_SCALAR = "set_scalar_param"
SET_PARAMETER_VECTOR = "set_vector_param"
SET_PARAMETER_MATRIX = "set_matrix_param"
@ -148,6 +144,10 @@ class Info:
RESTORE_MEKF_NONFINITE_RECOVERY = "Restore MEKF non-finite recovery"
UPDATE_TLE = "Update TLE"
READ_TLE = "Read the currently stored TLE"
UPDATE_MEKF_STANDARD_DEVIATIONS = (
"Update the Standard Deviations within the MEKF to the current ACS Parameter "
"Values"
)
SET_PARAMETER_SCALAR = "Set Scalar Parameter"
SET_PARAMETER_VECTOR = "Set Vector Parameter"
SET_PARAMETER_MATRIX = "Set Matrix Parameter"
@ -183,36 +183,6 @@ def create_acs_ctrl_node() -> CmdTreeNode:
return acs_ctrl
@tmtc_definitions_provider
def acs_cmd_defs(defs: TmtcDefinitionWrapper):
oce = OpCodeEntry()
oce.add(keys=OpCodes.OFF, info=Info.OFF)
oce.add(keys=OpCodes.SAFE, info=Info.SAFE)
oce.add(keys=OpCodes.DTBL, info=Info.DTBL)
oce.add(keys=OpCodes.IDLE, info=Info.IDLE)
oce.add(keys=OpCodes.NADIR, info=Info.NADIR)
oce.add(keys=OpCodes.TARGET, info=Info.TARGET)
oce.add(keys=OpCodes.GS, info=Info.GS)
oce.add(keys=OpCodes.INERTIAL, info=Info.INERTIAL)
oce.add(keys=OpCodes.SAFE_PTG, info=Info.SAFE_PTG)
oce.add(keys=OpCodes.RESET_MEKF, info=Info.RESET_MEKF)
oce.add(
keys=OpCodes.RESTORE_MEKF_NONFINITE_RECOVERY,
info=Info.RESTORE_MEKF_NONFINITE_RECOVERY,
)
oce.add(keys=OpCodes.UPDATE_TLE, info=Info.UPDATE_TLE)
oce.add(keys=OpCodes.READ_TLE, info=Info.READ_TLE)
oce.add(keys=OpCodes.SET_PARAMETER_SCALAR, info=Info.SET_PARAMETER_SCALAR)
oce.add(keys=OpCodes.SET_PARAMETER_VECTOR, info=Info.SET_PARAMETER_VECTOR)
oce.add(keys=OpCodes.SET_PARAMETER_MATRIX, info=Info.SET_PARAMETER_MATRIX)
oce.add(keys=OpCodes.ONE_SHOOT_HK, info=Info.ONE_SHOOT_HK)
oce.add(keys=OpCodes.ENABLE_HK, info=Info.ENABLE_HK)
oce.add(keys=OpCodes.DISABLE_HK, info=Info.DISABLE_HK)
defs.add_service(
name=CustomServiceList.ACS_CTRL.value, info="ACS Controller", op_code_entry=oce
)
def pack_acs_ctrl_command(q: DefaultPusQueueHelper, cmd_str: str): # noqa C901
if cmd_str in OpCodes.OFF:
q.add_log_cmd(f"{Info.OFF}")
@ -273,18 +243,14 @@ def pack_acs_ctrl_command(q: DefaultPusQueueHelper, cmd_str: str): # noqa C901
print("The line does not have the required length of 69 characters")
tle = line1.encode() + line2.encode()
q.add_pus_tc(create_action_cmd(ACS_CONTROLLER, ActionId.UPDATE_TLE, tle))
elif cmd_str in OpCodes.SET_PARAMETER_SCALAR:
q.add_log_cmd(f"{Info.SET_PARAMETER_SCALAR}")
set_acs_ctrl_param_scalar(q)
elif cmd_str in OpCodes.SET_PARAMETER_VECTOR:
q.add_log_cmd(f"{Info.SET_PARAMETER_VECTOR}")
set_acs_ctrl_param_vector(q)
elif cmd_str in OpCodes.SET_PARAMETER_MATRIX:
q.add_log_cmd(f"{Info.SET_PARAMETER_MATRIX}")
set_acs_ctrl_param_matrix(q)
elif cmd_str == OpCodes.READ_TLE:
q.add_log_cmd(f"{Info.READ_TLE}")
q.add_pus_tc(create_action_cmd(ACS_CONTROLLER, ActionId.READ_TLE))
elif cmd_str == OpCodes.UPDATE_MEKF_STANDARD_DEVIATIONS:
q.add_log_cmd(f"{Info.UPDATE_MEKF_STANDARD_DEVIATIONS}")
q.add_pus_tc(
create_action_cmd(ACS_CONTROLLER, ActionId.UPDATE_MEKF_STANDARD_DEVIATIONS)
)
elif cmd_str == OpCodes.SET_PARAMETER_SCALAR:
q.add_log_cmd(f"{Info.SET_PARAMETER_SCALAR}")
set_acs_ctrl_param_scalar(q)
@ -591,7 +557,7 @@ def handle_acs_ctrl_sus_raw_data(pw: PrintWrapper, hk_data: bytes):
sus_list_formatted = vec_fmt.format(*sus_list)
current_idx += length
pw.dlog(f"SUS {idx} RAW: {sus_list_formatted}")
pw.dlog(FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=12))
pw.dlog(get_validity_buffer_str(hk_data[current_idx:], num_vars=12))
def handle_acs_ctrl_sus_processed_data(pw: PrintWrapper, hk_data: bytes):
@ -627,7 +593,7 @@ def handle_acs_ctrl_sus_processed_data(pw: PrintWrapper, hk_data: bytes):
sun_ijk_model = vec_fmt.format(*sun_ijk_model)
current_idx += inc_len
pw.dlog(f"{'SUS ijk Model'.ljust(25)}: {sun_ijk_model}")
pw.dlog(FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=15))
pw.dlog(get_validity_buffer_str(hk_data[current_idx:], num_vars=15))
def handle_raw_mgm_data(pw: PrintWrapper, hk_data: bytes):
@ -683,7 +649,7 @@ def handle_raw_mgm_data(pw: PrintWrapper, hk_data: bytes):
pw.dlog(f"{entry[0].ljust(28)}: {entry[1]}")
current_idx += 1
assert current_idx == 61
pw.dlog(FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=6))
pw.dlog(get_validity_buffer_str(hk_data[current_idx:], num_vars=6))
def handle_mgm_data_processed(pw: PrintWrapper, hk_data: bytes):
@ -737,7 +703,7 @@ def handle_mgm_data_processed(pw: PrintWrapper, hk_data: bytes):
current_idx += inc_len
if PERFORM_MGM_CALIBRATION:
perform_mgm_calibration(pw, mgm_3)
pw.dlog(FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=8))
pw.dlog(get_validity_buffer_str(hk_data[current_idx:], num_vars=8))
def handle_gyr_data_raw(pw: PrintWrapper, hk_data: bytes):
@ -771,7 +737,7 @@ def handle_gyr_data_raw(pw: PrintWrapper, hk_data: bytes):
pw.dlog(f"{'GYR 1 L3'.ljust(15)}: {float_str_fmt.format(*gyr_1_l3)}")
pw.dlog(f"{'GYR 2 ADIS'.ljust(15)}: {float_str_fmt.format(*gyr_2_adis)}")
pw.dlog(f"{'GYR 3 L3'.ljust(15)}: {float_str_fmt.format(*gyr_3_l3)}")
pw.dlog(FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], 4))
pw.dlog(get_validity_buffer_str(hk_data[current_idx:], 4))
GYR_NAMES = ["GYR 0 ADIS", "GYR 1 L3", "GYR 2 ADIS", "GYR 3 L3"]
@ -797,7 +763,7 @@ def handle_gyr_data_processed(pw: PrintWrapper, hk_data: bytes):
]
pw.dlog(f"GYR Vec Total: {gyr_vec_tot}")
current_idx += inc_len
pw.dlog(FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=5))
pw.dlog(get_validity_buffer_str(hk_data[current_idx:], num_vars=5))
def handle_gps_data_processed(pw: PrintWrapper, hk_data: bytes):
@ -860,7 +826,7 @@ def handle_gps_data_processed(pw: PrintWrapper, hk_data: bytes):
pw.dlog(f"GPS Altitude: {alt} [m]")
pw.dlog(f"GPS Position: {pos} [m]")
pw.dlog(f"GPS Velocity: {velo} [m/s]")
pw.dlog(FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=6))
pw.dlog(get_validity_buffer_str(hk_data[current_idx:], num_vars=6))
def handle_attitude_estimation_data(pw: PrintWrapper, hk_data: bytes):
@ -915,9 +881,9 @@ def handle_attitude_estimation_data(pw: PrintWrapper, hk_data: bytes):
)
current_idx += inc_len_quat
pw.dlog(f"{'QUEST Quaternion'.ljust(25)}: {fmt_str_4.format(*quest_quat)}")
pw.dlog(FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=4))
pw.dlog(get_validity_buffer_str(hk_data[current_idx:], num_vars=4))
return
pw.dlog(FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=3))
pw.dlog(get_validity_buffer_str(hk_data[current_idx:], num_vars=3))
def handle_ctrl_val_data(pw: PrintWrapper, hk_data: bytes):
@ -974,7 +940,7 @@ def handle_ctrl_val_data(pw: PrintWrapper, hk_data: bytes):
pw.dlog(f"Control Values Error Quaternion: {err_quat}")
pw.dlog(f"Control Values Error Angle: {err_ang} [deg]")
pw.dlog(f"Control Values Target Rotational Rate: {tgt_rot} [deg/s]")
pw.dlog(FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=5))
pw.dlog(get_validity_buffer_str(hk_data[current_idx:], num_vars=5))
def handle_act_cmd_data(pw: PrintWrapper, hk_data: bytes):
@ -1013,7 +979,7 @@ def handle_act_cmd_data(pw: PrintWrapper, hk_data: bytes):
pw.dlog(f"Actuator Commands RW Target Torque: {rw_tgt_torque}")
pw.dlog(f"Actuator Commands RW Target Speed: {rw_tgt_speed}")
pw.dlog(f"Actuator Commands MTQ Target Dipole: {mtq_tgt_dipole}")
pw.dlog(FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=3))
pw.dlog(get_validity_buffer_str(hk_data[current_idx:], num_vars=3))
def handle_fused_rot_rate_data(pw: PrintWrapper, hk_data: bytes):
@ -1064,9 +1030,9 @@ def handle_fused_rot_rate_data(pw: PrintWrapper, hk_data: bytes):
)
else:
pw.dlog(f"Ctrl Strategy (key unknown): {rot_rate_source}")
pw.dlog(FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=4))
pw.dlog(get_validity_buffer_str(hk_data[current_idx:], num_vars=4))
return
pw.dlog(FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=3))
pw.dlog(get_validity_buffer_str(hk_data[current_idx:], num_vars=3))
def handle_fused_rot_rate_source_data(pw: PrintWrapper, hk_data: bytes):
@ -1121,7 +1087,7 @@ def handle_fused_rot_rate_source_data(pw: PrintWrapper, hk_data: bytes):
pw.dlog(f"Fused Rotational Rate Total SUSMGM: {rot_rate_total_susmgm} [deg/s]")
pw.dlog(f"Fused Rotational Rate Total QUEST: {rot_rate_total_quest} [deg/s]")
pw.dlog(f"Fused Rotational Rate Total STR: {rot_rate_total_str} [deg/s]")
pw.dlog(FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=5))
pw.dlog(get_validity_buffer_str(hk_data[current_idx:], num_vars=5))
def handle_acs_ctrl_action_replies(

View File

@ -3,10 +3,8 @@ import enum
import logging
import struct
from eive_tmtc.config.definitions import CustomServiceList
from eive_tmtc.pus_tm.defs import PrintWrapper
from tmtccmd.config import CmdTreeNode, TmtcDefinitionWrapper, OpCodeEntry
from tmtccmd.config.tmtc import tmtc_definitions_provider
from tmtccmd.config import CmdTreeNode
from tmtccmd.pus.s200_fsfw_mode import create_mode_command, Mode
from tmtccmd.tmtc import DefaultPusQueueHelper
from tmtccmd.pus.tc.s3_fsfw_hk import (
@ -15,7 +13,8 @@ from tmtccmd.pus.tc.s3_fsfw_hk import (
create_enable_periodic_hk_command_with_interval_with_diag,
create_disable_periodic_hk_command_with_diag,
)
from tmtccmd.fsfw.tmtc_printer import FsfwTmTcPrinter
from tmtccmd.pus.tc.s8_fsfw_action import create_action_cmd
from tmtccmd.fsfw.tmtc_printer import get_validity_buffer_str
_LOGGER = logging.getLogger(__name__)
@ -24,6 +23,15 @@ class GpsInfo:
MAX_SATELLITES = 30
class ActIds:
RESET_GNSS = 5
class AcsBoardSides(enum.IntEnum):
A_SIDE = 0
B_SIDE = 1
class OpCode:
OFF = "off"
ON = "on"
@ -33,7 +41,7 @@ class OpCode:
REQ_SKYVIEW_HK = "skyview_hk_request"
ENABLE_SKYVIEW_HK = "skyview_hk_enable"
DISABLE_SKYVIEW_HK = "skyview_hk_disable"
RESET_GNSS = "reset"
RESET_GNSS = "reset_gnss"
class Info:
@ -59,37 +67,27 @@ def create_gnss_node() -> CmdTreeNode:
]
info_strs = [getattr(Info, key) for key in dir(OpCode) if not key.startswith("__")]
combined_dict = dict(zip(op_code_strs, info_strs))
node = CmdTreeNode("gnss", "GNSS device", hide_children_for_print=True)
node = CmdTreeNode("gnss_ctrl", "GNSS Ctrl", hide_children_for_print=True)
for op_code, info in combined_dict.items():
node.add_child(CmdTreeNode(op_code, info))
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
object_id: bytes, q: DefaultPusQueueHelper, cmd_str: str
): # noqa: C901:
if cmd_str == OpCode.RESET_GNSS:
# TODO: This needs to be re-implemented
_LOGGER.warning("Reset pin handling needs to be re-implemented")
for val in AcsBoardSides:
print("{:<2}: {:<20}".format(val, val.name))
board_side = int(input("Select Board Side \n" ""))
q.add_log_cmd(f"GPS: {Info.RESET_GNSS}")
q.add_pus_tc(
create_action_cmd(
object_id=object_id,
action_id=ActIds.RESET_GNSS,
user_data=bytearray([board_side]),
)
)
if cmd_str == OpCode.ENABLE_CORE_HK:
interval = float(input("Please specify interval in floating point seconds: "))
if interval <= 0:
@ -205,9 +203,7 @@ def handle_core_data(pw: PrintWrapper, hk_data: bytes):
)
pw.dlog(f"GNSS Date: {date_string}")
pw.dlog(f"Unix seconds {unix_seconds}")
FsfwTmTcPrinter.get_validity_buffer(
validity_buffer=hk_data[current_idx:], num_vars=14
)
pw.dlog(get_validity_buffer_str(validity_buffer=hk_data[current_idx:], num_vars=14))
def handle_skyview_data(pw: PrintWrapper, hk_data: bytes):
@ -267,6 +263,4 @@ def handle_skyview_data(pw: PrintWrapper, hk_data: bytes):
used[idx],
)
)
FsfwTmTcPrinter.get_validity_buffer(
validity_buffer=hk_data[current_idx:], num_vars=6
)
pw.dlog(get_validity_buffer_str(validity_buffer=hk_data[current_idx:], num_vars=6))

View File

@ -31,7 +31,7 @@ from tmtccmd.pus.tc.s3_fsfw_hk import (
)
from tmtccmd.pus.s200_fsfw_mode import pack_mode_data, Mode
from tmtccmd.util import ObjectIdU32
from tmtccmd.fsfw.tmtc_printer import FsfwTmTcPrinter
from tmtccmd.fsfw.tmtc_printer import get_validity_buffer_str
_LOGGER = logging.getLogger(__name__)
@ -543,7 +543,7 @@ def handle_dipole_set(pw: PrintWrapper, hk_data: bytes):
pw.dlog(f"Dipole Y: {dipole_y}")
pw.dlog(f"Dipole Z: {dipole_z}")
pw.dlog(f"Current torque duration: {current_torque_duration}")
FsfwTmTcPrinter.get_validity_buffer(hk_data[fmt_len:], 2)
pw.dlog(get_validity_buffer_str(hk_data[fmt_len:], 2))
def unpack_eng_hk(hk_data: bytes) -> List:
@ -583,9 +583,7 @@ def handle_eng_set(pw: PrintWrapper, hk_data: bytes, torque_on: bool):
for k, v in zip(ENG_HK_HEADERS, content_list):
pw.dlog(f"{k.ljust(30)}: {v}")
pw.dlog(
FsfwTmTcPrinter.get_validity_buffer(
validity_buffer=validity_buffer, num_vars=num_of_vars
)
get_validity_buffer_str(validity_buffer=validity_buffer, num_vars=num_of_vars)
)
@ -597,9 +595,7 @@ def handle_status_set(pw: PrintWrapper, hk_data: bytes):
for k, v in zip(STATUS_HEADERS, content_list):
pw.dlog(f"{k.ljust(30)}: {v}")
pw.dlog(
FsfwTmTcPrinter.get_validity_buffer(
validity_buffer=validity_buffer, num_vars=num_of_vars
)
get_validity_buffer_str(validity_buffer=validity_buffer, num_vars=num_of_vars)
)
@ -620,9 +616,7 @@ def handle_calibrated_mtm_measurement(pw: PrintWrapper, hk_data: bytes):
pw.dlog(str(header_list))
pw.dlog(str(content_list))
pw.dlog(
FsfwTmTcPrinter.get_validity_buffer(
validity_buffer=validity_buffer, num_vars=num_of_vars
)
get_validity_buffer_str(validity_buffer=validity_buffer, num_vars=num_of_vars)
)
@ -644,9 +638,7 @@ def handle_raw_mtm_measurement(pw: PrintWrapper, hk_data: bytes, torque_status:
pw.dlog(str(header_list))
pw.dlog(str(content_list))
pw.dlog(
FsfwTmTcPrinter.get_validity_buffer(
validity_buffer=validity_buffer, num_vars=num_of_vars
)
get_validity_buffer_str(validity_buffer=validity_buffer, num_vars=num_of_vars)
)
@ -783,7 +775,5 @@ def handle_self_test_data(pw: PrintWrapper, hk_data: bytes):
pw.dlog(str(header_list))
pw.dlog(str(content_list))
pw.dlog(
FsfwTmTcPrinter.get_validity_buffer(
validity_buffer=validity_buffer, num_vars=num_of_vars
)
get_validity_buffer_str(validity_buffer=validity_buffer, num_vars=num_of_vars)
)

View File

@ -6,12 +6,11 @@
"""
import enum
import struct
from typing import List
from typing import List, Tuple
from eive_tmtc.pus_tm.defs import PrintWrapper
from eive_tmtc.config.object_ids import RW1_ID, RW2_ID, RW3_ID, RW4_ID
from tmtccmd.config import CmdTreeNode, TmtcDefinitionWrapper, OpCodeEntry
from tmtccmd.config.tmtc import tmtc_definitions_provider
from tmtccmd.config import CmdTreeNode
from tmtccmd.tmtc import DefaultPusQueueHelper
from tmtccmd.pus.tc.s3_fsfw_hk import (
generate_one_hk_command,
@ -23,9 +22,8 @@ from tmtccmd.pus.tc.s3_fsfw_hk import (
from tmtccmd.pus.s8_fsfw_action import create_action_cmd
from spacepackets.ecss.tc import PusTelecommand
from tmtccmd.pus.s200_fsfw_mode import pack_mode_data, Mode, Subservice
from eive_tmtc.config.definitions import CustomServiceList
from tmtccmd.util import ObjectIdU32
from tmtccmd.fsfw.tmtc_printer import FsfwTmTcPrinter
from tmtccmd.fsfw.tmtc_printer import get_validity_buffer_str
class OpCodesDev:
@ -126,59 +124,14 @@ def create_reaction_wheel_assembly_node() -> CmdTreeNode:
node = CmdTreeNode(
"rw_assy", "Reaction Wheels Assembly", hide_children_which_are_leaves=True
)
node.add_child(CmdTreeNode(InfoAss.ON, OpCodesAss.ON))
node.add_child(CmdTreeNode(InfoAss.NML, OpCodesAss.NML))
node.add_child(CmdTreeNode(InfoAss.OFF, OpCodesAss.OFF))
node.add_child(CmdTreeNode(InfoAss.ALL_SPEED_UP, OpCodesAss.ALL_SPEED_UP))
node.add_child(CmdTreeNode(InfoAss.ALL_SPEED_OFF, OpCodesAss.ALL_SPEED_OFF))
node.add_child(CmdTreeNode(OpCodesAss.ON, InfoAss.ON))
node.add_child(CmdTreeNode(OpCodesAss.NML, InfoAss.NML))
node.add_child(CmdTreeNode(OpCodesAss.OFF, InfoAss.OFF))
node.add_child(CmdTreeNode(OpCodesAss.ALL_SPEED_UP, InfoAss.ALL_SPEED_UP))
node.add_child(CmdTreeNode(OpCodesAss.ALL_SPEED_OFF, InfoAss.ALL_SPEED_OFF))
return node
@tmtc_definitions_provider
def add_rw_cmds(defs: TmtcDefinitionWrapper):
oce = OpCodeEntry()
oce.add(info=InfoDev.SPEED, keys=OpCodesDev.SPEED)
oce.add(info=InfoDev.ON, keys=OpCodesDev.ON)
oce.add(info=InfoDev.OFF, keys=OpCodesDev.OFF)
oce.add(info=InfoDev.NML, keys=OpCodesDev.NML)
oce.add(info=InfoDev.REQ_TM, keys=OpCodesDev.REQ_TM)
oce.add(info=InfoDev.GET_STATUS, keys=OpCodesDev.GET_STATUS)
oce.add(info=InfoDev.GET_TM, keys=OpCodesDev.GET_TM)
oce.add(info=InfoDev.ENABLE_STATUS_HK, keys=OpCodesDev.ENABLE_STATUS_HK)
oce.add(info=InfoDev.DISABLE_STATUS_HK, keys=OpCodesDev.DISABLE_STATUS_HK)
defs.add_service(
name=CustomServiceList.REACTION_WHEEL_1.value,
info="Reaction Wheel 1",
op_code_entry=oce,
)
defs.add_service(
name=CustomServiceList.REACTION_WHEEL_2.value,
info="Reaction Wheel 2",
op_code_entry=oce,
)
defs.add_service(
name=CustomServiceList.REACTION_WHEEL_3.value,
info="Reaction Wheel 3",
op_code_entry=oce,
)
defs.add_service(
name=CustomServiceList.REACTION_WHEEL_4.value,
info="Reaction Wheel 4",
op_code_entry=oce,
)
oce = OpCodeEntry()
oce.add(info=InfoAss.ON, keys=OpCodesAss.ON)
oce.add(info=InfoAss.NML, keys=OpCodesAss.NML)
oce.add(info=InfoAss.OFF, keys=OpCodesAss.OFF)
oce.add(info=InfoAss.ALL_SPEED_UP, keys=OpCodesAss.ALL_SPEED_UP)
oce.add(info=InfoAss.ALL_SPEED_OFF, keys=OpCodesAss.ALL_SPEED_OFF)
defs.add_service(
name=CustomServiceList.RW_ASSEMBLY.value,
info="Reaction Wheel Assembly",
op_code_entry=oce,
)
def create_single_rw_cmd( # noqa C901: Complexity is okay here.
object_id: bytes, rw_idx: int, q: DefaultPusQueueHelper, cmd_str: str
):
@ -272,7 +225,7 @@ def pack_rw_ass_cmds(q: DefaultPusQueueHelper, object_id: bytes, cmd_str: str):
)
def prompt_speed_ramp_time() -> (int, int):
def prompt_speed_ramp_time() -> Tuple[int, int]:
speed = int(
input("Specify speed [0.1 RPM, 0 or range [-65000, -1000] and [1000, 65000]: ")
)
@ -348,7 +301,7 @@ def handle_rw_hk_data(
f"Current Limit Control mode {clc_mode}. 0: Low Current Mode (0.3 A), "
"1: High Current Mode (0.6 A)"
)
pw.dlog(FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], 5))
pw.dlog(get_validity_buffer_str(hk_data[current_idx:], 5))
if set_id == RwSetId.LAST_RESET:
pw.dlog(
f"Received Last Reset HK (ID {set_id}) from Reaction Wheel {object_id.name}"
@ -437,7 +390,7 @@ def handle_rw_hk_data(
)
if current_idx > 0:
pw.dlog(
FsfwTmTcPrinter.get_validity_buffer(
get_validity_buffer_str(
validity_buffer=hk_data[current_idx:], num_vars=27
)
)

View File

@ -9,13 +9,12 @@ import datetime
import enum
import logging
import struct
from typing import List, Tuple
from eive_tmtc.config.definitions import CustomServiceList
from eive_tmtc.pus_tm.defs import PrintWrapper
from eive_tmtc.utility.input_helper import InputHelper
from spacepackets.ecss.tc import PusTelecommand
from tmtccmd.config import CmdTreeNode, TmtcDefinitionWrapper, OpCodeEntry
from tmtccmd.config.tmtc import tmtc_definitions_provider
from tmtccmd.config import CmdTreeNode
from tmtccmd.pus.tc.s3_fsfw_hk import (
create_request_one_diag_command,
create_request_one_hk_command,
@ -23,16 +22,27 @@ from tmtccmd.pus.tc.s3_fsfw_hk import (
disable_periodic_hk_command,
make_sid,
)
from tmtccmd.pus.s20_fsfw_param import create_load_param_cmd, create_scalar_u8_parameter
from tmtccmd.pus.s8_fsfw_action import create_action_cmd
from tmtccmd.tmtc import DefaultPusQueueHelper
from tmtccmd.pus.s200_fsfw_mode import pack_mode_data, Mode
from tmtccmd.util import ObjectIdU32
from tmtccmd.fsfw.tmtc_printer import FsfwTmTcPrinter
from tmtccmd.fsfw.tmtc_printer import get_validity_buffer_str
from eive_tmtc.config.object_ids import STR_ASSEMBLY, STAR_TRACKER_ID
_LOGGER = logging.getLogger(__name__)
class FirmwareTarget(enum.IntEnum):
MAIN = 1
BACKUP = 10
class ParamId(enum.IntEnum):
FIRMWARE_TARGET = 1
FIRMWARE_TARGET_PERSISTENT = 2
class StarTrackerActionId(enum.IntEnum):
PING = 0
BOOT = 1
@ -95,7 +105,10 @@ class StarTrackerActionId(enum.IntEnum):
LOGLEVEL = 81
LOG_SUBSCRIPTION = 82
DEBUG_CAMERA = 83
# Legacy variable.
FIRMWARE_UPDATE = 84
FIRMWARE_UPDATE_MAIN = 84
FIRMWARE_UPDATE_BACKUP = 101
SET_TIME_FROM_SYS_TIME = 87
ADD_SECONDARY_TM_TO_NORMAL_MODE = 95
RESET_SECONDARY_TM_SET = 96
@ -119,12 +132,23 @@ class OpCode:
UPLOAD_IMAGE = "upload_image"
DOWNLOAD_IMAGE = "download_image"
SET_IMG_PROCESSOR_MODE = "set_img_proc_mode"
FW_UPDATE = "fw_update"
FW_UPDATE_MAIN = "fw_update_main"
SET_TIME_FROM_SYS_TIME = "set_time"
RELOAD_JSON_CFG_FILE = "reload_json_cfg"
FW_UPDATE_BACKUP = "fw_update_backup"
SELECT_TARGET_FIRMWARE_MAIN = "fw_main"
SELECT_TARGET_FIRMWARE_BACKUP = "fw_backup"
SELECT_TARGET_FIRMWARE_MAIN_PERSISTENT = "fw_main_persistent"
SELECT_TARGET_FIRMWARE_BACKUP_PERSISTENT = "fw_backup_persistent"
REQUEST_VERSION = "request_version"
class Info:
ON_BOOTLOADER = "Switch to Mode On, Submode Bootloder"
ON_FIRMWARE = "Switch to Mode On, Submode Firmware"
NORMAL = "Switch to Mode Normal"
OFF = "Switch to Mode Off"
PING = "Send Ping"
ONE_SHOOT_HK = "One shoot HK Set"
ENABLE_HK = "Enable Periodic HK"
DISABLE_HK = "Disable Periodic HK"
@ -135,9 +159,17 @@ class Info:
DOWNLOAD_IMAGE = "Download Optical Image"
TAKE_IMAGE = "Take Image"
SET_IMG_PROCESSOR_MODE = "Set Image Processor Mode"
FW_UPDATE = "Firmware Update"
FW_UPDATE_MAIN = "Update Main Firmware Slot"
FW_UPDATE_BACKUP = "Update Backup Firmware Slot"
SET_TIME_FROM_SYS_TIME = "Set time from system time"
RELOAD_JSON_CFG_FILE = "Reload JSON configuration file. Reboot still required."
SELECT_TARGET_FIRMWARE_MAIN = "Select main firmware slot"
SELECT_TARGET_FIRMWARE_BACKUP = "Select backup firmware slot"
SELECT_TARGET_FIRMWARE_MAIN_PERSISTENT = "Select main firmware slot persistently"
SELECT_TARGET_FIRMWARE_BACKUP_PERSISTENT = (
"Select backup firmware slot persistently"
)
REQUEST_VERSION = "Request the active Firmware Version"
class SetId(enum.IntEnum):
@ -159,6 +191,7 @@ class SetId(enum.IntEnum):
BLOBS = 92
CENTROID = 93
CENTROIDS = 94
BLOB_STATS = 102
class DataSetRequest(enum.IntEnum):
@ -290,10 +323,6 @@ def pack_star_tracker_commands( # noqa C901
q.add_log_cmd("Star tracker: Temperature request")
data = obyt + struct.pack("!I", StarTrackerActionId.REQ_TEMPERATURE)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
if cmd_str == "8":
q.add_log_cmd("Star tracker: Request version")
data = obyt + struct.pack("!I", StarTrackerActionId.REQ_VERSION)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
if cmd_str == "9":
q.add_log_cmd("Star tracker: Request interface")
data = obyt + struct.pack("!I", StarTrackerActionId.REQ_INTERFACE)
@ -642,12 +671,21 @@ def pack_star_tracker_commands( # noqa C901
+ bytearray(json_file, "utf-8")
)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
if cmd_str == OpCode.FW_UPDATE:
q.add_log_cmd(Info.FW_UPDATE)
if cmd_str == OpCode.FW_UPDATE_MAIN:
q.add_log_cmd(Info.FW_UPDATE_MAIN)
firmware = get_firmware()
data = (
obyt
+ struct.pack("!I", StarTrackerActionId.FIRMWARE_UPDATE)
+ struct.pack("!I", StarTrackerActionId.FIRMWARE_UPDATE_MAIN)
+ firmware.encode()
)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
if cmd_str == OpCode.FW_UPDATE_BACKUP:
q.add_log_cmd(Info.FW_UPDATE_BACKUP)
firmware = get_firmware()
data = (
obyt
+ struct.pack("!I", StarTrackerActionId.FIRMWARE_UPDATE_BACKUP)
+ firmware.encode()
)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
@ -683,6 +721,43 @@ def pack_star_tracker_commands( # noqa C901
q.add_pus_tc(
create_action_cmd(STAR_TRACKER_ID, StarTrackerActionId.RELOAD_JSON_CFG_FILE)
)
if cmd_str == OpCode.SELECT_TARGET_FIRMWARE_MAIN:
q.add_log_cmd(Info.SELECT_TARGET_FIRMWARE_MAIN)
q.add_pus_tc(create_update_firmware_target_cmd(False, FirmwareTarget.MAIN))
if cmd_str == OpCode.SELECT_TARGET_FIRMWARE_BACKUP:
q.add_log_cmd(Info.SELECT_TARGET_FIRMWARE_BACKUP)
q.add_pus_tc(create_update_firmware_target_cmd(False, FirmwareTarget.BACKUP))
if cmd_str == OpCode.SELECT_TARGET_FIRMWARE_MAIN_PERSISTENT:
q.add_log_cmd(Info.SELECT_TARGET_FIRMWARE_BACKUP)
q.add_pus_tc(create_update_firmware_target_cmd(True, FirmwareTarget.MAIN))
if cmd_str == OpCode.SELECT_TARGET_FIRMWARE_BACKUP_PERSISTENT:
q.add_log_cmd(Info.SELECT_TARGET_FIRMWARE_BACKUP)
q.add_pus_tc(create_update_firmware_target_cmd(True, FirmwareTarget.BACKUP))
if cmd_str == OpCode.REQUEST_VERSION:
q.add_log_cmd(Info.REQUEST_VERSION)
q.add_pus_tc(
create_action_cmd(
object_id=STAR_TRACKER_ID, action_id=StarTrackerActionId.REQ_VERSION
)
)
def create_update_firmware_target_cmd(
persistent: bool, fw_target: FirmwareTarget
) -> PusTelecommand:
if persistent:
param_id = ParamId.FIRMWARE_TARGET_PERSISTENT
else:
param_id = ParamId.FIRMWARE_TARGET
return create_load_param_cmd(
parameter=create_scalar_u8_parameter(
STAR_TRACKER_ID,
0,
param_id,
fw_target,
),
apid=0,
)
def request_dataset(q: DefaultPusQueueHelper, req_type: DataSetRequest):
@ -814,6 +889,10 @@ def handle_str_hk_data(set_id: int, hk_data: bytes, pw: PrintWrapper):
handle_centroids_set(hk_data, pw)
elif set_id == SetId.CONTRAST:
handle_contrast_set(hk_data, pw)
elif set_id == SetId.BLOB_STATS:
handle_blob_stats_set(hk_data, pw)
elif set_id == SetId.VERSION:
handle_version_set(hk_data, pw)
else:
_LOGGER.warning(f"HK parsing for Star Tracker set ID {set_id} unimplemented")
@ -836,6 +915,25 @@ def unpack_time_hk(hk_data: bytes, current_idx: int, pw: PrintWrapper) -> int:
return current_idx
def handle_version_set(hk_data: bytes, pw: PrintWrapper):
pw.dlog("Received Version Set")
if len(hk_data) != 16:
_LOGGER.warning(
f"Version dataset HK with length {len(hk_data)} of unexpected size"
)
current_idx = unpack_time_hk(hk_data, 0, pw)
program = struct.unpack("!B", hk_data[current_idx : current_idx + 1])[0]
pw.dlog(f"Program: {program}")
current_idx += 1
major = struct.unpack("!B", hk_data[current_idx : current_idx + 1])[0]
pw.dlog(f"Major: {major}")
current_idx += 1
minor = struct.unpack("!B", hk_data[current_idx : current_idx + 1])[0]
pw.dlog(f"Minor: {minor}")
current_idx += 1
pw.dlog(get_validity_buffer_str(hk_data[current_idx:], num_vars=5))
def handle_temperature_set(hk_data: bytes, pw: PrintWrapper):
pw.dlog("Received temperature set")
if len(hk_data) < 24:
@ -850,7 +948,7 @@ def handle_temperature_set(hk_data: bytes, pw: PrintWrapper):
pw.dlog(f"CMOS Temperature: {cmos_temp}")
pw.dlog(f"FPGA Temperature: {fpga_temp}")
current_idx += fmt_len
FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], 5)
pw.dlog(get_validity_buffer_str(hk_data[current_idx:], 5))
def handle_solution_set(hk_data: bytes, pw: PrintWrapper):
@ -924,7 +1022,7 @@ def handle_solution_set(hk_data: bytes, pw: PrintWrapper):
solution_strategy = hk_data[current_idx]
pw.dlog(f"Solution strategy: {solution_strategy}")
current_idx += 1
print(FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], 23))
pw.dlog(get_validity_buffer_str(hk_data[current_idx:], 23))
def handle_blob_set(hk_data: bytes, pw: PrintWrapper):
@ -935,7 +1033,7 @@ def handle_blob_set(hk_data: bytes, pw: PrintWrapper):
current_idx = unpack_time_hk(hk_data, 0, pw)
blob_count = struct.unpack("!I", hk_data[current_idx : current_idx + 4])[0]
pw.dlog(f"Blob count: {blob_count}")
FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx + 4 :], num_vars=3)
pw.dlog(get_validity_buffer_str(hk_data[current_idx + 4 :], num_vars=3))
def handle_blobs_set(hk_data: bytes, pw: PrintWrapper):
@ -963,7 +1061,7 @@ def handle_blobs_set(hk_data: bytes, pw: PrintWrapper):
for idx in range(8):
pw.dlog("{:<8} {:<8}".format(x_coords[idx], y_coords[idx]))
assert current_idx == len(hk_data) - 1
FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=7)
pw.dlog(get_validity_buffer_str(hk_data[current_idx:], num_vars=7))
def handle_centroid_set(hk_data: bytes, pw: PrintWrapper):
@ -977,7 +1075,7 @@ def handle_centroid_set(hk_data: bytes, pw: PrintWrapper):
current_idx += 4
pw.dlog(f"Centroid count: {centroid_count}")
assert current_idx == len(hk_data) - 1
FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=3)
pw.dlog(get_validity_buffer_str(hk_data[current_idx:], num_vars=3))
def handle_centroids_set(hk_data: bytes, pw: PrintWrapper):
@ -1004,7 +1102,7 @@ def handle_centroids_set(hk_data: bytes, pw: PrintWrapper):
)
)
assert current_idx == len(hk_data) - 1
FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=6)
pw.dlog(get_validity_buffer_str(hk_data[current_idx:], num_vars=6))
def handle_matched_centroids_set(hk_data: bytes, pw: PrintWrapper):
@ -1048,7 +1146,7 @@ def handle_matched_centroids_set(hk_data: bytes, pw: PrintWrapper):
)
)
assert current_idx == len(hk_data) - 1
FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=8)
pw.dlog(get_validity_buffer_str(hk_data[current_idx:], num_vars=8))
def handle_auto_blob_set(hk_data: bytes, pw: PrintWrapper):
@ -1066,7 +1164,7 @@ def handle_auto_blob_set(hk_data: bytes, pw: PrintWrapper):
current_idx += inc_len
assert current_idx == len(hk_data) - 1
pw.dlog(f"Threshold {threshold}")
FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=3)
pw.dlog(get_validity_buffer_str(hk_data[current_idx:], num_vars=3))
def handle_histo_or_contrast_set(name: str, hk_data: bytes, pw: PrintWrapper):
@ -1116,6 +1214,35 @@ def handle_contrast_set(hk_data: bytes, pw: PrintWrapper):
handle_histo_or_contrast_set("Contrast", hk_data, pw)
def handle_blob_stats_set(hk_data: bytes, pw: PrintWrapper):
pw.dlog("Received Blob Stats Set")
if len(hk_data) < 65:
raise ValueError(
f"Matched BlobStats set with length {len(hk_data)} too short. Expected 65 bytes."
)
current_idx = unpack_time_hk(hk_data, 0, pw)
def fill_list(current_idx: int) -> Tuple[List[int], int]:
list_to_fill = []
for _ in range(16):
list_to_fill.append(hk_data[current_idx])
current_idx += 1
return list_to_fill, current_idx
noise_list, current_idx = fill_list(current_idx)
threshold_list, current_idx = fill_list(current_idx)
lvalid_list, current_idx = fill_list(current_idx)
oflow_list, current_idx = fill_list(current_idx)
pw.dlog("Index | Noise | Threshold | LValid | Oflow")
for i in range(16):
pw.dlog(
"{:<3} {:<3} {:<3} {:<3} {:<3}".format(
i, noise_list[i], threshold_list[i], lvalid_list[i], oflow_list[i]
)
)
pw.dlog(get_validity_buffer_str(hk_data[current_idx:], num_vars=6))
def handle_star_tracker_action_replies(
action_id: int, pw: PrintWrapper, custom_data: bytes
):
@ -1156,63 +1283,15 @@ def handle_read_secondary_tm_set(pw: PrintWrapper, custom_data: bytes):
def create_str_node() -> CmdTreeNode:
# Zip the two classes together into a dictionary
op_code_strs = [
getattr(OpCode, 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))
node = CmdTreeNode(
"str", "Star Tracker Device", hide_children_which_are_leaves=True
)
node.add_child(CmdTreeNode(OpCode.ON_BOOTLOADER, "Mode On, Submode Bootloader"))
node.add_child(CmdTreeNode(OpCode.ON_FIRMWARE, "Mode On, Submode Firmware"))
node.add_child(CmdTreeNode(OpCode.NORMAL, "Mode Normal"))
node.add_child(CmdTreeNode(OpCode.OFF, "Mode Off"))
node.add_child(CmdTreeNode(OpCode.PING, "Star Tracker: Ping"))
node.add_child(CmdTreeNode(OpCode.TAKE_IMAGE, "Take Image"))
node.add_child(CmdTreeNode(OpCode.UPLOAD_IMAGE, Info.UPLOAD_IMAGE))
node.add_child(CmdTreeNode(OpCode.DOWNLOAD_IMAGE, Info.DOWNLOAD_IMAGE))
node.add_child(CmdTreeNode(OpCode.ONE_SHOOT_HK, Info.ONE_SHOOT_HK))
node.add_child(CmdTreeNode(OpCode.ENABLE_HK, Info.ENABLE_HK))
node.add_child(CmdTreeNode(OpCode.DISABLE_HK, Info.DISABLE_HK))
node.add_child(
CmdTreeNode(OpCode.SET_IMG_PROCESSOR_MODE, Info.SET_IMG_PROCESSOR_MODE)
)
node.add_child(
CmdTreeNode(
OpCode.ADD_SECONDARY_TM_TO_NORMAL_MODE,
Info.ADD_SECONDARY_TM_TO_NORMAL_MODE,
)
)
node.add_child(
CmdTreeNode(OpCode.READ_SECONDARY_TM_SET, Info.READ_SECONDARY_TM_SET)
)
node.add_child(
CmdTreeNode(OpCode.RESET_SECONDARY_TM_SET, Info.RESET_SECONDARY_TM_SET)
)
node.add_child(CmdTreeNode(OpCode.FW_UPDATE, Info.FW_UPDATE))
node.add_child(
CmdTreeNode(OpCode.SET_TIME_FROM_SYS_TIME, Info.SET_TIME_FROM_SYS_TIME)
)
for op_code, info in combined_dict.items():
node.add_child(CmdTreeNode(op_code, info))
return node
@tmtc_definitions_provider
def add_str_cmds(defs: TmtcDefinitionWrapper):
oce = OpCodeEntry()
oce.add(OpCode.ON_BOOTLOADER, "Mode On, Submode Bootloader")
oce.add(OpCode.ON_FIRMWARE, "Mode On, Submode Firmware")
oce.add(OpCode.NORMAL, "Mode Normal")
oce.add(OpCode.OFF, "Mode Off")
oce.add(OpCode.PING, "Star Tracker: Ping")
oce.add(OpCode.TAKE_IMAGE, "Take Image")
oce.add(OpCode.UPLOAD_IMAGE, Info.UPLOAD_IMAGE)
oce.add(OpCode.DOWNLOAD_IMAGE, Info.DOWNLOAD_IMAGE)
oce.add(OpCode.ONE_SHOOT_HK, Info.ONE_SHOOT_HK)
oce.add(OpCode.ENABLE_HK, Info.ENABLE_HK)
oce.add(OpCode.DISABLE_HK, Info.DISABLE_HK)
oce.add(OpCode.SET_IMG_PROCESSOR_MODE, Info.SET_IMG_PROCESSOR_MODE)
oce.add(
OpCode.ADD_SECONDARY_TM_TO_NORMAL_MODE, Info.ADD_SECONDARY_TM_TO_NORMAL_MODE
)
oce.add(OpCode.READ_SECONDARY_TM_SET, Info.READ_SECONDARY_TM_SET)
oce.add(OpCode.RESET_SECONDARY_TM_SET, Info.RESET_SECONDARY_TM_SET)
oce.add(OpCode.FW_UPDATE, Info.FW_UPDATE)
oce.add(OpCode.SET_TIME_FROM_SYS_TIME, Info.SET_TIME_FROM_SYS_TIME)
oce.add(OpCode.RELOAD_JSON_CFG_FILE, Info.RELOAD_JSON_CFG_FILE)
defs.add_service(CustomServiceList.STAR_TRACKER.value, "Star Tracker", oce)

View File

@ -3,7 +3,7 @@ import struct
from eive_tmtc.pus_tm.defs import PrintWrapper
from tmtccmd.util import ObjectIdU32
from tmtccmd.fsfw.tmtc_printer import FsfwTmTcPrinter
from tmtccmd.fsfw.tmtc_printer import get_validity_buffer_str
class SetId(enum.IntEnum):
@ -26,6 +26,6 @@ def handle_sus_hk(
pw.dlog("AIN Channel | Raw Value (hex) | Raw Value (dec)")
for idx, val in enumerate(channels):
pw.dlog(f"{idx} | {val[0]:#06x} |" + str(val[0]).ljust(5))
FsfwTmTcPrinter.get_validity_buffer(
validity_buffer=hk_data[current_idx:], num_vars=7
pw.dlog(
get_validity_buffer_str(validity_buffer=hk_data[current_idx:], num_vars=7)
)

View File

@ -78,12 +78,13 @@ def pack_pdec_handler_commands(
pw = int(input("Specify positive window to set: "))
q.add_pus_tc(
create_load_param_cmd(
create_scalar_u8_parameter(
parameter=create_scalar_u8_parameter(
object_id,
0,
ParameterId.POSITIVE_WINDOW,
pw,
)
),
apid=0,
)
)
if cmd_str == OpCode.NEGATIVE_WINDOW:
@ -91,12 +92,13 @@ def pack_pdec_handler_commands(
nw = int(input("Specify negative window to set: "))
q.add_pus_tc(
create_load_param_cmd(
create_scalar_u8_parameter(
parameter=create_scalar_u8_parameter(
object_id,
0,
ParameterId.NEGATIVE_WINDOW,
nw,
)
),
apid=0,
)
)
if cmd_str == OpCode.RESET_NO_INIT:

View File

@ -17,7 +17,7 @@ from tmtccmd.config.tmtc import (
TmtcDefinitionWrapper,
tmtc_definitions_provider,
)
from tmtccmd.fsfw.tmtc_printer import FsfwTmTcPrinter
from tmtccmd.fsfw.tmtc_printer import get_validity_buffer_str
from tmtccmd.pus.s200_fsfw_mode import Mode, create_mode_command
from tmtccmd.pus.tc.s3_fsfw_hk import (
create_disable_periodic_hk_command_with_diag,
@ -297,7 +297,7 @@ def handle_syrlinks_temp_dataset(hk_info: HkTmInfo, pw: PrintWrapper):
temp_baseband_board = struct.unpack("!f", hk_data[4:8])[0]
pw.dlog(f"Temperatur Power Amplifier [C]: {temp_power_amplifier}")
pw.dlog(f"Temperatur Baseband Board [C]: {temp_baseband_board}")
pw.dlog(FsfwTmTcPrinter.get_validity_buffer(hk_data[8:], 2))
pw.dlog(get_validity_buffer_str(hk_data[8:], 2))
def handle_syrlinks_rx_registers_dataset(
@ -364,9 +364,7 @@ def handle_syrlinks_rx_registers_dataset(
validity_buffer = hk_data[22:]
for header, content in zip(header_list, content_list):
pw.dlog(f"{header}: {content}")
pw.dlog(
FsfwTmTcPrinter.get_validity_buffer(validity_buffer=validity_buffer, num_vars=8)
)
pw.dlog(get_validity_buffer_str(validity_buffer=validity_buffer, num_vars=8))
print(f"Carrier Detect: {carrier_detect}")
print(f"Carrier Lock: {carrier_lock}")
print(f"Data Lock (data clock recovery loop lock status): {data_lock}")
@ -394,7 +392,7 @@ def handle_syrlinks_rx_registers_dataset(
"INSERT INTO syrlinks_rx_regs VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?)",
(
str(hk_info.packet_uuid),
hk_info.hk_packet.pus_tm.time_provider.as_datetime(), # type: ignore
hk_info.packet_datetime,
carrier_detect,
carrier_lock,
data_lock,
@ -470,9 +468,7 @@ def handle_syrlinks_tx_registers_dataset(
validity_buffer = hk_info.hk_data[4:]
for header, content in zip(header_list, content_list):
pw.dlog(f"{header}: {content}")
pw.dlog(
FsfwTmTcPrinter.get_validity_buffer(validity_buffer=validity_buffer, num_vars=3)
)
pw.dlog(get_validity_buffer_str(validity_buffer=validity_buffer, num_vars=3))
# pw.dlog(f"TX CONV: {tx_conv!r}")
# pw.dlog(f"TX DIFF (differential encoder enable): {tx_diff_encoder_enable}")
print(f"TX Status: {tx_status_status!r}")
@ -504,7 +500,7 @@ def handle_syrlinks_tx_registers_dataset(
"INSERT INTO syrlinks_tx_regs VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",
(
str(hk_info.packet_uuid),
hk_info.hk_packet.pus_tm.time_provider.as_datetime(), # type: ignore
hk_info.packet_datetime,
tx_status_status,
tx_status_status.name,
tx_conf_set,

View File

@ -6,7 +6,7 @@ from pathlib import Path
from typing import Tuple
from spacepackets.ecss import PusTelecommand
from tmtccmd.config import CmdTreeNode, TmtcDefinitionWrapper
from tmtccmd.config import CmdTreeNode
from tmtccmd.tmtc import DefaultPusQueueHelper
from tmtccmd.pus.s8_fsfw_action import create_action_cmd
@ -15,14 +15,12 @@ from tmtccmd.pus.s20_fsfw_param import (
create_scalar_u8_parameter,
create_load_param_cmd,
)
from tmtccmd.config.tmtc import OpCodeEntry, tmtc_definitions_provider
from tmtccmd.fsfw.tmtc_printer import FsfwTmTcPrinter
from tmtccmd.fsfw.tmtc_printer import get_validity_buffer_str
from tmtccmd.pus.s11_tc_sched import (
create_enable_tc_sched_cmd,
create_disable_tc_sched_cmd,
)
from eive_tmtc.config.definitions import CustomServiceList
from eive_tmtc.config.object_ids import CORE_CONTROLLER_ID
from eive_tmtc.pus_tm.defs import PrintWrapper
@ -71,6 +69,7 @@ class ActionId(enum.IntEnum):
RM_HELPER = 54
MKDIR_HELPER = 55
ENABLE_SCHEDULER = 56
UPDATE_LEAP_SECONRS = 60
class ParamId(enum.IntEnum):
@ -122,6 +121,7 @@ class OpCode:
AUTO_SWITCH_DISABLE = "auto_switch_disable"
ENABLE_SCHEDULER = "enable_scheduler"
DISABLE_SCHEDULER = "disable_scheduler"
UPDATE_LEAP_SECONDS = "leap_seconds_update"
class Info:
@ -165,6 +165,7 @@ class Info:
AUTO_SWITCH_DISABLE = "Disable Auto-Switch Feature"
ENABLE_SCHEDULER = "Enable scheduler"
DISABLE_SCHEDULER = "Disable scheduler"
UPDATE_LEAP_SECONDS = "Updates the Leap Seconds"
class Chip(enum.IntEnum):
@ -197,90 +198,6 @@ def create_core_node() -> CmdTreeNode:
return node
@tmtc_definitions_provider
def add_core_controller_definitions(defs: TmtcDefinitionWrapper):
oce = OpCodeEntry()
oce.add(keys=OpCode.ANNOUNCE_VERSION, info=Info.ANNOUNCE_VERSION)
oce.add(keys=OpCode.ANNOUNCE_CURRENT_IMAGE, info=Info.ANNOUNCE_CURRENT_IMAGE)
oce.add(keys=OpCode.ANNOUNCE_BOOT_COUNTS, info=Info.ANNOUNCE_BOOT_COUNTS)
oce.add(keys=OpCode.REBOOT_XSC, info=Info.REBOOT_XSC)
oce.add(keys=OpCode.REBOOT_XSC, info=Info.REBOOT_XSC)
oce.add(keys=OpCode.REBOOT_FULL, info=Info.REBOOT_FULL)
oce.add(keys=OpCode.XSC_REBOOT_SELF, info="Reboot Self")
oce.add(keys=OpCode.XSC_REBOOT_0_0, info="Reboot 0 0")
oce.add(keys=OpCode.XSC_REBOOT_0_1, info="Reboot 0 1")
oce.add(keys=OpCode.XSC_REBOOT_1_0, info="Reboot 1 0")
oce.add(keys=OpCode.XSC_REBOOT_1_1, info="Reboot 1 1")
oce.add(keys=OpCode.SET_PREF_SD, info=Info.SET_PREF_SD)
oce.add(
keys=OpCode.READ_REBOOT_MECHANISM_INFO, info=Info.READ_REBOOT_MECHANISM_INFO
)
oce.add(keys=OpCode.OBSW_UPDATE_FROM_TMP, info=Info.OBSW_UPDATE_FROM_TMP)
oce.add(keys=OpCode.OBSW_UPDATE_FROM_SD_0, info=Info.OBSW_UPDATE_FROM_SD_0)
oce.add(keys=OpCode.OBSW_UPDATE_FROM_SD_1, info=Info.OBSW_UPDATE_FROM_SD_1)
oce.add(keys=OpCode.AUTO_SWITCH_ENABLE, info=Info.AUTO_SWITCH_ENABLE)
oce.add(keys=OpCode.AUTO_SWITCH_DISABLE, info=Info.AUTO_SWITCH_DISABLE)
oce.add(keys=OpCode.SYSTEMCTL_CMD_EXECUTOR, info=Info.SYSTEMCTL_CMD_EXECUTOR)
oce.add(
keys=OpCode.EXECUTE_SHELL_CMD_BLOCKING, info=Info.EXECUTE_SHELL_CMD_BLOCKING
)
oce.add(
keys=OpCode.EXECUTE_SHELL_CMD_NON_BLOCKING,
info=Info.EXECUTE_SHELL_CMD_NON_BLOCKING,
)
oce.add(
keys=OpCode.GET_HK,
info="Request housekeeping set",
)
oce.add(
keys=OpCode.ENABLE_REBOOT_FILE_HANDLING,
info="Enable reboot file handling",
)
oce.add(
keys=OpCode.DISABLE_REBOOT_FILE_HANDLING,
info="Disable reboot file handling",
)
oce.add(
keys=OpCode.RESET_ALL_REBOOT_COUNTERS,
info="Reset all reboot counters",
)
oce.add(
keys=OpCode.RWD_RESET_REBOOT_COUNTER_00,
info="Reset reboot counter 0 0",
)
oce.add(
keys=OpCode.RWD_RESET_REBOOT_COUNTER_01,
info="Reset reboot counter 0 1",
)
oce.add(
keys=OpCode.RWD_RESET_REBOOT_COUNTER_10,
info="Reset reboot counter 1 0",
)
oce.add(
keys=OpCode.RWD_RESET_REBOOT_COUNTER_11,
info="Reset reboot counter 1 1",
)
oce.add(
keys=OpCode.RWD_SET_MAX_REBOOT_CNT,
info="Reset max reboot count for reboot watchdog",
)
oce.add(keys=OpCode.OBSW_UPDATE_FROM_SD_0, info=Info.OBSW_UPDATE_FROM_SD_0)
oce.add(keys=OpCode.OBSW_UPDATE_FROM_SD_1, info=Info.OBSW_UPDATE_FROM_SD_1)
oce.add(keys=OpCode.OBSW_UPDATE_FROM_TMP, info=Info.OBSW_UPDATE_FROM_TMP)
oce.add(keys=OpCode.SWITCH_TO_SD_0, info=Info.SWITCH_TO_SD_0)
oce.add(keys=OpCode.SWITCH_TO_SD_1, info=Info.SWITCH_TO_SD_1)
oce.add(keys=OpCode.SWITCH_TO_BOTH_SD_CARDS, info=Info.SWITCH_TO_BOTH_SD_CARDS)
oce.add(keys=OpCode.LIST_DIR_INTO_FILE, info=Info.LIST_DIR_INTO_FILE)
oce.add(keys=OpCode.LIST_DIR_DUMP_DIRECTLY, info=Info.LIST_DIR_DUMP_DIRECTLY)
oce.add(keys=OpCode.MV_HELPER, info=Info.MV_HELPER)
oce.add(keys=OpCode.CP_HELPER, info=Info.CP_HELPER)
oce.add(keys=OpCode.RM_HELPER, info=Info.RM_HELPER)
oce.add(keys=OpCode.MKDIR_HELPER, info=Info.MKDIR_HELPER)
oce.add(keys=OpCode.ENABLE_SCHEDULER, info=Info.ENABLE_SCHEDULER)
oce.add(keys=OpCode.DISABLE_SCHEDULER, info=Info.DISABLE_SCHEDULER)
defs.add_service(CustomServiceList.CORE.value, "Core Controller", oce)
def pack_core_commands( # noqa C901
q: DefaultPusQueueHelper, cmd_str: str
): # noqa: C901 , complexity okay here
@ -482,12 +399,13 @@ def pack_core_commands( # noqa C901
raise ValueError("Only 0 or 1 allowed for preferred SD card")
q.add_pus_tc(
create_load_param_cmd(
create_scalar_u8_parameter(
parameter=create_scalar_u8_parameter(
object_id=CORE_CONTROLLER_ID,
domain_id=0,
unique_id=ParamId.PREF_SD,
parameter=pref_sd,
)
),
apid=0,
)
)
elif cmd_str == OpCode.CP_HELPER:
@ -557,6 +475,16 @@ def pack_core_commands( # noqa C901
elif cmd_str == OpCode.DISABLE_SCHEDULER:
q.add_log_cmd(Info.DISABLE_SCHEDULER)
q.add_pus_tc(create_disable_tc_sched_cmd())
elif cmd_str == OpCode.UPDATE_LEAP_SECONDS:
q.add_log_cmd(Info.UPDATE_LEAP_SECONDS)
leap_seconds = int(input("Specify new Leap Seconds Value: ")).to_bytes(
length=2, signed=False, byteorder="big"
)
q.add_pus_tc(
create_action_cmd(
CORE_CONTROLLER_ID, ActionId.UPDATE_LEAP_SECONRS, leap_seconds
)
)
else:
_LOGGER.warning(
f"Unknown operation code {cmd_str} for core controller commands"
@ -705,9 +633,7 @@ def handle_core_hk_data(pw: PrintWrapper, set_id: int, hk_data: bytes):
f"PL Voltage [mV] {pl_voltage}"
)
pw.dlog(printout)
FsfwTmTcPrinter.get_validity_buffer(
validity_buffer=hk_data[inc_len:], num_vars=3
)
pw.dlog(get_validity_buffer_str(validity_buffer=hk_data[inc_len:], num_vars=3))
def handle_core_ctrl_action_replies(

View File

@ -1,9 +1,8 @@
import enum
import struct
from tmtccmd.fsfw.tmtc_printer import FsfwTmTcPrinter
from eive_tmtc.pus_tm.defs import PrintWrapper
from tmtccmd.fsfw.tmtc_printer import get_validity_buffer_str
class SetId(enum.IntEnum):
@ -21,4 +20,4 @@ def handle_ier_hk_data(pw: PrintWrapper, hk_data: bytes, set_id: int):
pw.dlog(f"TM Errors: {tm_errors}")
pw.dlog(f"Queue Errors: {queue_errors}")
pw.dlog(f"Store Errors: {store_hits}")
pw.dlog(FsfwTmTcPrinter.get_validity_buffer(hk_data[inc_len:], 3))
pw.dlog(get_validity_buffer_str(hk_data[inc_len:], 3))

View File

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

View File

@ -11,19 +11,15 @@ import logging
import struct
import enum
from eive_tmtc.config.definitions import CustomServiceList
from eive_tmtc.config.object_ids import get_object_ids, PLOC_MPSOC_ID
from eive_tmtc.pus_tm.defs import PrintWrapper
from tmtccmd.config.tmtc import (
CmdTreeNode,
tmtc_definitions_provider,
OpCodeEntry,
TmtcDefinitionWrapper,
)
from spacepackets.ecss.tc import PusTelecommand
from tmtccmd.tmtc import DefaultPusQueueHelper
from eive_tmtc.utility.input_helper import InputHelper
from tmtccmd.pus.s200_fsfw_mode import pack_mode_data, Mode
from tmtccmd.pus.s200_fsfw_mode import pack_mode_data, Mode, create_mode_command
from tmtccmd.pus.s20_fsfw_param import create_load_param_cmd, create_scalar_u8_parameter
from tmtccmd.pus.s8_fsfw_action import create_action_cmd
@ -31,6 +27,8 @@ _LOGGER = logging.getLogger(__name__)
MANUAL_INPUT = "1"
CRIT_CMD_APID_DICT = {"1": ("flash_mkfs", 0x12A)}
OBC_WRITE_FILE_DICT = {
MANUAL_INPUT: ("manual input", ""),
"2": ("/mnt/sd0/ploc/mpsoc/flash_write.bin", "/mnt/sd0/ploc/mpsoc/flash_write.bin"),
@ -86,12 +84,22 @@ class ActionId(enum.IntEnum):
SET_UART_TX_TRISTATE = 20
RELEASE_UART_TX = 21
TC_CAM_TAKE_PIC = 22
TC_SIMPLEX_SEND_FILE = 23
TC_SIMPLEX_STREAM_FILE = 23
TC_DOWNLINK_DATA_MODULATE = 24
TC_MODE_SNAPSHOT = 25
TC_FLASH_DIR_GET_CONTENT = 28
TM_FLASH_DIRECTORY_CONTENT = 29
TC_FLASH_READ_FULL_FILE = 30
TC_SPLIT_FILE = 31
TC_VERIFY_BOOT = 32
TC_ENABLE_TC_EXECUTION = 33
TC_FLASH_MKFS = 34
class Submode(enum.IntEnum):
IDLE_OR_NONE = 0
REPLAY = 1
SNAPSHOT = 2
class ParamId(enum.IntEnum):
@ -103,8 +111,6 @@ class OpCode:
OFF = "off"
NORMAL = "normal"
VERIFY_BOOT = "verify_boot"
MODE_REPLAY = "mode_replay"
MODE_IDLE = "mode_idle"
REPLAY_WRITE_SEQ = "replay_write"
DOWNLINK_PWR_ON = "downlink_pwr_on"
MEM_WRITE = "memory_write"
@ -116,12 +122,18 @@ class OpCode:
FLASH_GET_DIR_CONTENT = "flash_get_dir_content"
REPLAY_STOP = "replay_stop"
REPLAY_START = "replay_start"
CAM_CMD_SEND = "cam_cmd_send"
CAM_TAKE_PIC = "cam_take_pic"
SIMPLEX_SEND_FILE = "simplex_send_file"
SIMPLEX_STREAM_FILE = "simplex_stream_file"
SPLIT_FILE = "split_file"
DOWNLINK_DATA_MODULATE = "downlink_data_modulate"
MODE_SNAPSHOT = "mode_snapshot"
ENABLE_PLOC_SUPV_COMMANDING_TO_ON = "enable_ploc_supv_cmd_to_on"
DISABLE_PLOC_SUPV_COMMANDING_TO_ON = "disable_ploc_supv_cmd_to_on"
MODE_IDLE = "mode_idle"
MODE_REPLAY = "mode_replay"
MODE_SNAPSHOT = "mode_snapshot"
ENABLE_TC_EXECUTION = "enable_tc_exec"
FLASH_MKFS = "flash_mkfs"
class Info:
@ -139,7 +151,9 @@ class Info:
MEM_READ = "Read from Memory"
REPLAY_START = "Replay Start"
CAM_TAKE_PIC = "Cam Take Picture"
SIMPLEX_SEND_FILE = "Simplex Send File"
CAM_CMD_SEND = "Send Camera Command"
SIMPLEX_STREAM_FILE = "Simplex Stream File with E-Band"
SPLIT_FILE = "Split file on MPSoC Flash"
FLASH_READ_FILE = "Copy file from MPSoC to OBC"
FLASH_WRITE_FILE = "Copy file from OBC to MPSoC"
FLASH_DELETE_FILE = "Delete file on MPSoC"
@ -150,6 +164,8 @@ class Info:
DISABLE_PLOC_SUPV_COMMANDING_TO_ON = (
"Disable PLOC SUPV commanding when switching ON"
)
ENABLE_TC_EXECUTION = "Enable execution of critical commands"
FLASH_MKFS = "Flash MKFS command"
class MemAddresses(enum.IntEnum):
@ -168,45 +184,6 @@ def create_ploc_mpsoc_node() -> CmdTreeNode:
return node
# Legacy command definitions.
@tmtc_definitions_provider
def add_ploc_mpsoc_cmds(defs: TmtcDefinitionWrapper):
oce = OpCodeEntry()
oce.add(OpCode.OFF, Info.OFF)
oce.add(OpCode.ON, Info.ON)
oce.add(OpCode.NORMAL, Info.NORMAL)
oce.add(OpCode.MEM_WRITE, "Ploc MPSoC: Memory write")
oce.add(OpCode.MEM_READ, "Ploc MPSoC: Memory read")
oce.add(OpCode.FLASH_WRITE_FILE, Info.FLASH_WRITE_FILE)
oce.add(OpCode.FLASH_READ_FILE, Info.FLASH_READ_FILE)
oce.add(OpCode.FLASH_DELETE_FILE, Info.FLASH_DELETE_FILE)
oce.add(OpCode.FLASH_GET_DIR_CONTENT, Info.FLASH_GET_DIR_CONTENT)
oce.add(OpCode.REPLAY_START, Info.REPLAY_START)
oce.add(OpCode.REPLAY_STOP, Info.REPLAY_STOP)
oce.add(OpCode.DOWNLINK_PWR_ON, Info.DOWNLINK_PWR_ON)
oce.add(OpCode.DOWNLINK_PWR_OFF, Info.DOWNLINK_PWR_OFF)
oce.add(OpCode.REPLAY_WRITE_SEQ, Info.REPLAY_WRITE_SEQ)
oce.add("12", "Ploc MPSoC: OBSW reset sequence count")
oce.add(OpCode.VERIFY_BOOT, Info.VERIFY_BOOT)
oce.add(OpCode.MODE_REPLAY, Info.MODE_REPLAY)
oce.add(OpCode.MODE_IDLE, Info.MODE_IDLE)
oce.add("16", "Ploc MPSoC: Tc cam command send")
oce.add("17", "Ploc MPSoC: Set UART TX tristate")
oce.add("18", "Ploc MPSoC: Relesase UART TX")
oce.add(OpCode.CAM_TAKE_PIC, Info.CAM_TAKE_PIC)
oce.add(OpCode.SIMPLEX_SEND_FILE, Info.SIMPLEX_SEND_FILE)
oce.add(OpCode.DOWNLINK_DATA_MODULATE, Info.DOWNLINK_DATA_MODULATE)
oce.add(OpCode.MODE_SNAPSHOT, Info.MODE_SNAPSHOT)
oce.add(
OpCode.ENABLE_PLOC_SUPV_COMMANDING_TO_ON, Info.ENABLE_PLOC_SUPV_COMMANDING_TO_ON
)
oce.add(
OpCode.DISABLE_PLOC_SUPV_COMMANDING_TO_ON,
Info.DISABLE_PLOC_SUPV_COMMANDING_TO_ON,
)
defs.add_service(CustomServiceList.PLOC_MPSOC.value, "Ploc MPSoC", oce)
def pack_ploc_mpsoc_commands(
q: DefaultPusQueueHelper, cmd_str: str
): # noqa C901: Complexity okay here.
@ -290,25 +267,11 @@ def pack_ploc_mpsoc_commands(
data = object_id.as_bytes + struct.pack("!I", ActionId.OBSW_RESET_SEQ_COUNT)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
if cmd_str == OpCode.VERIFY_BOOT:
num_words = 1
q.add_log_cmd(f"{prefix} {Info.VERIFY_BOOT}")
data = (
object_id.as_bytes
+ struct.pack("!I", ActionId.TC_MEM_READ)
+ struct.pack("!I", MemAddresses.DEADBEEF)
+ struct.pack("!H", num_words)
)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
if cmd_str == OpCode.MODE_REPLAY:
q.add_log_cmd("PLOC MPSoC: Tc mode replay")
data = object_id.as_bytes + struct.pack("!I", ActionId.TC_MODE_REPLAY)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
if cmd_str == OpCode.MODE_IDLE:
q.add_log_cmd("PLOC MPSoC: Tc mode idle")
data = object_id.as_bytes + struct.pack("!I", ActionId.TC_MODE_IDLE)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
if cmd_str == "16":
q.add_log_cmd("PLOC MPSoC: Tc cam command send")
app_data = object_id.as_bytes + struct.pack("!I", ActionId.TC_VERIFY_BOOT)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=app_data))
if cmd_str == OpCode.CAM_CMD_SEND:
q.add_log_cmd(Info.CAM_CMD_SEND)
cam_cmd = input("Specify cam command string: ")
data = (
object_id.as_bytes
@ -316,6 +279,44 @@ def pack_ploc_mpsoc_commands(
+ bytearray(cam_cmd, "utf-8")
)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
if cmd_str == OpCode.ENABLE_TC_EXECUTION:
q.add_log_cmd(Info.ENABLE_TC_EXECUTION)
while True:
for key, val in CRIT_CMD_APID_DICT.items():
print(f"{key}: {val[0]} with APID {val[1]}")
key = input("Please specify the command to enable by key: ")
if key not in CRIT_CMD_APID_DICT:
print("invalid key")
continue
apid = CRIT_CMD_APID_DICT[key][1]
break
app_data = struct.pack("!H", apid)
q.add_pus_tc(
create_action_cmd(PLOC_MPSOC_ID, ActionId.TC_ENABLE_TC_EXECUTION, app_data)
)
if cmd_str == OpCode.FLASH_MKFS:
q.add_log_cmd(Info.FLASH_MKFS)
while True:
flash_select = int(input("Please select the flash ID (0 or 1): "))
if flash_select != 0 and flash_select != 1:
_LOGGER.warn("invalid flash select")
continue
break
q.add_pus_tc(
create_action_cmd(
PLOC_MPSOC_ID, ActionId.TC_FLASH_MKFS, bytes([flash_select])
)
)
if cmd_str == OpCode.SPLIT_FILE:
q.add_log_cmd(Info.SPLIT_FILE)
q.add_pus_tc(
create_action_cmd(
PLOC_MPSOC_ID,
ActionId.TC_SPLIT_FILE,
user_data=prepare_simplex_store_file_user_data(),
)
)
if cmd_str == "17":
q.add_log_cmd("PLOC MPSoC: Set UART TX tristate")
data = object_id.as_bytes + struct.pack("!I", ActionId.SET_UART_TX_TRISTATE)
@ -328,18 +329,30 @@ def pack_ploc_mpsoc_commands(
q.add_log_cmd("PLOC MPSoC: Cam take picture")
data = prepare_cam_take_pic_cmd(object_id.as_bytes)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
if cmd_str == OpCode.SIMPLEX_SEND_FILE:
q.add_log_cmd("PLOC MPSoC: Simplex send file")
data = prepare_simplex_send_file_cmd(object_id.as_bytes)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
if cmd_str == OpCode.SIMPLEX_STREAM_FILE:
q.add_log_cmd(Info.SIMPLEX_STREAM_FILE)
data = prepare_simplex_stream_file_user_data()
q.add_pus_tc(
create_action_cmd(
PLOC_MPSOC_ID, ActionId.TC_SIMPLEX_STREAM_FILE, user_data=data
)
)
if cmd_str == OpCode.DOWNLINK_DATA_MODULATE:
q.add_log_cmd("PLOC MPSoC: Downlink data modulate")
data = prepare_downlink_data_modulate_cmd(object_id.as_bytes)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
if cmd_str == OpCode.MODE_SNAPSHOT:
q.add_log_cmd("PLOC MPSoC: Mode snapshot")
data = object_id.as_bytes + struct.pack("!I", ActionId.TC_MODE_SNAPSHOT)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=data))
q.add_log_cmd(Info.MODE_SNAPSHOT)
mode = prompt_mode_for_submode_change()
q.add_pus_tc(create_mode_command(PLOC_MPSOC_ID, mode, Submode.SNAPSHOT))
if cmd_str == OpCode.MODE_IDLE:
q.add_log_cmd(Info.MODE_IDLE)
mode = prompt_mode_for_submode_change()
q.add_pus_tc(create_mode_command(PLOC_MPSOC_ID, mode, Submode.IDLE_OR_NONE))
if cmd_str == OpCode.MODE_REPLAY:
q.add_log_cmd(Info.MODE_REPLAY)
mode = prompt_mode_for_submode_change()
q.add_pus_tc(create_mode_command(PLOC_MPSOC_ID, mode, Submode.REPLAY))
if cmd_str == OpCode.ENABLE_PLOC_SUPV_COMMANDING_TO_ON:
q.add_log_cmd(Info.ENABLE_PLOC_SUPV_COMMANDING_TO_ON)
q.add_pus_tc(
@ -360,6 +373,20 @@ def pack_ploc_mpsoc_commands(
)
def prompt_mode_for_submode_change() -> int:
while True:
mode = input("Please specify primary mode [0: ON, 1: NORMAL]: ")
if mode == "0":
mode = Mode.ON
elif mode == "1":
mode = Mode.NORMAL
else:
print("Invalid mode")
continue
break
return mode
def generate_write_mem_command(
object_id: bytes, memory_address: int, memory_data: int, mem_len: int
) -> bytearray:
@ -467,10 +494,10 @@ def prepare_replay_write_sequence_cmd(object_id: bytes) -> bytearray:
return bytearray(command)
def prepare_cam_take_pic_cmd(object_id: bytes) -> bytearray:
selection = input("Use default parameter? (Y/N): ")
def prepare_cam_take_pic_cmd(object_id: bytes) -> bytes:
filename = input("Specify target filename: ")
selection = input("Use default parameter? (y/n): ")
if selection.lower() in ["y", "1", "yes"]:
filename = "0:/test"
encoder_setting_y = 7
quantization_y = 0
encoder_setting_cb = 7
@ -479,7 +506,6 @@ def prepare_cam_take_pic_cmd(object_id: bytes) -> bytearray:
quantization_cr = 0
bypass_compressor = 0
else:
filename = input("Specify filename: ")
encoder_setting_y = int(input("Specify encoderSetting_Y: "))
quantization_y = int(input("Specify quantization_Y: "))
encoder_setting_cb = int(input("Specify encoderSetting_Cb: "))
@ -490,7 +516,7 @@ def prepare_cam_take_pic_cmd(object_id: bytes) -> bytearray:
command = (
object_id
+ struct.pack("!I", ActionId.TC_CAM_TAKE_PIC)
+ bytearray(filename, "utf-8")
+ filename.encode()
+ bytes([0])
+ struct.pack("!B", encoder_setting_y)
+ struct.pack("!Q", quantization_y)
@ -500,18 +526,23 @@ def prepare_cam_take_pic_cmd(object_id: bytes) -> bytearray:
+ struct.pack("!Q", quantization_cr)
+ struct.pack("!B", bypass_compressor)
)
return bytearray(command)
return command
def prepare_simplex_send_file_cmd(object_id: bytes) -> bytearray:
def prepare_simplex_stream_file_user_data() -> bytes:
filename = input("Specify filename: ")
command = filename.encode() + bytes([0])
return command
def prepare_simplex_store_file_user_data() -> bytes:
num_of_chunks = int(input("Please specify the number of chunks: "))
assert num_of_chunks >= 0
filename = input("Specify filename: ")
command = (
object_id
+ struct.pack("!I", ActionId.TC_SIMPLEX_SEND_FILE)
+ bytearray(filename, "utf-8")
+ bytes([0])
struct.pack("!I", num_of_chunks) + bytearray(filename, "utf-8") + bytes([0])
)
return bytearray(command)
return command
def prepare_downlink_data_modulate_cmd(object_id: bytes) -> bytearray:
@ -686,7 +717,7 @@ class DirElement:
size: int
def handle_mpsoc_data_reply(action_id: int, pw: PrintWrapper, custom_data: bytearray):
def handle_mpsoc_data_reply(action_id: int, pw: PrintWrapper, custom_data: bytes):
if action_id == ActionId.TM_MEM_READ_RPT:
header_list = [
"PLOC Memory Address",
@ -714,11 +745,13 @@ def handle_mpsoc_data_reply(action_id: int, pw: PrintWrapper, custom_data: bytea
"PLOC MPSoC flash directory data shorter than minimum 16 bytes"
)
current_idx = 0
dir_name_short = custom_data[current_idx : current_idx + 12].decode("utf-8")
end_of_str = custom_data[current_idx : current_idx + 12].index(b"\x00")
dir_name_short = custom_data[current_idx : current_idx + end_of_str].decode()
current_idx += 12
num_elements = struct.unpack("!I", custom_data[current_idx : current_idx + 4])[
0
]
current_idx += 4
elem_names = []
elem_attrs = []
elem_sizes = []
@ -734,9 +767,7 @@ def handle_mpsoc_data_reply(action_id: int, pw: PrintWrapper, custom_data: bytea
# It is as weird as it looks..
for _ in range(num_elements):
end_of_str = custom_data[current_idx : current_idx + 12].index(b"\x00")
elem_name = custom_data[current_idx : current_idx + end_of_str].decode(
"utf-8"
)
elem_name = custom_data[current_idx : current_idx + end_of_str].decode()
current_idx += 12
elem_names.append(elem_name)
for _ in range(num_elements):

View File

@ -19,7 +19,7 @@ from tmtccmd.config.tmtc import CmdTreeNode
from tmtccmd.tmtc import DefaultPusQueueHelper
from tmtccmd.pus.s200_fsfw_mode import pack_mode_data, Mode
from tmtccmd.pus.s8_fsfw_action import create_action_cmd
from tmtccmd.fsfw.tmtc_printer import FsfwTmTcPrinter
from tmtccmd.fsfw.tmtc_printer import get_validity_buffer_str
from eive_tmtc.utility.input_helper import InputHelper
_LOGGER = logging.getLogger(__name__)
@ -112,7 +112,7 @@ class SupvActionId(enum.IntEnum):
REQUEST_ADC_REPORT = 57
RESET_PL = 58
ENABLE_NVMS = 59
CONTINUE_UPDATE = 60
RESUME_UPDATE = 60
MEM_CHECK = 61
@ -137,7 +137,7 @@ class OpCode:
SET_TIME_REF = "set_time_ref"
FACTORY_FLASH = "factory_flash"
START_UPDATE = "start_update"
PERFORM_UPDATE = "update"
RESUME_UPDATE = "resum_update"
FACTORY_RESET = "factory_reset"
MEM_CHECK = "mem_check"
RESET_MPSOC = "reset_mpsoc"
@ -156,7 +156,7 @@ class Info(str, enum.Enum):
SHUTDOWN_MPSOC = "Shutdown MPSoC"
SET_TIME_REF = "Set time reference"
FACTORY_FLASH = "Factory Flash Mode"
PERFORM_UPDATE = "Start or continue MPSoC SW update at starting bytes"
RESUME_UPDATE = "Start or continue MPSoC SW update at starting bytes"
START_UPDATE = "Start new MPSoC SW update"
FACTORY_RESET = "Factory Reset of loggers"
MEM_CHECK = "Memory Check"
@ -331,7 +331,7 @@ def pack_ploc_supv_commands(q: DefaultPusQueueHelper, cmd_str: str): # noqa C90
q.add_log_cmd("PLOC Supversior: Start new MPSoC SW update")
command = pack_update_command(object_id.as_bytes, True)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
if cmd_str in OpCode.PERFORM_UPDATE:
if cmd_str in OpCode.RESUME_UPDATE:
q.add_log_cmd("PLOC Supervisor: Perform MPSoC SW update")
command = pack_update_command(object_id.as_bytes, False)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
@ -370,7 +370,7 @@ def pack_ploc_supv_commands(q: DefaultPusQueueHelper, cmd_str: str): # noqa C90
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
if cmd_str == "58":
q.add_log_cmd("PLOC Supervisor: Continue update")
command = object_id.as_bytes + struct.pack("!I", SupvActionId.CONTINUE_UPDATE)
command = object_id.as_bytes + struct.pack("!I", SupvActionId.RESUME_UPDATE)
q.add_pus_tc(PusTelecommand(service=8, subservice=128, app_data=command))
if cmd_str == OpCode.MEM_CHECK:
custom_data = bytearray()
@ -650,8 +650,10 @@ def get_event_buffer_path() -> str:
class SocState(enum.IntEnum):
OFF = 0
BOOTING = 1
OPERATIONAL = 2
SHUTDOWN = 3
UPDATE = 2
OPERATIONAL = 3
RESET = 4
FAULTY = 5
def handle_supv_hk_data(set_id: int, hk_data: bytes, pw: PrintWrapper):
@ -691,12 +693,15 @@ def handle_hk_report(hk_data: bytes, pw: PrintWrapper):
pw.dlog(f"Temp PS {temp_ps} C | Temp PL {temp_pl} C | Temp SUP {temp_sup} C")
pw.dlog(f"Uptime {uptime} | CPU Load {cpu_load} | Avail Heap {avail_heap}")
pw.dlog(f"Number TCs {num_tcs} | Number TMs {num_tms}")
pw.dlog(f"SOC state {SocState(soc_state)}")
try:
pw.dlog(f"SOC state {SocState(soc_state)}")
except ValueError:
pw.dlog(f"Invalid SOC state {soc_state}")
pw.dlog(f"NVM 01 State {nvm_0_1_state}")
pw.dlog(f"NVM 3 State {nvm_3_state}")
pw.dlog(f"Mission IO state {mission_io_state}")
pw.dlog(f"FMC state {fmc_state}")
pw.dlog(FsfwTmTcPrinter.get_validity_buffer(hk_data[inc_len:], 13))
pw.dlog(get_validity_buffer_str(hk_data[inc_len:], 13))
def handle_boot_report(hk_data: bytes, pw: PrintWrapper):
@ -725,7 +730,7 @@ def handle_boot_report(hk_data: bytes, pw: PrintWrapper):
pw.dlog(f"Active NVM: {active_nvm}")
pw.dlog(f"BP0 State {bp_0_state} | BP1 State {bp_1_state} | BP2 State {bp_2_state}")
pw.dlog(f"Boot State {boot_state} | Boot Cycles {boot_cycles}")
FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], 10)
pw.dlog(get_validity_buffer_str(hk_data[current_idx:], 10))
def handle_adc_report(hk_data: bytes):

View File

@ -28,7 +28,7 @@ from tmtccmd.pus.s20_fsfw_param import (
)
from spacepackets.ecss.tc import PusTelecommand
from eive_tmtc.config.object_ids import PL_PCDU_ID
from tmtccmd.fsfw.tmtc_printer import FsfwTmTcPrinter
from tmtccmd.fsfw.tmtc_printer import get_validity_buffer_str
_LOGGER = logging.getLogger(__name__)
@ -615,8 +615,8 @@ def handle_plpcdu_hk(pw: PrintWrapper, set_id: int, hk_data: bytes):
pw.dlog(ch_print)
for i in range(12):
pw.dlog(f"{ADC_CHANNELS_NAMED[i].ljust(24)} | {processed_vals[i]}")
FsfwTmTcPrinter.get_validity_buffer(
validity_buffer=hk_data[current_idx:], num_vars=3
pw.dlog(
get_validity_buffer_str(validity_buffer=hk_data[current_idx:], num_vars=3)
)

View File

@ -18,7 +18,7 @@ from tmtccmd.tmtc import DefaultPusQueueHelper
from tmtccmd.pus.s200_fsfw_mode import Mode, pack_mode_data
from tmtccmd.pus.tc.s3_fsfw_hk import generate_one_hk_command, make_sid
from tmtccmd.util import ObjectIdU32
from tmtccmd.fsfw.tmtc_printer import FsfwTmTcPrinter
from tmtccmd.fsfw.tmtc_printer import get_validity_buffer_str
class SetId(enum.IntEnum):
@ -115,6 +115,6 @@ def handle_rad_sensor_data(pw: PrintWrapper, set_id: int, hk_data: bytes):
for idx, val in ain_dict.items():
pw.dlog(f"{idx} | {val:#06x} | {str(val).ljust(5)}")
current_idx += inc_len
FsfwTmTcPrinter.get_validity_buffer(
validity_buffer=hk_data[current_idx:], num_vars=7
pw.dlog(
get_validity_buffer_str(validity_buffer=hk_data[current_idx:], num_vars=7)
)

View File

@ -21,20 +21,27 @@ class ModeId(enum.IntEnum):
class OpCode(str, enum.Enum):
OFF = "off"
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):
OFF = "Off Command"
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]] = {
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):
info_prefix = "ACS Subsystem"
def create_payload_subsystem_cmd(q: DefaultPusQueueHelper, cmd_str: str):
info_prefix = "Payload Subsystem"
if cmd_str == OpCode.REPORT_ALL_MODES:
q.add_log_cmd(f"{info_prefix}: {Info.REPORT_ALL_MODES}")
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)
assert mode_info_tup is not None
if mode_info_tup is None:
return
pack_mode_cmd_with_info(
object_id=PL_SUBSYSTEM_ID,
info=f"{info_prefix}: {mode_info_tup[1]}",
submode=0,
mode=mode_info_tup[0],
submode=0,
q=q,
)
def create_payload_subsystem_node() -> CmdTreeNode:
payload_node = CmdTreeNode("payload", "Payload Subsystem")
payload_node.add_child(CmdTreeNode(OpCode.OFF, Info.OFF))
payload_node.add_child(CmdTreeNode(OpCode.REPORT_ALL_MODES, Info.REPORT_ALL_MODES))
subsystem_node = CmdTreeNode("subsystem", "Subsystem Commands")
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

View File

@ -82,7 +82,7 @@ def pack_acu_commands(object_id: ObjectIdU32, q: DefaultPusQueueHelper, cmd_str:
def acu_req_hk_cmds(q: DefaultPusQueueHelper, op_code: str):
req_hk_cmds("ACU", q, op_code, ACU_HANDLER_ID, [SetId.CORE, SetId.AUX])
req_hk_cmds("ACU", q, op_code, ACU_HANDLER_ID, (SetId.CORE, SetId.AUX))
class ACUTestProcedure:

View File

@ -5,7 +5,7 @@ from spacepackets.ecss import PusTelecommand
from tmtccmd.config.tmtc import (
CmdTreeNode,
)
from tmtccmd.fsfw.tmtc_printer import FsfwTmTcPrinter
from tmtccmd.fsfw.tmtc_printer import get_validity_buffer_str
from tmtccmd.pus.s8_fsfw_action import create_action_cmd
from tmtccmd.pus.s200_fsfw_mode import Mode, pack_mode_data
from tmtccmd.pus.s200_fsfw_mode import Subservice as ModeSubservices
@ -213,9 +213,7 @@ def handle_bpx_hk_data(pw: PrintWrapper, set_id: int, hk_data: bytes):
validity_buffer = hk_data[inc_len:]
pw.dlog(str(HEADER_LIST))
pw.dlog(str(content_list))
FsfwTmTcPrinter.get_validity_buffer(
validity_buffer=validity_buffer, num_vars=10
)
pw.dlog(get_validity_buffer_str(validity_buffer=validity_buffer, num_vars=10))
elif set_id == BpxSetId.GET_CFG_SET:
battheat_mode = hk_data[0]
battheat_low = struct.unpack("!b", hk_data[1:2])[0]
@ -229,6 +227,4 @@ def handle_bpx_hk_data(pw: PrintWrapper, set_id: int, hk_data: bytes):
validity_buffer = hk_data[3:]
pw.dlog(str(header_list))
pw.dlog(str(content_list))
FsfwTmTcPrinter.get_validity_buffer(
validity_buffer=validity_buffer, num_vars=10
)
pw.dlog(get_validity_buffer_str(validity_buffer=validity_buffer, num_vars=10))

View File

@ -259,4 +259,4 @@ def create_p60_dock_node() -> CmdTreeNode:
def p60_dock_req_hk_cmds(q: DefaultPusQueueHelper, op_code: str):
req_hk_cmds("P60 Dock", q, op_code, P60_DOCK_HANDLER, [SetId.CORE, SetId.AUX])
req_hk_cmds("P60 Dock", q, op_code, P60_DOCK_HANDLER, (SetId.CORE, SetId.AUX))

View File

@ -98,7 +98,7 @@ def pack_pdu1_commands(object_id: ObjectIdU32, q: DefaultPusQueueHelper, cmd_str
def pdu1_req_hk_cmds(q: DefaultPusQueueHelper, op_code: str):
req_hk_cmds("PDU1", q, op_code, PDU_1_HANDLER_ID, [SetId.CORE, SetId.AUX])
req_hk_cmds("PDU1", q, op_code, PDU_1_HANDLER_ID, (SetId.CORE, SetId.AUX))
def info_on_pdu1(base: str) -> str:

View File

@ -332,7 +332,7 @@ def add_pdu2_common_defs(oce: OpCodeEntry):
def pdu2_req_hk_cmds(q: DefaultPusQueueHelper, op_code: str):
req_hk_cmds("PDU2", q, op_code, PDU_2_HANDLER_ID, [SetId.CORE, SetId.AUX])
req_hk_cmds("PDU2", q, op_code, PDU_2_HANDLER_ID, (SetId.CORE, SetId.AUX))
def pl_pcdu_bat_nom_on_cmd(q: DefaultPusQueueHelper):

View File

@ -6,7 +6,7 @@ import struct
from tmtccmd.config.tmtc import (
CmdTreeNode,
)
from tmtccmd.fsfw.tmtc_printer import FsfwTmTcPrinter
from tmtccmd.fsfw.tmtc_printer import get_validity_buffer_str
from tmtccmd.pus.s20_fsfw_param import create_load_param_cmd
from tmtccmd.pus.s20_fsfw_param_defs import (
create_scalar_double_parameter,
@ -268,7 +268,7 @@ def handle_core_hk_data(pw: PrintWrapper, hk_data: bytes):
pw.dlog(f"Total Battery Current: {total_battery_current} [mA]")
pw.dlog(f"Open Circuit Voltage Charge: {open_circuit_voltage_charge*100:8.3f} [%]")
pw.dlog(f"Coulomb Counter Charge: {coulomb_counter_charge*100:8.3f} [%]")
FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=3)
pw.dlog(get_validity_buffer_str(hk_data[current_idx:], num_vars=3))
def handle_enable_pl_data(pw: PrintWrapper, hk_data: bytes):
@ -284,4 +284,4 @@ def handle_enable_pl_data(pw: PrintWrapper, hk_data: bytes):
)[0]
current_idx += inc_len_uint16
pw.dlog(f"PL Use Allowed: {pl_use_allowed}")
FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], num_vars=1)
pw.dlog(get_validity_buffer_str(hk_data[current_idx:], num_vars=1))

View File

@ -13,7 +13,7 @@ from eive_tmtc.tmtc.power.common_power import (
)
from eive_tmtc.tmtc.power.power import PcduSetIds
from tmtccmd.util import ObjectIdBase
from tmtccmd.fsfw.tmtc_printer import FsfwTmTcPrinter
from tmtccmd.fsfw.tmtc_printer import FsfwTmTcPrinter, get_validity_buffer_str
from eive_tmtc.pus_tm.defs import PrintWrapper
from eive_tmtc.gomspace.gomspace_common import GomspaceDeviceActionId
from eive_tmtc.config.object_ids import (
@ -125,6 +125,8 @@ class DevicesInfoParser:
return current_idx
def print(self, pw: PrintWrapper):
if self.dev_types is None or self.dev_statuses is None:
return
pw.dlog("Device Type | Device State (0:None | 1:OK | 3:ERROR | 4:NOT FOUND)")
for i in range(len(self.dev_types)):
pw.dlog(
@ -372,8 +374,8 @@ def handle_p60_hk_data(pw: PrintWrapper, set_id: int, hk_data: bytes):
temps = f"In C: Temp 0 {temp_0} | Temp 1 {temp_1} | "
pw.dlog(temps)
pw.dlog(batt_info)
FsfwTmTcPrinter.get_validity_buffer(
validity_buffer=hk_data[current_idx:], num_vars=9
pw.dlog(
get_validity_buffer_str(validity_buffer=hk_data[current_idx:], num_vars=9)
)
if set_id == SetId.AUX:
pw.dlog("Received P60 AUX HK. Voltages in mV, currents in mA")
@ -440,8 +442,8 @@ def handle_p60_hk_data(pw: PrintWrapper, set_id: int, hk_data: bytes):
"6:TempSens(BatPack)|7:TempSens(BatPack)"
)
dev_parser.print(pw=pw)
FsfwTmTcPrinter.get_validity_buffer(
validity_buffer=hk_data[current_idx:], num_vars=27
pw.dlog(
get_validity_buffer_str(validity_buffer=hk_data[current_idx:], num_vars=27)
)
@ -493,8 +495,8 @@ def handle_acu_hk_data(pw: PrintWrapper, set_id: int, hk_data: bytes):
f"Boot Count {bootcnt} | Uptime {uptime} sec | "
f"MPPT Time {mppt_time} msec | MPPT Period {mppt_period} msec"
)
FsfwTmTcPrinter.get_validity_buffer(
validity_buffer=hk_data[current_idx:], num_vars=12
pw.dlog(
get_validity_buffer_str(validity_buffer=hk_data[current_idx:], num_vars=12)
)
if set_id == SetId.AUX:
current_idx = 0
@ -531,13 +533,13 @@ def handle_acu_hk_data(pw: PrintWrapper, set_id: int, hk_data: bytes):
"ACU Dev Types: 0:FRAM|1:ADC|2:ADC|3:DAC|4:DAC|5:DAC|6:TempSens|7:Reserved"
)
dev_parser.print(pw=pw)
FsfwTmTcPrinter.get_validity_buffer(
validity_buffer=hk_data[current_idx:], num_vars=8
pw.dlog(
get_validity_buffer_str(validity_buffer=hk_data[current_idx:], num_vars=8)
)
def handle_get_param_data_reply(
obj_id: ObjectIdBase, action_id: int, pw: PrintWrapper, custom_data: bytearray
obj_id: ObjectIdBase, action_id: int, pw: PrintWrapper, custom_data: bytes
):
if action_id == GomspaceDeviceActionId.PARAM_GET:
pw.dlog(f"Parameter Get Request received for object {obj_id}")
@ -677,4 +679,4 @@ def handle_pcdu_hk(pw: PrintWrapper, set_id: int, hk_data: bytes):
pw.dlog(f"{name.ljust(25)}: {val}")
pw.dlog(f"{'P60 Dock 5V Stack'.ljust(25)}: {p60_stack_5v_val}")
pw.dlog(f"{'P60 Dock 3V3 Stack'.ljust(25)}: {p60_stack_3v3_val}")
FsfwTmTcPrinter.get_validity_buffer(hk_data[current_idx:], 4)
pw.dlog(get_validity_buffer_str(hk_data[current_idx:], 4))

View File

@ -59,7 +59,7 @@ CTN = CmdTreeNode
def create_heater_node() -> CmdTreeNode:
node = CmdTreeNode("heater", "Heater Device", hide_children_which_are_leaves=True)
node = CmdTreeNode("heaters", "Heater Device", hide_children_which_are_leaves=True)
node.add_child(CTN(OpCode.HEATER_CMD, Info.HEATER_CMD))
node.add_child(CTN(OpCode.HEATER_HEALTHY_CMD, Info.HEATER_HEALTHY_CMD))
node.add_child(CTN(OpCode.HEATER_EXT_CTRL, Info.HEATER_EXT_CTRL))

View File

@ -13,7 +13,7 @@ from tmtccmd.util import ObjectIdU32
from tmtccmd.pus.s200_fsfw_mode import Mode, pack_mode_data, Subservice
import eive_tmtc.config.object_ids as oids
from eive_tmtc.config.object_ids import get_object_ids
from tmtccmd.fsfw.tmtc_printer import FsfwTmTcPrinter
from tmtccmd.fsfw.tmtc_printer import get_validity_buffer_str
RTD_IDS = [
oids.RTD_0_PLOC_HSPD,
@ -170,7 +170,7 @@ def handle_rtd_hk(object_id: bytes, hk_data: bytes, pw: PrintWrapper):
pw.dlog(f"RTD Value: {rtd_val}")
pw.dlog(f"Error Byte: {error_byte}")
pw.dlog(f"Last Error Byte: {last_err_byte}")
FsfwTmTcPrinter.get_validity_buffer(hk_data[fmt_len:], 4)
pw.dlog(get_validity_buffer_str(hk_data[fmt_len:], 4))
def prompt_rtd_idx():

View File

@ -18,7 +18,7 @@ from tmtccmd.config.tmtc import (
TmtcDefinitionWrapper,
OpCodeEntry,
)
from tmtccmd.fsfw.tmtc_printer import FsfwTmTcPrinter
from tmtccmd.fsfw.tmtc_printer import get_validity_buffer_str
from tmtccmd.tmtc import DefaultPusQueueHelper
from tmtccmd.pus.s200_fsfw_mode import Mode, pack_mode_data
from tmtccmd.pus.tc.s3_fsfw_hk import create_request_one_hk_command, make_sid
@ -96,4 +96,4 @@ def handle_tmp_1075_hk_data(set_id: int, hk_data: bytes, pw: PrintWrapper):
if set_id == SetId.TEMPERATURE:
temp = struct.unpack("!f", hk_data[0:4])[0]
pw.dlog(f"TMP1075 Temperature: {temp}")
pw.dlog(FsfwTmTcPrinter.get_validity_buffer(hk_data[4:], 1))
pw.dlog(get_validity_buffer_str(hk_data[4:], 1))

View File

@ -1,6 +1,7 @@
import enum
import struct
import logging
from datetime import datetime
import datetime
from spacepackets.ecss import PusTelecommand, PusService
@ -8,28 +9,34 @@ from tmtccmd.tmtc import DefaultPusQueueHelper
from tmtccmd.config import CmdTreeNode
_LOGGER = logging.getLogger(__name__)
class Subservice(enum.IntEnum):
SET_TIME = 128
DUMP_TIME = 129
RELATIVE_TIMESHIFT = 130
class CmdStr:
SET_CURRENT_TIME = "set_curr_time"
RELATIVE_TIMESHIFT = "relative_timeshift"
DUMP_TIME = "dump_time"
class Info:
SET_CURRENT_TIME = "Setting current time in ASCII format"
RELATIVE_TIMESHIFT = "Shift time with a relative offset"
DUMP_TIME = "Dump system time as event"
def pack_time_management_cmd(q: DefaultPusQueueHelper, cmd_str: str):
if cmd_str == CmdStr.SET_CURRENT_TIME:
current_time = datetime.utcnow().isoformat() + "Z" + "\0"
current_time_ascii = current_time.encode("ascii")
logging.getLogger(__name__).info(
f"Current time in ASCII format: {current_time_ascii}"
current_time = (
datetime.datetime.now(datetime.timezone.utc).isoformat() + "Z" + "\0"
)
current_time_ascii = current_time.encode("ascii")
_LOGGER.info(f"Current time in ASCII format: {current_time_ascii}")
q.add_log_cmd(Info.SET_CURRENT_TIME)
q.add_pus_tc(
PusTelecommand(
@ -38,6 +45,17 @@ def pack_time_management_cmd(q: DefaultPusQueueHelper, cmd_str: str):
app_data=current_time_ascii,
)
)
elif cmd_str == CmdStr.RELATIVE_TIMESHIFT:
nanos = int(input("Specify relative timeshift in nanoseconds: "))
nanos_packed = struct.pack("!q", nanos)
q.add_log_cmd(Info.RELATIVE_TIMESHIFT)
q.add_pus_tc(
PusTelecommand(
service=PusService.S9_TIME_MGMT,
subservice=Subservice.RELATIVE_TIMESHIFT,
app_data=nanos_packed,
)
)
elif cmd_str == CmdStr.DUMP_TIME:
q.add_log_cmd(Info.DUMP_TIME)
q.add_pus_tc(
@ -51,4 +69,5 @@ def create_time_node() -> CmdTreeNode:
time_node = CmdTreeNode("time", "Time Management")
time_node.add_child(CmdTreeNode(CmdStr.SET_CURRENT_TIME, "Set current time"))
time_node.add_child(CmdTreeNode(CmdStr.DUMP_TIME, "Dumpy current time"))
time_node.add_child(CmdTreeNode(CmdStr.RELATIVE_TIMESHIFT, Info.RELATIVE_TIMESHIFT))
return time_node

View File

@ -107,6 +107,7 @@ def pack_tm_store_commands(q: DefaultPusQueueHelper, cmd_path: str):
def create_persistent_tm_store_node() -> CmdTreeNode:
node = CmdTreeNode("tm_store", "Persistent TM Store")
node.add_child(CmdTreeNode(OpCode.DELETE_UP_TO, Info.DELETE_UP_TO))
node.add_child(CmdTreeNode(OpCode.DELETE_BY_TIME_RANGE, Info.DELETE_BY_TIME_RANGE))
node.add_child(
CmdTreeNode(OpCode.RETRIEVAL_BY_TIME_RANGE, Info.RETRIEVAL_BY_TIME_RANGE)
)

View File

@ -6,33 +6,33 @@ build-backend = "setuptools.build_meta"
name = "eive-tmtc"
description = "TMTC Commander EIVE"
readme = "README.md"
version = "6.0.0"
version = "7.1.0"
requires-python = ">=3.10"
license = {text = "Apache-2.0"}
authors = [
{name = "Robin Mueller", email = "muellerr@irs.uni-stuttgart.de"},
{name = "Jakob Meier", email = "meierj@irs.uni-stuttgart.de"},
{name = "Robin Mueller", email = "muellerr@irs.uni-stuttgart.de"},
{name = "Jakob Meier", email = "meierj@irs.uni-stuttgart.de"},
]
keywords = ["eive", "space", "communication", "commanding"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: Apache Software License",
"Natural Language :: English",
"Operating System :: POSIX",
"Operating System :: Microsoft :: Windows",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Topic :: Communications",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Scientific/Engineering"
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: Apache Software License",
"Natural Language :: English",
"Operating System :: POSIX",
"Operating System :: Microsoft :: Windows",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Topic :: Communications",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Scientific/Engineering"
]
dependencies = [
"tmtccmd ~= 8.0.0rc1",
"tmtccmd ~= 8.0.1",
# "tmtccmd @ git+https://github.com/robamu-org/tmtccmd@main",
"cfdp-py~=0.1.0",
# "tmtccmd @ git+https://github.com/robamu-org/tmtccmd@main",
"python-dateutil ~= 2.8",
"python-dateutil ~= 2.8",
]
[project.urls]
@ -45,7 +45,7 @@ include-package-data = true
[tool.setuptools.packages]
find = {}
[tool.ruff]
[tool.ruff.lint]
ignore = ["E501"]
[tool.ruff.extend-per-file-ignores]
[tool.ruff.lint.extend-per-file-ignores]
"__init__.py" = ["F401"]

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)
else:
hk_level = 0
if params.app_params.print_tree:
perform_tree_printout(params.app_params, hook_obj.get_command_definitions())
if params.cmd_params.print_tree:
perform_tree_printout(params.cmd_params, hook_obj.get_command_definitions())
sys.exit(0)
params.apid = PUS_APID
if params.com_if is None: