tmtc update

This commit is contained in:
Robin Müller 2021-07-16 13:22:59 +02:00
parent 61bd99f59f
commit 6cacd8ab99
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC
10 changed files with 126 additions and 11 deletions

View File

@ -14,8 +14,7 @@ set(CMAKE_SCRIPT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
set(RTEMS_CMAKE_PATH "${CMAKE_SCRIPT_PATH}/rtems-cmake") set(RTEMS_CMAKE_PATH "${CMAKE_SCRIPT_PATH}/rtems-cmake")
set(FSFW_OSAL rtems CACHE STRING "OS for the FSFW") set(FSFW_OSAL rtems CACHE STRING "OS for the FSFW")
# Set off, networking code is part of RTEMS BSP SET(STM32_ADD_NETWORKING_CODE ON)
set(STM32_ADD_NETWORKING_CODE OFF)
set(FSFW_HAL_ADD_STM32H7 ON) set(FSFW_HAL_ADD_STM32H7 ON)
# Set TGT_BSP to correct target for pre-project configuration # Set TGT_BSP to correct target for pre-project configuration
@ -62,6 +61,7 @@ configure_file(${COMMON_CONFIG_PATH}/commonConfig.h.in commonConfig.h)
configure_file(${FSFW_CONFIG_PATH}/FSFWConfig.h.in FSFWConfig.h) configure_file(${FSFW_CONFIG_PATH}/FSFWConfig.h.in FSFWConfig.h)
configure_file(${FSFW_CONFIG_PATH}/OBSWConfig.h.in OBSWConfig.h) configure_file(${FSFW_CONFIG_PATH}/OBSWConfig.h.in OBSWConfig.h)
configure_file(${BSP_NUCLEO_PATH_INC}/lwipopts.h.in lwipopts.h) configure_file(${BSP_NUCLEO_PATH_INC}/lwipopts.h.in lwipopts.h)
configure_file(${BSP_PATH}/RTEMSConfig.h.in RTEMSConfig.h)
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(WARNING_FLAGS set(WARNING_FLAGS

View File

@ -1,5 +1,6 @@
#include "hardware_init.h" #include "hardware_init.h"
#include "fsfw/tasks/PeriodicTaskIF.h"
#include <rtems_lwip/rtems_lwip.h> #include <rtems_lwip/rtems_lwip.h>
#include <rtems_lwip/ethernetif.h> #include <rtems_lwip/ethernetif.h>
#include <rtems_lwip/app_ethernet.h> #include <rtems_lwip/app_ethernet.h>

View File

@ -40,7 +40,7 @@ void InitMission::createTasks() {
task::printInitError("TM funnel", objects::TM_FUNNEL); task::printInitError("TM funnel", objects::TM_FUNNEL);
} }
#if OBSW_ADD_LWIP_NETWORKING == 1 #if OBSW_ADD_LWIP_COMPONENTS == 1
/* UDP bridge */ /* UDP bridge */
PeriodicTaskIF* udpBridgeTask = TaskFactory::instance()->createPeriodicTask( PeriodicTaskIF* udpBridgeTask = TaskFactory::instance()->createPeriodicTask(
"UDP_UNIX_BRIDGE", 60, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, nullptr); "UDP_UNIX_BRIDGE", 60, PeriodicTaskIF::MINIMUM_STACK_SIZE, 0.2, nullptr);
@ -55,7 +55,7 @@ void InitMission::createTasks() {
if(result != HasReturnvaluesIF::RETURN_OK) { if(result != HasReturnvaluesIF::RETURN_OK) {
task::printInitError("UDP polling task", objects::UDP_POLLING_TASK); task::printInitError("UDP polling task", objects::UDP_POLLING_TASK);
} }
#endif /* OBSW_ADD_LWIP_NETWORKING == 1 */ #endif /* OBSW_ADD_LWIP_COMPONENTS == 1 */
#endif /* OBSW_ADD_CORE_COMPONENTS == 1 */ #endif /* OBSW_ADD_CORE_COMPONENTS == 1 */
#if OBSW_ADD_PUS_STACK == 1 #if OBSW_ADD_PUS_STACK == 1
@ -150,10 +150,10 @@ void InitMission::createTasks() {
#if OBSW_ADD_CORE_COMPONENTS == 1 #if OBSW_ADD_CORE_COMPONENTS == 1
distributerTask->startTask(); distributerTask->startTask();
eventManagerTask->startTask(); eventManagerTask->startTask();
#if OBSW_ADD_LWIP_NETWORKING == 1 #if OBSW_ADD_LWIP_COMPONENTS == 1
udpBridgeTask->startTask(); udpBridgeTask->startTask();
udpPollingTask->startTask(); udpPollingTask->startTask();
#endif /* OBSW_ADD_LWIP_NETWORKING == 1 */ #endif /* OBSW_ADD_LWIP_COMPONENTS == 1 */
#endif /* OBSW_ADD_CORE_COMPONENTS == 1 */ #endif /* OBSW_ADD_CORE_COMPONENTS == 1 */
#if OBSW_ADD_PUS_STACK == 1 #if OBSW_ADD_PUS_STACK == 1

View File

@ -16,6 +16,8 @@
#include <fsfw/tmtcservices/CommandingServiceBase.h> #include <fsfw/tmtcservices/CommandingServiceBase.h>
#include <fsfw/tmtcservices/PusServiceBase.h> #include <fsfw/tmtcservices/PusServiceBase.h>
#include <rtems_lwip/rtems_lwip.h>
void ObjectFactory::produce(void* args) { void ObjectFactory::produce(void* args) {
/* Located inside GenericFactory source file */ /* Located inside GenericFactory source file */
Factory::setStaticFrameworkObjectIds(); Factory::setStaticFrameworkObjectIds();
@ -42,12 +44,12 @@ void ObjectFactory::produce(void* args) {
new PoolManager(objects::IPC_STORE, poolCfg); new PoolManager(objects::IPC_STORE, poolCfg);
} }
#if OBSW_ADD_LWIP_COMPONENTS == 1
#if OBSW_ADD_LWIP_NETWORKING == 1
/* UDP Server */ /* UDP Server */
new TmTcLwIpUdpBridge(objects::UDP_BRIDGE, new TmTcLwIpUdpBridge(objects::UDP_BRIDGE,
objects::CCSDS_DISTRIBUTOR, objects::TM_STORE, objects::TC_STORE); objects::CCSDS_DISTRIBUTOR, objects::TM_STORE, objects::TC_STORE);
new UdpTcLwIpPollingTask(objects::UDP_POLLING_TASK, objects::UDP_BRIDGE); new UdpTcLwIpPollingTask(objects::UDP_POLLING_TASK, objects::UDP_BRIDGE,
rtems_lwip_get_netif(0));
#endif /* OBSW_ADD_LWIP_NETWORKING == 1 */ #endif /* OBSW_ADD_LWIP_NETWORKING == 1 */
#endif /* OBSW_ADD_CORE_COMPONENTS == 1 */ #endif /* OBSW_ADD_CORE_COMPONENTS == 1 */

@ -1 +1 @@
Subproject commit afe0a1356633baf7ba117295fa57c93fb8e0d8a3 Subproject commit d5a342a50994ad71aab47425285bc2699ac55dcd

@ -1 +1 @@
Subproject commit a31a9d39257d545a1a35752f35d7d1bfcf1b2c49 Subproject commit 117213a922e71f6a058998305c01d98c878cb856

0
tmtc/config/__init__.py Normal file
View File

56
tmtc/tmtc_client_cli.py Executable file
View File

@ -0,0 +1,56 @@
#!/usr/bin/env python3
"""
@brief TMTC Commander entry point for command line mode.
@details
This client was developed by KSat for the SOURCE project to test the on-board software but
has evolved into a more generic tool for satellite developers to perform TMTC (Telemetry and Telecommand)
handling and testing via different communication interfaces. Currently, only the PUS standard is
implemented as a packet standard.
Run this file with the -h flag to display options.
@license
Copyright 2020 KSat e.V. Stuttgart
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
@author R. Mueller
"""
import sys
from common_tmtc.config.hook_implementation import FsfwHookBase
from common_tmtc.config.definitions import PUS_APID
from common_tmtc.pus_tm.factory_hook import ccsds_tm_handler
try:
from tmtccmd.runner import run_tmtc_commander, initialize_tmtc_commander, add_ccsds_handler
from tmtccmd.ccsds.handler import CcsdsTmHandler
except ImportError as error:
run_tmtc_commander = None
initialize_tmtc_commander = None
print(error)
print("Python tmtccmd submodule could not be imported")
print("Install with \"cd tmtccmd && python3 -m pip install -e .\" for interactive installation")
sys.exit(0)
def main():
hook_obj = FsfwHookBase()
initialize_tmtc_commander(hook_object=hook_obj)
ccsds_handler = CcsdsTmHandler()
ccsds_handler.add_tm_handler(apid=PUS_APID, pus_tm_handler=ccsds_tm_handler, max_queue_len=50)
add_ccsds_handler(ccsds_handler)
run_tmtc_commander(use_gui=False, app_name="TMTC Commander FSFW")
if __name__ == "__main__":
main()

56
tmtc/tmtc_client_gui.py Normal file
View File

@ -0,0 +1,56 @@
#!/usr/bin/env python3
"""
@brief TMTC Commander entry point for command line mode.
@details
This client was developed by KSat for the SOURCE project to test the on-board software but
has evolved into a more generic tool for satellite developers to perform TMTC (Telemetry and Telecommand)
handling and testing via different communication interfaces. Currently, only the PUS standard is
implemented as a packet standard.
Run this file with the -h flag to display options.
@license
Copyright 2020 KSat e.V. Stuttgart
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
@author R. Mueller
"""
import sys
from common_tmtc.config.hook_implementation import FsfwHookBase
from common_tmtc.config.definitions import PUS_APID
from common_tmtc.pus_tm.factory_hook import ccsds_tm_handler
try:
from tmtccmd.runner import run_tmtc_commander, initialize_tmtc_commander, add_ccsds_handler
from tmtccmd.ccsds.handler import CcsdsTmHandler
except ImportError as error:
run_tmtc_commander = None
initialize_tmtc_commander = None
print(error)
print("Python tmtccmd submodule could not be imported")
print("Install with \"cd tmtccmd && python3 -m pip install -e .\" for interactive installation")
sys.exit(0)
def main():
hook_obj = FsfwHookBase()
initialize_tmtc_commander(hook_object=hook_obj)
ccsds_handler = CcsdsTmHandler()
ccsds_handler.add_tm_handler(apid=PUS_APID, pus_tm_handler=ccsds_tm_handler, max_queue_len=50)
add_ccsds_handler(ccsds_handler)
run_tmtc_commander(use_gui=True, app_name="TMTC Commander FSFW")
if __name__ == "__main__":
main()