Merge branch 'develop' into mohr/looooop
This commit is contained in:
commit
de50dcc7fc
@ -12,6 +12,10 @@ list yields a list of all related PRs for each release.
|
|||||||
|
|
||||||
# [v1.11.0]
|
# [v1.11.0]
|
||||||
|
|
||||||
|
- Add `setup.cfg` and `setup.py` file, allowing package installation
|
||||||
|
- New ploc commands
|
||||||
|
- Removed commands related to obsolete ploc updater component
|
||||||
|
- Adds `tmtcloop.py`, which allows receiving TMs continously while being able to send TCs at will.
|
||||||
- Added more RW HK handling and RW Assembly commands
|
- Added more RW HK handling and RW Assembly commands
|
||||||
- Pack additional parameter which identifiers whether heater is commanded externally or internally
|
- Pack additional parameter which identifiers whether heater is commanded externally or internally
|
||||||
PR: https://egit.irs.uni-stuttgart.de/eive/eive-tmtc/pulls/67
|
PR: https://egit.irs.uni-stuttgart.de/eive/eive-tmtc/pulls/67
|
||||||
|
130
README.md
130
README.md
@ -1,5 +1,92 @@
|
|||||||
# TMTC Commander EIVE
|
# TMTC Commander EIVE
|
||||||
|
|
||||||
|
This application can be used to test the EIVE On-Board Software. Furthermore, it can
|
||||||
|
also be used to retrieve all sorts of telemetry data like housekeeping data.
|
||||||
|
|
||||||
|
It is recommended to use this application with a virtual environment.
|
||||||
|
The [virtual environemnt](#venv) chapter describes how to set one up. The [requirements](#reqs)
|
||||||
|
describes how to install all required packages.
|
||||||
|
|
||||||
|
The configuration file can currently be found at `tmtc_conf.json`. It caches settings
|
||||||
|
like the default communication interface or parameters like the TCP port when using the TCP
|
||||||
|
communication interface.
|
||||||
|
|
||||||
|
# Examples
|
||||||
|
|
||||||
|
Assuming you are running in a [virtual environment](#venv) and all [package requirements](#reqs)
|
||||||
|
were installed properly.
|
||||||
|
|
||||||
|
Run CLI mode
|
||||||
|
|
||||||
|
```sh
|
||||||
|
./tmtccli.py
|
||||||
|
```
|
||||||
|
|
||||||
|
Run GUI mode
|
||||||
|
|
||||||
|
```sh
|
||||||
|
./tmtcgui.py
|
||||||
|
```
|
||||||
|
|
||||||
|
# <a id="venv"></a> Set up virtual environment
|
||||||
|
|
||||||
|
## Linux
|
||||||
|
|
||||||
|
1. Create virtual environment
|
||||||
|
|
||||||
|
```sh
|
||||||
|
python3 -m venv venv
|
||||||
|
```
|
||||||
|
|
||||||
|
2. Activate virtual environment
|
||||||
|
|
||||||
|
```sh
|
||||||
|
. venv/bin/activate
|
||||||
|
```
|
||||||
|
|
||||||
|
## Windows
|
||||||
|
|
||||||
|
1. Create virtual environment
|
||||||
|
|
||||||
|
```sh
|
||||||
|
py -m venv .
|
||||||
|
```
|
||||||
|
|
||||||
|
2. Activate virtual environment
|
||||||
|
|
||||||
|
```sh
|
||||||
|
venv\Scripts\activate.bat
|
||||||
|
```
|
||||||
|
|
||||||
|
# <a id="reqs"></a> Install requirements
|
||||||
|
|
||||||
|
There are two ways to install the requirements. One is to install the primary dependency
|
||||||
|
`tmtccmd` interactively. This is the recommended way
|
||||||
|
|
||||||
|
Assuming you are running in a virtual environment:
|
||||||
|
|
||||||
|
1. Install `tmtccmd` for virtual environment. `-e` for interactive installation.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
cd tmtccmd
|
||||||
|
pip install -e .[gui]
|
||||||
|
```
|
||||||
|
|
||||||
|
2. You can also install the `spacepackets` package locally/interactively
|
||||||
|
Normally, it will be installed as a `tmtccmd` dependency.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
cd spacepackets
|
||||||
|
pip install -e .
|
||||||
|
```
|
||||||
|
|
||||||
|
Alternatively you can also install the packages from PyPI completely, but the risk of
|
||||||
|
incompatibilities will be high there
|
||||||
|
|
||||||
|
```sh
|
||||||
|
pip install -r requirements.txt
|
||||||
|
```
|
||||||
|
|
||||||
# Run Linter
|
# Run Linter
|
||||||
|
|
||||||
Can be used to quickly check validity of script. Install `flake8` first
|
Can be used to quickly check validity of script. Install `flake8` first
|
||||||
@ -20,47 +107,10 @@ and then run the `lint.py` script
|
|||||||
./lint.py
|
./lint.py
|
||||||
```
|
```
|
||||||
|
|
||||||
# Set up virtual environment
|
# Run Auto-Formatter
|
||||||
|
|
||||||
## Linux
|
This repo is auto-formatted using `black`. Assuming `black` is installed, you can simply run
|
||||||
|
|
||||||
1. Create virtual environment
|
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
python3 -m venv venv
|
black .
|
||||||
```
|
```
|
||||||
|
|
||||||
2. Activate virtual environment
|
|
||||||
|
|
||||||
```sh
|
|
||||||
. venv/bin/activate
|
|
||||||
```
|
|
||||||
|
|
||||||
3. Install `tmtccmd` for virtual environment. `-e` for interactive installation.
|
|
||||||
|
|
||||||
```sh
|
|
||||||
cd tmtccmd
|
|
||||||
python3 -m pip install -e .[gui]
|
|
||||||
```
|
|
||||||
|
|
||||||
## Windows
|
|
||||||
|
|
||||||
1. Create virtual environment
|
|
||||||
|
|
||||||
```sh
|
|
||||||
py -m venv .
|
|
||||||
```
|
|
||||||
|
|
||||||
2. Activate virtual environment
|
|
||||||
|
|
||||||
```sh
|
|
||||||
venv\Scripts\activate.bat
|
|
||||||
```
|
|
||||||
|
|
||||||
3. Install `tmtccmd` for virtual environment. `-e` for interactive installation.
|
|
||||||
|
|
||||||
```sh
|
|
||||||
cd tmtccmd
|
|
||||||
py -m pip install -e .[gui]
|
|
||||||
```
|
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
SW_NAME = "eive"
|
SW_NAME = "eive"
|
||||||
VERSION_MAJOR = 1
|
VERSION_MAJOR = 1
|
||||||
VERSION_MINOR = 9
|
VERSION_MINOR = 11
|
||||||
VERSION_SUBMINOR = 0
|
VERSION_SUBMINOR = 0
|
||||||
|
|
||||||
__version__ = "1.9.0"
|
__version__ = "1.11.0"
|
||||||
|
@ -14,6 +14,7 @@ from pus_tc.devs.bpx_batt import BpxOpCodes
|
|||||||
|
|
||||||
def get_eive_service_op_code_dict() -> ServiceOpCodeDictT:
|
def get_eive_service_op_code_dict() -> ServiceOpCodeDictT:
|
||||||
from tmtccmd.config.globals import get_default_service_op_code_dict
|
from tmtccmd.config.globals import get_default_service_op_code_dict
|
||||||
|
|
||||||
service_op_code_dict = get_default_service_op_code_dict()
|
service_op_code_dict = get_default_service_op_code_dict()
|
||||||
add_bpx_cmd_definitions(cmd_dict=service_op_code_dict)
|
add_bpx_cmd_definitions(cmd_dict=service_op_code_dict)
|
||||||
add_core_controller_definitions(cmd_dict=service_op_code_dict)
|
add_core_controller_definitions(cmd_dict=service_op_code_dict)
|
||||||
|
@ -277,18 +277,14 @@ def pack_ploc_supv_commands(
|
|||||||
tc_queue.appendleft(
|
tc_queue.appendleft(
|
||||||
(QueueCommands.PRINT, "PLOC Supervisor: Restart supervisor")
|
(QueueCommands.PRINT, "PLOC Supervisor: Restart supervisor")
|
||||||
)
|
)
|
||||||
command = object_id + struct.pack(
|
command = object_id + struct.pack("!I", SupvActionIds.RESTART_SUPERVISOR)
|
||||||
"!I", SupvActionIds.RESTART_SUPERVISOR
|
|
||||||
)
|
|
||||||
command = PusTelecommand(service=8, subservice=128, ssc=52, app_data=command)
|
command = PusTelecommand(service=8, subservice=128, ssc=52, app_data=command)
|
||||||
tc_queue.appendleft(command.pack_command_tuple())
|
tc_queue.appendleft(command.pack_command_tuple())
|
||||||
elif op_code == "38":
|
elif op_code == "38":
|
||||||
tc_queue.appendleft(
|
tc_queue.appendleft(
|
||||||
(QueueCommands.PRINT, "PLOC Supervisor: Factory reset clear all")
|
(QueueCommands.PRINT, "PLOC Supervisor: Factory reset clear all")
|
||||||
)
|
)
|
||||||
command = object_id + struct.pack(
|
command = object_id + struct.pack("!I", SupvActionIds.FACTORY_RESET_CLEAR_ALL)
|
||||||
"!I", SupvActionIds.FACTORY_RESET_CLEAR_ALL
|
|
||||||
)
|
|
||||||
command = PusTelecommand(service=8, subservice=128, ssc=53, app_data=command)
|
command = PusTelecommand(service=8, subservice=128, ssc=53, app_data=command)
|
||||||
tc_queue.appendleft(command.pack_command_tuple())
|
tc_queue.appendleft(command.pack_command_tuple())
|
||||||
elif op_code == "39":
|
elif op_code == "39":
|
||||||
@ -393,8 +389,12 @@ def pack_ploc_supv_commands(
|
|||||||
tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Enable NVMs"))
|
tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Enable NVMs"))
|
||||||
nvm01 = int(input("Enable (1) or disable(0) NVM 0 and 1: "))
|
nvm01 = int(input("Enable (1) or disable(0) NVM 0 and 1: "))
|
||||||
nvm3 = int(input("Enable (1) or disable(0) NVM 3: "))
|
nvm3 = int(input("Enable (1) or disable(0) NVM 3: "))
|
||||||
command = object_id + struct.pack('!I', SupvActionIds.ENABLE_NVMS) + struct.pack('B', nvm01) + \
|
command = (
|
||||||
struct.pack('B', nvm3)
|
object_id
|
||||||
|
+ struct.pack("!I", SupvActionIds.ENABLE_NVMS)
|
||||||
|
+ struct.pack("B", nvm01)
|
||||||
|
+ struct.pack("B", nvm3)
|
||||||
|
)
|
||||||
command = PusTelecommand(service=8, subservice=128, ssc=72, app_data=command)
|
command = PusTelecommand(service=8, subservice=128, ssc=72, app_data=command)
|
||||||
tc_queue.appendleft(command.pack_command_tuple())
|
tc_queue.appendleft(command.pack_command_tuple())
|
||||||
|
|
||||||
|
@ -42,7 +42,9 @@ def pus_factory_hook(raw_tm_packet: bytes):
|
|||||||
subservice_type = raw_tm_packet[8]
|
subservice_type = raw_tm_packet[8]
|
||||||
file_logger = FSFW_PRINTER.file_logger
|
file_logger = FSFW_PRINTER.file_logger
|
||||||
obj_id_dict = get_object_ids()
|
obj_id_dict = get_object_ids()
|
||||||
|
dedicated_handler = True
|
||||||
try:
|
try:
|
||||||
|
tm_packet = None
|
||||||
if service_type == 1:
|
if service_type == 1:
|
||||||
handle_service_1_packet(printer=FSFW_PRINTER, raw_tm=raw_tm_packet)
|
handle_service_1_packet(printer=FSFW_PRINTER, raw_tm=raw_tm_packet)
|
||||||
elif service_type == 3:
|
elif service_type == 3:
|
||||||
@ -59,19 +61,22 @@ def pus_factory_hook(raw_tm_packet: bytes):
|
|||||||
)
|
)
|
||||||
elif service_type == 17:
|
elif service_type == 17:
|
||||||
tm_packet = Service17TMExtended.unpack(raw_telemetry=raw_tm_packet)
|
tm_packet = Service17TMExtended.unpack(raw_telemetry=raw_tm_packet)
|
||||||
FSFW_PRINTER.handle_long_tm_print(packet_if=tm_packet, info_if=tm_packet)
|
dedicated_handler = False
|
||||||
elif service_type == 20:
|
elif service_type == 20:
|
||||||
tm_packet = Service20FsfwTm.unpack(raw_telemetry=raw_tm_packet)
|
tm_packet = Service20FsfwTm.unpack(raw_telemetry=raw_tm_packet)
|
||||||
FSFW_PRINTER.handle_long_tm_print(packet_if=tm_packet, info_if=tm_packet)
|
dedicated_handler = False
|
||||||
elif service_type == 200:
|
elif service_type == 200:
|
||||||
tm_packet = Service200FsfwTm.unpack(raw_telemetry=raw_tm_packet)
|
tm_packet = Service200FsfwTm.unpack(raw_telemetry=raw_tm_packet)
|
||||||
FSFW_PRINTER.handle_long_tm_print(packet_if=tm_packet, info_if=tm_packet)
|
dedicated_handler = False
|
||||||
else:
|
else:
|
||||||
LOGGER.info(
|
LOGGER.info(
|
||||||
f"The service {service_type} is not implemented in Telemetry Factory"
|
f"The service {service_type} is not implemented in Telemetry Factory"
|
||||||
)
|
)
|
||||||
tm_packet = PusTelemetry.unpack(raw_telemetry=raw_tm_packet)
|
tm_packet = PusTelemetry.unpack(raw_telemetry=raw_tm_packet)
|
||||||
tm_packet.print_source_data(PrintFormats.HEX)
|
tm_packet.print_source_data(PrintFormats.HEX)
|
||||||
|
dedicated_handler = True
|
||||||
|
if not dedicated_handler and tm_packet is not None:
|
||||||
|
FSFW_PRINTER.handle_long_tm_print(packet_if=tm_packet, info_if=tm_packet)
|
||||||
log_raw_pus_tm(
|
log_raw_pus_tm(
|
||||||
packet=raw_tm_packet, srv_subservice=(service_type, subservice_type)
|
packet=raw_tm_packet, srv_subservice=(service_type, subservice_type)
|
||||||
)
|
)
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
import logging
|
|
||||||
from datetime import datetime
|
|
||||||
from typing import cast
|
from typing import cast
|
||||||
|
|
||||||
from tmtccmd.tm.pus_1_verification import Service1TMExtended
|
from tmtccmd.tm.pus_1_verification import Service1TMExtended
|
||||||
|
1
requirements.txt
Normal file
1
requirements.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
tmtccmd >= 2.2.1
|
4
tmtcc.py
4
tmtcc.py
@ -45,7 +45,9 @@ def tmtcc_pre_args() -> EiveHookObject:
|
|||||||
return EiveHookObject(json_cfg_path=default_json_path())
|
return EiveHookObject(json_cfg_path=default_json_path())
|
||||||
|
|
||||||
|
|
||||||
def tmtcc_post_args(hook_obj: EiveHookObject, use_gui: bool, args: Optional[argparse.Namespace]):
|
def tmtcc_post_args(
|
||||||
|
hook_obj: EiveHookObject, use_gui: bool, args: Optional[argparse.Namespace]
|
||||||
|
):
|
||||||
setup_args = SetupArgs(
|
setup_args = SetupArgs(
|
||||||
hook_obj=hook_obj, use_gui=use_gui, apid=PUS_APID, cli_args=args
|
hook_obj=hook_obj, use_gui=use_gui, apid=PUS_APID, cli_args=args
|
||||||
)
|
)
|
||||||
|
@ -1,7 +1,12 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
"""TMTC commander for EIVE"""
|
"""TMTC commander for EIVE"""
|
||||||
from tmtcc import tmtcc_post_args, tmtcc_pre_args, create_default_args_parser, \
|
from tmtcc import (
|
||||||
add_default_tmtccmd_args, parse_default_input_arguments
|
tmtcc_post_args,
|
||||||
|
tmtcc_pre_args,
|
||||||
|
create_default_args_parser,
|
||||||
|
add_default_tmtccmd_args,
|
||||||
|
parse_default_input_arguments,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user