From ca7fbcf6a9f2c5427f17cec5a513666e406d44f2 Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Tue, 7 Mar 2023 07:26:09 +0100 Subject: [PATCH 1/3] reduced transmitter timeout to 2 minutes --- CHANGELOG.md | 6 ++++++ mission/system/tree/comModeTree.h | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b08ae006..57205863 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,12 @@ will consitute of a breaking change warranting a new major release: # [unreleased] +## Changed + +- Transmitter timeout set to 2 minutes instead of 15 minutes. This will prevent to discharge the battery + in case the syrlinks starts transmitting due to detection of unintentional bitlock. This happened e.g. on ground + when the uplink to the flying latop was established. + # [v1.35.1] 2023-03-04 ## Fixed diff --git a/mission/system/tree/comModeTree.h b/mission/system/tree/comModeTree.h index 9260e3ea..0ac7f9b3 100644 --- a/mission/system/tree/comModeTree.h +++ b/mission/system/tree/comModeTree.h @@ -11,8 +11,9 @@ extern ComSubsystem SUBSYSTEM; // The syrlinks must not transmitting longer then 15 minutes otherwise the // transceiver might be damaged due to overheating -// 15 minutes in milliseconds -static const uint32_t TRANSMITTER_TIMEOUT = 900000; +// This is the initial timeout of 2 minutes. The timeout needs to be incremented +// before each overpass +static const uint32_t TRANSMITTER_TIMEOUT = 120000; Subsystem& init(); } // namespace com From 5de7653600ba0451dae752d4fa37fc8b757fabcf Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 7 Mar 2023 15:34:08 +0100 Subject: [PATCH 2/3] TM store bugfixes --- CHANGELOG.md | 4 ++++ bsp_q7s/core/scheduling.cpp | 4 ++++ mission/tmtc/PersistentTmStore.cpp | 29 ----------------------------- 3 files changed, 8 insertions(+), 29 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b08ae006..2a47cd83 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,10 @@ will consitute of a breaking change warranting a new major release: # [unreleased] +## Changed + +- Persistent TM stores will now create new files on each reboot. + # [v1.35.1] 2023-03-04 ## Fixed diff --git a/bsp_q7s/core/scheduling.cpp b/bsp_q7s/core/scheduling.cpp index f1837333..3098bb14 100644 --- a/bsp_q7s/core/scheduling.cpp +++ b/bsp_q7s/core/scheduling.cpp @@ -527,6 +527,10 @@ void scheduling::createPusTasks(TaskFactory& factory, TaskDeadlineMissedFunction if (result != returnvalue::OK) { scheduling::printAddObjectError("PUS_8", objects::PUS_SERVICE_8_FUNCTION_MGMT); } + result = pusMedPrio->addComponent(objects::PUS_SERVICE_15_TM_STORAGE); + if (result != returnvalue::OK) { + scheduling::printAddObjectError("PUS_15", objects::PUS_SERVICE_15_TM_STORAGE); + } result = pusMedPrio->addComponent(objects::PUS_SERVICE_11_TC_SCHEDULER); if (result != returnvalue::OK) { scheduling::printAddObjectError("PUS_11", objects::PUS_SERVICE_11_TC_SCHEDULER); diff --git a/mission/tmtc/PersistentTmStore.cpp b/mission/tmtc/PersistentTmStore.cpp index 2e7da6f6..91a87248 100644 --- a/mission/tmtc/PersistentTmStore.cpp +++ b/mission/tmtc/PersistentTmStore.cpp @@ -28,35 +28,6 @@ PersistentTmStore::PersistentTmStore(object_id_t objectId, const char* baseDir, } ReturnValue_t PersistentTmStore::assignAndOrCreateMostRecentFile() { - using namespace std::filesystem; - for (auto const& file : directory_iterator(basePath)) { - if (file.is_directory()) { - continue; - } - auto pathStr = file.path().string(); - if (pathStr.find(baseName) == std::string::npos) { - continue; - } - unsigned int underscorePos = pathStr.find_last_of('_'); - std::string stampStr = pathStr.substr(underscorePos + 1); - struct tm time {}; - if (nullptr == strptime(stampStr.c_str(), FILE_DATE_FORMAT, &time)) { - sif::error << "PersistentTmStore::assignOrCreateMostRecentFile: Error reading timestamp" - << std::endl; - // Delete the file and re-create it. - activeFile = std::nullopt; - std::filesystem::remove(file.path()); - break; - } - time_t fileEpoch = timegm(&time); - // There is still a file within the active time window, so re-use that file for new TMs to - // store. - if (fileEpoch + static_cast(rolloverDiffSeconds) > currentTv.tv_sec) { - activeFileTv.tv_sec = fileEpoch; - activeFile = file.path(); - break; - } - } if (not activeFile.has_value()) { return createMostRecentFile(std::nullopt); } From 112cfa3ee73c5858c33017417de9cab184845faf Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Tue, 7 Mar 2023 15:34:34 +0100 Subject: [PATCH 3/3] changelog update --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a47cd83..e2d3d82a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,10 @@ will consitute of a breaking change warranting a new major release: - Persistent TM stores will now create new files on each reboot. +## Fixed + +- PUS 15 was not scheduled + # [v1.35.1] 2023-03-04 ## Fixed