6 Commits

Author SHA1 Message Date
4e51adf92c small README tweak
All checks were successful
fsfw/fsfw example hosted/pipeline/head This commit looks good
2021-12-14 18:17:58 +01:00
1bc4424453 update tmtc doc and add requirements.txt
All checks were successful
fsfw/fsfw example hosted/pipeline/head This commit looks good
2021-12-14 18:16:00 +01:00
307df75a4d added new run config
All checks were successful
fsfw/fsfw example hosted/pipeline/head This commit looks good
2021-12-14 17:54:58 +01:00
d374b972dc update submodules
All checks were successful
fsfw/fsfw example hosted/pipeline/head This commit looks good
2021-12-14 17:50:49 +01:00
a30b161c3e asm to normal is now commanded
All checks were successful
fsfw/fsfw example hosted/pipeline/head This commit looks good
2021-12-14 16:30:08 +01:00
f101352817 update tmtc code
All checks were successful
fsfw/fsfw example hosted/pipeline/head This commit looks good
2021-12-14 16:00:46 +01:00
16 changed files with 96 additions and 37 deletions

View File

@ -52,8 +52,12 @@ the host abstraction layer of the FSFW.
This demo provides the opportunity to to test functionality of the This demo provides the opportunity to to test functionality of the
FSFW on a host computer without the need of setting up external embedded hardware. FSFW on a host computer without the need of setting up external embedded hardware.
## Prerequisites ## Prerequisites
If you need to set up these prerequisites, you can find some more information in the dedicated
[chapter](#prereqsetup).
1. Makefile build: make installed (bundled with MSYS2 on Windows or via [xPacks Windows Build Tools](https://xpack.github.io/windows-build-tools/install/)). Natively installed on Linux. 1. Makefile build: make installed (bundled with MSYS2 on Windows or via [xPacks Windows Build Tools](https://xpack.github.io/windows-build-tools/install/)). Natively installed on Linux.
2. Recommended for application code development: [Eclipse for C/C++](https://www.eclipse.org/downloads/packages/) . 2. Recommended for application code development: [Eclipse for C/C++](https://www.eclipse.org/downloads/packages/) .
Project files and launch configuration are provided for Eclipse to ease development. Project files and launch configuration are provided for Eclipse to ease development.
@ -62,6 +66,25 @@ FSFW on a host computer without the need of setting up external embedded hardwar
4. Recommended: Python 3 and [just](https://github.com/casey/just) installed for easy build 4. Recommended: Python 3 and [just](https://github.com/casey/just) installed for easy build
generation generation
## Commanding the Software
When the software is running, it opens a TCP oder UDP server, depending on the configuration,
on port 7301. You can send PUS telecommands to that port to interactively command the
software.
For a quick test, install the `tmtccmd` Python package first and use `py` instead
of `python3` on Windows:
```sh
cd tmtccmd
python3 -m pip install -r requirements.txt
```
Now you can command the software using the `tmtccli.py` and `tmtcgui.py` command.
For example, you can use `tmtccli.py -s 17 -o 0` to send a ping command.
## <a id="prereqsetup"></a> Setting up Prerequisites
### Windows - MinGW64 build ### Windows - MinGW64 build
1. [MSYS2 and MinGW64](https://www.msys2.org/) installed 1. [MSYS2 and MinGW64](https://www.msys2.org/) installed
@ -200,11 +223,15 @@ as well to have a convenient way to configure the CMake build.
## Setting up Eclipse for CMake projects ## Setting up Eclipse for CMake projects
The separate [Eclipse README](https://egit.irs.uni-stuttgart.de/fsfw/fsfw-example-common/src/branch/master/doc/README-eclipse.md) specifies how to set up Eclipse to build CMake The separate [Eclipse README](https://egit.irs.uni-stuttgart.de/fsfw/fsfw-example-common/src/branch/master/doc/README-eclipse.md)
specifies how to set up Eclipse to build CMake
projects. Separate project files and launch configurations for the MinGW build were provided. projects. Separate project files and launch configurations for the MinGW build were provided.
The debug output is colored by default. It is recommended to install the The debug output is colored by default. It is recommended to install the
`ANSI Escape in Console` plugin in Eclipse so the coloring works in the Eclipse console. On Windows, `ANSI Escape in Console` plugin in Eclipse so the coloring works in the Eclipse console.
it is recommended to run the applicaton with the Windows command line for the printout to work
**Windows**
On Windows, it is recommended to run the applicaton with the Windows command line for the printout
to work
properly. You can do this by simply double-clicking the binary or using `start <Exe>` in the properly. You can do this by simply double-clicking the binary or using `start <Exe>` in the
Windows command line Windows command line

View File

@ -294,17 +294,6 @@ void InitMission::createTasks() {
sif::printInfo("Waiting 5 Seconds and then command Test Assembly to Normal, Dual \n"); sif::printInfo("Waiting 5 Seconds and then command Test Assembly to Normal, Dual \n");
#endif #endif
TaskFactory::delayTask(5000);
CommandMessage modeMessage;
ModeMessage::setModeMessage(&modeMessage, ModeMessage::CMD_MODE_COMMAND,
DeviceHandlerIF::MODE_NORMAL, TestAssembly::submodes::DUAL);
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::info << "Commanding Test Assembly to Normal, Dual" << std::endl;
#else
sif::printInfo("Commanding Test Assembly to Normal, Dual \n");
#endif
MessageQueueSenderIF::sendMessage(assembly->getCommandQueue(), &modeMessage,
MessageQueueIF::NO_QUEUE);
#endif /* OBSW_ADD_DEVICE_HANDLER_DEMO */ #endif /* OBSW_ADD_DEVICE_HANDLER_DEMO */
} }

2
fsfw

Submodule fsfw updated: ab7117d81e...d0c7878da4

View File

@ -0,0 +1,24 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="CMD Assemly to Normal" type="PythonConfigurationType" factoryName="Python" folderName="FSFW">
<module name="tmtc" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<envs>
<env name="PYTHONUNBUFFERED" value="1" />
</envs>
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtccli.py" />
<option name="PARAMETERS" value="-s 200 -o asm_to_normal -t 6 -l" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" />
<option name="MODULE_MODE" value="false" />
<option name="REDIRECT_INPUT" value="false" />
<option name="INPUT_FILE" value="" />
<method v="2" />
</configuration>
</component>

View File

@ -1,5 +1,5 @@
<component name="ProjectRunConfigurationManager"> <component name="ProjectRunConfigurationManager">
<configuration default="false" name="TMTC PUS 17 Generic" type="PythonConfigurationType" factoryName="Python" folderName="PUS"> <configuration default="false" name="PUS Mode Test" type="PythonConfigurationType" factoryName="Python" folderName="PUS">
<module name="tmtc" /> <module name="tmtc" />
<option name="INTERPRETER_OPTIONS" value="" /> <option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" /> <option name="PARENT_ENVS" value="true" />
@ -12,8 +12,8 @@
<option name="ADD_CONTENT_ROOTS" value="true" /> <option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" /> <option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" /> <EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtc_client_cli.py" /> <option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtccli.py" />
<option name="PARAMETERS" value="-s 17 -o 1 -l" /> <option name="PARAMETERS" value="-s 200 -o test -l" />
<option name="SHOW_COMMAND_LINE" value="false" /> <option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" /> <option name="EMULATE_TERMINAL" value="false" />
<option name="MODULE_MODE" value="false" /> <option name="MODULE_MODE" value="false" />

View File

@ -1,5 +1,5 @@
<component name="ProjectRunConfigurationManager"> <component name="ProjectRunConfigurationManager">
<configuration default="false" name="TMTC PUS 17 Ping" type="PythonConfigurationType" factoryName="Python" folderName="PUS"> <configuration default="false" name="PUS Ping" type="PythonConfigurationType" factoryName="Python" folderName="PUS">
<module name="tmtc" /> <module name="tmtc" />
<option name="INTERPRETER_OPTIONS" value="" /> <option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" /> <option name="PARENT_ENVS" value="true" />
@ -12,7 +12,7 @@
<option name="ADD_CONTENT_ROOTS" value="true" /> <option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" /> <option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" /> <EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtc_client_cli.py" /> <option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtccli.py" />
<option name="PARAMETERS" value="-s 17 -o 0 -l" /> <option name="PARAMETERS" value="-s 17 -o 0 -l" />
<option name="SHOW_COMMAND_LINE" value="false" /> <option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" /> <option name="EMULATE_TERMINAL" value="false" />

View File

@ -1,5 +1,5 @@
<component name="ProjectRunConfigurationManager"> <component name="ProjectRunConfigurationManager">
<configuration default="false" name="PUS 3 One HK" type="PythonConfigurationType" factoryName="Python" folderName="PUS"> <configuration default="false" name="PUS Srv3 One HK" type="PythonConfigurationType" factoryName="Python" folderName="PUS">
<module name="tmtc" /> <module name="tmtc" />
<option name="INTERPRETER_OPTIONS" value="" /> <option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" /> <option name="PARENT_ENVS" value="true" />
@ -12,7 +12,7 @@
<option name="ADD_CONTENT_ROOTS" value="true" /> <option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" /> <option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" /> <EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtc_client_cli.py" /> <option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtccli.py" />
<option name="PARAMETERS" value="-s 3 -o 1 -l" /> <option name="PARAMETERS" value="-s 3 -o 1 -l" />
<option name="SHOW_COMMAND_LINE" value="false" /> <option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" /> <option name="EMULATE_TERMINAL" value="false" />

View File

@ -12,7 +12,7 @@
<option name="ADD_CONTENT_ROOTS" value="true" /> <option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" /> <option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" /> <EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtc_client_cli.py" /> <option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtccli.py" />
<option name="PARAMETERS" value="" /> <option name="PARAMETERS" value="" />
<option name="SHOW_COMMAND_LINE" value="false" /> <option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" /> <option name="EMULATE_TERMINAL" value="false" />

View File

@ -1,5 +1,5 @@
<component name="ProjectRunConfigurationManager"> <component name="ProjectRunConfigurationManager">
<configuration default="false" name="TMTC Help" type="PythonConfigurationType" factoryName="Python"> <configuration default="false" name="TMTC GUI" type="PythonConfigurationType" factoryName="Python">
<module name="tmtc" /> <module name="tmtc" />
<option name="INTERPRETER_OPTIONS" value="" /> <option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" /> <option name="PARENT_ENVS" value="true" />
@ -12,8 +12,8 @@
<option name="ADD_CONTENT_ROOTS" value="true" /> <option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" /> <option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" /> <EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtc_client_cli.py" /> <option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtcgui.py" />
<option name="PARAMETERS" value="-h" /> <option name="PARAMETERS" value="" />
<option name="SHOW_COMMAND_LINE" value="false" /> <option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" /> <option name="EMULATE_TERMINAL" value="false" />
<option name="MODULE_MODE" value="false" /> <option name="MODULE_MODE" value="false" />

1
tmtc/requirements.txt Normal file
View File

@ -0,0 +1 @@
tmtccmd == 1.10.1

15
tmtc/tmtc_client_cli.py → tmtc/tmtccli.py Executable file → Normal file
View File

@ -32,8 +32,13 @@ from spacepackets.log import set_custom_console_logger_name
from common_tmtc.config.hook_implementation import FsfwHookBase from common_tmtc.config.hook_implementation import FsfwHookBase
from common_tmtc.config.definitions import PUS_APID from common_tmtc.config.definitions import PUS_APID
from common_tmtc.pus_tm.factory_hook import ccsds_tm_handler from common_tmtc.pus_tm.factory_hook import ccsds_tm_handler
try: try:
from tmtccmd.runner import run_tmtc_commander, initialize_tmtc_commander, add_ccsds_handler from tmtccmd.runner import (
run_tmtc_commander,
initialize_tmtc_commander,
add_ccsds_handler,
)
from tmtccmd.ccsds.handler import CcsdsTmHandler from tmtccmd.ccsds.handler import CcsdsTmHandler
from tmtccmd.utility.logger import TMTC_LOGGER_NAME from tmtccmd.utility.logger import TMTC_LOGGER_NAME
except ImportError as error: except ImportError as error:
@ -41,7 +46,9 @@ except ImportError as error:
initialize_tmtc_commander = None initialize_tmtc_commander = None
print(error) print(error)
print("Python tmtccmd submodule could not be imported") print("Python tmtccmd submodule could not be imported")
print("Install with \"cd tmtccmd && python3 -m pip install -e .\" for interactive installation") print(
'Install with "cd tmtccmd && python3 -m pip install -e ." for interactive installation'
)
sys.exit(0) sys.exit(0)
@ -49,7 +56,9 @@ def main():
hook_obj = FsfwHookBase() hook_obj = FsfwHookBase()
initialize_tmtc_commander(hook_object=hook_obj) initialize_tmtc_commander(hook_object=hook_obj)
ccsds_handler = CcsdsTmHandler() ccsds_handler = CcsdsTmHandler()
ccsds_handler.add_tm_handler(apid=PUS_APID, pus_tm_handler=ccsds_tm_handler, max_queue_len=50) ccsds_handler.add_tm_handler(
apid=PUS_APID, pus_tm_handler=ccsds_tm_handler, max_queue_len=50
)
add_ccsds_handler(ccsds_handler) add_ccsds_handler(ccsds_handler)
set_custom_console_logger_name(TMTC_LOGGER_NAME) set_custom_console_logger_name(TMTC_LOGGER_NAME)
run_tmtc_commander(use_gui=False, app_name="TMTC Commander FSFW") run_tmtc_commander(use_gui=False, app_name="TMTC Commander FSFW")

View File

@ -31,15 +31,22 @@ import sys
from common_tmtc.config.hook_implementation import FsfwHookBase from common_tmtc.config.hook_implementation import FsfwHookBase
from common_tmtc.config.definitions import PUS_APID from common_tmtc.config.definitions import PUS_APID
from common_tmtc.pus_tm.factory_hook import ccsds_tm_handler from common_tmtc.pus_tm.factory_hook import ccsds_tm_handler
try: try:
from tmtccmd.runner import run_tmtc_commander, initialize_tmtc_commander, add_ccsds_handler from tmtccmd.runner import (
run_tmtc_commander,
initialize_tmtc_commander,
add_ccsds_handler,
)
from tmtccmd.ccsds.handler import CcsdsTmHandler from tmtccmd.ccsds.handler import CcsdsTmHandler
except ImportError as error: except ImportError as error:
run_tmtc_commander = None run_tmtc_commander = None
initialize_tmtc_commander = None initialize_tmtc_commander = None
print(error) print(error)
print("Python tmtccmd submodule could not be imported") print("Python tmtccmd submodule could not be imported")
print("Install with \"cd tmtccmd && python3 -m pip install -e .\" for interactive installation") print(
'Install with "cd tmtccmd && python3 -m pip install -e ." for interactive installation'
)
sys.exit(0) sys.exit(0)
@ -47,7 +54,9 @@ def main():
hook_obj = FsfwHookBase() hook_obj = FsfwHookBase()
initialize_tmtc_commander(hook_object=hook_obj) initialize_tmtc_commander(hook_object=hook_obj)
ccsds_handler = CcsdsTmHandler() ccsds_handler = CcsdsTmHandler()
ccsds_handler.add_tm_handler(apid=PUS_APID, pus_tm_handler=ccsds_tm_handler, max_queue_len=50) ccsds_handler.add_tm_handler(
apid=PUS_APID, pus_tm_handler=ccsds_tm_handler, max_queue_len=50
)
add_ccsds_handler(ccsds_handler) add_ccsds_handler(ccsds_handler)
run_tmtc_commander(use_gui=True, app_name="TMTC Commander FSFW") run_tmtc_commander(use_gui=True, app_name="TMTC Commander FSFW")