Compare commits
19 Commits
Author | SHA1 | Date | |
---|---|---|---|
d23cc6834a | |||
33cff5e2d2
|
|||
acbcbbe98f
|
|||
c3b0470aa6
|
|||
e56f8732be | |||
af5e81158c
|
|||
d285b1caec | |||
1f49f0c70d
|
|||
b1fbad39e3 | |||
de57b9da5b | |||
f02230804d | |||
8ddcc37c74 | |||
b50c75c13c | |||
36799ef51d
|
|||
772ef5b323
|
|||
2f8bed4581
|
|||
72def77d40
|
|||
957d756d1e | |||
0a05873f4e |
12
CHANGELOG.md
12
CHANGELOG.md
@ -10,6 +10,18 @@ list yields a list of all related PRs for each release.
|
|||||||
|
|
||||||
# [unreleased]
|
# [unreleased]
|
||||||
|
|
||||||
|
# [v5.5.0] 2023-09-12
|
||||||
|
|
||||||
|
- Version is not specfied dynamically anymore and can be updated in `pyproject.toml`
|
||||||
|
- New events and returnvalues
|
||||||
|
- Bump `tmtccmd` to v6.0.0rc0
|
||||||
|
|
||||||
|
# [v5.4.3] 2023-08-15
|
||||||
|
|
||||||
|
## Added
|
||||||
|
|
||||||
|
- PLOC SUPV HK parsing.
|
||||||
|
|
||||||
# [v5.4.2] 2023-08-15
|
# [v5.4.2] 2023-08-15
|
||||||
|
|
||||||
## Added
|
## Added
|
||||||
|
@ -1,13 +1,6 @@
|
|||||||
__version__ = "5.4.2"
|
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
SW_NAME = "eive-tmtc"
|
|
||||||
VERSION_MAJOR = 5
|
|
||||||
VERSION_MINOR = 4
|
|
||||||
VERSION_REVISION = 2
|
|
||||||
|
|
||||||
EIVE_TMTC_ROOT = Path(__file__).parent
|
EIVE_TMTC_ROOT = Path(__file__).parent
|
||||||
PACKAGE_ROOT = EIVE_TMTC_ROOT.parent
|
PACKAGE_ROOT = EIVE_TMTC_ROOT.parent
|
||||||
|
|
||||||
|
@ -303,3 +303,5 @@ Event ID (dec); Event ID (hex); Name; Severity; Description; File Path
|
|||||||
14312;0x37e8;DUMP_MISC_CANCELLED;LOW;P1: Number of dumped packets. P2: Total dumped bytes.;mission/persistentTmStoreDefs.h
|
14312;0x37e8;DUMP_MISC_CANCELLED;LOW;P1: Number of dumped packets. P2: Total dumped bytes.;mission/persistentTmStoreDefs.h
|
||||||
14313;0x37e9;DUMP_HK_CANCELLED;LOW;P1: Number of dumped packets. P2: Total dumped bytes.;mission/persistentTmStoreDefs.h
|
14313;0x37e9;DUMP_HK_CANCELLED;LOW;P1: Number of dumped packets. P2: Total dumped bytes.;mission/persistentTmStoreDefs.h
|
||||||
14314;0x37ea;DUMP_CFDP_CANCELLED;LOW;P1: Number of dumped packets. P2: Total dumped bytes.;mission/persistentTmStoreDefs.h
|
14314;0x37ea;DUMP_CFDP_CANCELLED;LOW;P1: Number of dumped packets. P2: Total dumped bytes.;mission/persistentTmStoreDefs.h
|
||||||
|
14500;0x38a4;TEMPERATURE_ALL_ONES_START;MEDIUM;Detected invalid values, starting invalid message counting;mission/acs/SusHandler.h
|
||||||
|
14501;0x38a5;TEMPERATURE_ALL_ONES_RECOVERY;INFO;Detected valid values again, resetting invalid message counter. P1: Invalid message counter.;mission/acs/SusHandler.h
|
||||||
|
|
@ -60,3 +60,4 @@
|
|||||||
142;COM_SUBSYSTEM
|
142;COM_SUBSYSTEM
|
||||||
143;PERSISTENT_TM_STORE
|
143;PERSISTENT_TM_STORE
|
||||||
144;SYRLINKS_COM
|
144;SYRLINKS_COM
|
||||||
|
145;SUS_HANDLER
|
||||||
|
|
@ -1018,7 +1018,7 @@ def handle_gps_data_processed(pw: PrintWrapper, hk_data: bytes):
|
|||||||
inc_len_source = struct.calcsize(fmt_source)
|
inc_len_source = struct.calcsize(fmt_source)
|
||||||
inc_len_scalar = struct.calcsize(fmt_scalar)
|
inc_len_scalar = struct.calcsize(fmt_scalar)
|
||||||
inc_len_vec = struct.calcsize(fmt_vec)
|
inc_len_vec = struct.calcsize(fmt_vec)
|
||||||
if len(hk_data) < 2 * inc_len_scalar + 2 * inc_len_vec + inc_len_source:
|
if len(hk_data) < 3 * inc_len_scalar + 2 * inc_len_vec + inc_len_source:
|
||||||
pw.dlog("Received HK set too small")
|
pw.dlog("Received HK set too small")
|
||||||
return
|
return
|
||||||
current_idx = 0
|
current_idx = 0
|
||||||
|
@ -74,7 +74,7 @@ def add_gps_cmds(defs: TmtcDefinitionWrapper):
|
|||||||
|
|
||||||
def pack_gps_command( # noqa: C901
|
def pack_gps_command( # noqa: C901
|
||||||
object_id: bytes, q: DefaultPusQueueHelper, op_code: str
|
object_id: bytes, q: DefaultPusQueueHelper, op_code: str
|
||||||
): # noqa: C901
|
): # noqa: C901:
|
||||||
if op_code in OpCode.RESET_GNSS:
|
if op_code in OpCode.RESET_GNSS:
|
||||||
# TODO: This needs to be re-implemented
|
# TODO: This needs to be re-implemented
|
||||||
_LOGGER.warning("Reset pin handling needs to be re-implemented")
|
_LOGGER.warning("Reset pin handling needs to be re-implemented")
|
||||||
@ -217,7 +217,7 @@ def handle_skyview_data(pw: PrintWrapper, hk_data: bytes):
|
|||||||
inc_len_uint8 = struct.calcsize(fmt_str_uint8)
|
inc_len_uint8 = struct.calcsize(fmt_str_uint8)
|
||||||
unix = struct.unpack(
|
unix = struct.unpack(
|
||||||
fmt_str_unix, hk_data[current_idx : current_idx + inc_len_unix]
|
fmt_str_unix, hk_data[current_idx : current_idx + inc_len_unix]
|
||||||
)
|
)[0]
|
||||||
current_idx += inc_len_unix
|
current_idx += inc_len_unix
|
||||||
prn_id = struct.unpack(
|
prn_id = struct.unpack(
|
||||||
fmt_str_int16, hk_data[current_idx : current_idx + inc_len_int16]
|
fmt_str_int16, hk_data[current_idx : current_idx + inc_len_int16]
|
||||||
|
@ -722,10 +722,42 @@ def get_event_buffer_path() -> str:
|
|||||||
return file
|
return file
|
||||||
|
|
||||||
|
|
||||||
|
class SocState(enum.IntEnum):
|
||||||
|
OFF = 0
|
||||||
|
BOOTING = 1
|
||||||
|
OPERATIONAL = 2
|
||||||
|
SHUTDOWN = 3
|
||||||
|
|
||||||
|
|
||||||
def handle_supv_hk_data(set_id: int, hk_data: bytes, pw: PrintWrapper):
|
def handle_supv_hk_data(set_id: int, hk_data: bytes, pw: PrintWrapper):
|
||||||
current_idx = 0
|
current_idx = 0
|
||||||
if set_id == SetIds.HK_REPORT:
|
if set_id == SetIds.HK_REPORT:
|
||||||
pass
|
fmt_str = "!IIIQIIIIIBBBB"
|
||||||
|
inc_len = struct.calcsize(fmt_str)
|
||||||
|
(
|
||||||
|
temp_ps,
|
||||||
|
temp_pl,
|
||||||
|
temp_sup,
|
||||||
|
uptime,
|
||||||
|
cpu_load,
|
||||||
|
avail_heap,
|
||||||
|
num_tcs,
|
||||||
|
num_tms,
|
||||||
|
soc_state,
|
||||||
|
nvm_0_1_state,
|
||||||
|
nvm_3_state,
|
||||||
|
mission_io_state,
|
||||||
|
fmc_state,
|
||||||
|
) = struct.unpack(fmt_str, hk_data[:inc_len])
|
||||||
|
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)}")
|
||||||
|
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))
|
||||||
elif set_id == SetIds.BOOT_STATUS_REPORT:
|
elif set_id == SetIds.BOOT_STATUS_REPORT:
|
||||||
fmt_str = "!BBIIBBBBBB"
|
fmt_str = "!BBIIBBBBBB"
|
||||||
inc_len = struct.calcsize(fmt_str)
|
inc_len = struct.calcsize(fmt_str)
|
||||||
|
@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
|
|||||||
name = "eive-tmtc"
|
name = "eive-tmtc"
|
||||||
description = "TMTC Commander EIVE"
|
description = "TMTC Commander EIVE"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
dynamic = ["version"]
|
version = "5.5.0"
|
||||||
requires-python = ">=3.10"
|
requires-python = ">=3.10"
|
||||||
license = {text = "Apache-2.0"}
|
license = {text = "Apache-2.0"}
|
||||||
authors = [
|
authors = [
|
||||||
@ -29,9 +29,8 @@ classifiers = [
|
|||||||
"Topic :: Scientific/Engineering"
|
"Topic :: Scientific/Engineering"
|
||||||
]
|
]
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"tmtccmd ~= 5.0",
|
"tmtccmd == 6.0.0rc0",
|
||||||
"python-dateutil ~= 2.8",
|
"python-dateutil ~= 2.8",
|
||||||
# "tmtccmd @ git+https://github.com/robamu-org/tmtccmd@1b110d321ef85#egg=tmtccmd"
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[project.urls]
|
[project.urls]
|
||||||
@ -40,9 +39,6 @@ dependencies = [
|
|||||||
[tool.setuptools]
|
[tool.setuptools]
|
||||||
include-package-data = true
|
include-package-data = true
|
||||||
|
|
||||||
[tool.setuptools.dynamic]
|
|
||||||
version = {attr = "eive_tmtc.__version__"}
|
|
||||||
|
|
||||||
# Auto-Discovery is problematic for some reason, so use custom-discovery
|
# Auto-Discovery is problematic for some reason, so use custom-discovery
|
||||||
[tool.setuptools.packages]
|
[tool.setuptools.packages]
|
||||||
find = {}
|
find = {}
|
||||||
|
@ -3,7 +3,7 @@ Checklist for new releases
|
|||||||
|
|
||||||
# Pre-Release
|
# Pre-Release
|
||||||
|
|
||||||
1. Bump version inside the `eive_tmtc/__init__.py` file.
|
1. Bump version inside the `pyproject.toml` file.
|
||||||
2. Update `CHANGELOG.md`: Convert `unreleased` section into version section
|
2. Update `CHANGELOG.md`: Convert `unreleased` section into version section
|
||||||
with date and new `unreleased`section.
|
with date and new `unreleased`section.
|
||||||
3. Run auto-formatter with `black .`
|
3. Run auto-formatter with `black .`
|
||||||
|
33
tmtcc.py
33
tmtcc.py
@ -2,10 +2,11 @@
|
|||||||
import logging
|
import logging
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
import traceback
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import cast
|
from typing import cast
|
||||||
|
|
||||||
|
from spacepackets.ecss import PusVerificator
|
||||||
|
from spacepackets.version import get_version as get_sp_version
|
||||||
from spacepackets.ccsds import SPACE_PACKET_HEADER_SIZE
|
from spacepackets.ccsds import SPACE_PACKET_HEADER_SIZE
|
||||||
from spacepackets.cfdp import (
|
from spacepackets.cfdp import (
|
||||||
ConditionCode,
|
ConditionCode,
|
||||||
@ -16,6 +17,8 @@ from spacepackets.cfdp import (
|
|||||||
PduFactory,
|
PduFactory,
|
||||||
PduType,
|
PduType,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
import tmtccmd
|
||||||
from tmtccmd.logging import add_colorlog_console_logger
|
from tmtccmd.logging import add_colorlog_console_logger
|
||||||
from tmtccmd.cfdp import CfdpUserBase, TransactionId
|
from tmtccmd.cfdp import CfdpUserBase, TransactionId
|
||||||
from tmtccmd.cfdp.defs import CfdpRequestType
|
from tmtccmd.cfdp.defs import CfdpRequestType
|
||||||
@ -32,28 +35,6 @@ from tmtccmd.cfdp.user import (
|
|||||||
FileSegmentRecvdParams,
|
FileSegmentRecvdParams,
|
||||||
)
|
)
|
||||||
from tmtccmd.tc.handler import SendCbParams
|
from tmtccmd.tc.handler import SendCbParams
|
||||||
|
|
||||||
try:
|
|
||||||
import spacepackets
|
|
||||||
except ImportError as error:
|
|
||||||
print(error)
|
|
||||||
print("Python spacepackets module could not be imported")
|
|
||||||
print(
|
|
||||||
'Install with "cd spacepackets && python3 -m pip intall -e ." for interative installation'
|
|
||||||
)
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
try:
|
|
||||||
import tmtccmd
|
|
||||||
except ImportError:
|
|
||||||
run_tmtc_commander = None
|
|
||||||
initialize_tmtc_commander = None
|
|
||||||
tb = traceback.format_exc()
|
|
||||||
print(tb)
|
|
||||||
print("Python tmtccmd submodule could not be imported")
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
from spacepackets.ecss import PusVerificator
|
|
||||||
from tmtccmd import TcHandlerBase, BackendBase
|
from tmtccmd import TcHandlerBase, BackendBase
|
||||||
from tmtccmd.util import FileSeqCountProvider, PusFileSeqCountProvider
|
from tmtccmd.util import FileSeqCountProvider, PusFileSeqCountProvider
|
||||||
from tmtccmd.fsfw.tmtc_printer import FsfwTmTcPrinter
|
from tmtccmd.fsfw.tmtc_printer import FsfwTmTcPrinter
|
||||||
@ -86,7 +67,7 @@ from tmtccmd.config.args import (
|
|||||||
ProcedureParamsWrapper,
|
ProcedureParamsWrapper,
|
||||||
)
|
)
|
||||||
from eive_tmtc import APP_LOGGER
|
from eive_tmtc import APP_LOGGER
|
||||||
from eive_tmtc import __version__
|
from importlib.metadata import version
|
||||||
from eive_tmtc.config.definitions import (
|
from eive_tmtc.config.definitions import (
|
||||||
PUS_APID,
|
PUS_APID,
|
||||||
CFDP_APID,
|
CFDP_APID,
|
||||||
@ -449,8 +430,8 @@ def setup_backend(
|
|||||||
|
|
||||||
|
|
||||||
def main(): # noqa C901: Complexity okay here.
|
def main(): # noqa C901: Complexity okay here.
|
||||||
print(f"-- eive tmtc v{__version__} --")
|
print(f"-- eive tmtc v{version('eive-tmtc')} --")
|
||||||
print(f"-- spacepackets v{spacepackets.__version__} --")
|
print(f"-- spacepackets v{get_sp_version()} --")
|
||||||
add_colorlog_console_logger(_LOGGER)
|
add_colorlog_console_logger(_LOGGER)
|
||||||
# TODO: -V CLI argument to enable this?
|
# TODO: -V CLI argument to enable this?
|
||||||
_LOGGER.setLevel(_LOG_LEVEL)
|
_LOGGER.setLevel(_LOG_LEVEL)
|
||||||
|
Reference in New Issue
Block a user