From 83361a5e16d614fef843e4ce780be3e7819c9bde Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 13 Jan 2023 11:43:44 +0100 Subject: [PATCH 1/7] add init boot delay handling in OBSW --- bsp_q7s/obsw.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/bsp_q7s/obsw.cpp b/bsp_q7s/obsw.cpp index d497eceb..881c03e1 100644 --- a/bsp_q7s/obsw.cpp +++ b/bsp_q7s/obsw.cpp @@ -36,6 +36,28 @@ int obsw::obsw() { return OBSW_ALREADY_RUNNING; } #endif + + // Init delay handling. + if(std::filesystem::exists("$HOME/boot_delay.txt")) { + std::ifstream ifile("$HOME/boot_delay.txt"); + std::string lineStr; + unsigned int bootDelaySecs = 0; + unsigned int line = 0; + // Try to reas delay seconds from file. + while(std::getline(ifile, lineStr)) { + std::istringstream iss(lineStr); + if(!(iss >> bootDelaySecs)) { + break; + } + line++; + } + if(line == 0) { + // If the file is empty, assume default of 6 seconds + bootDelaySecs = 6; + } + TaskFactory::delayTask(bootDelaySecs); + } + scheduling::initMission(); for (;;) { From 4ebf73bd03b88ac03341e53c1adef5d1adf87362 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 13 Jan 2023 11:44:16 +0100 Subject: [PATCH 2/7] include missing type --- bsp_q7s/obsw.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/bsp_q7s/obsw.cpp b/bsp_q7s/obsw.cpp index 881c03e1..6b179058 100644 --- a/bsp_q7s/obsw.cpp +++ b/bsp_q7s/obsw.cpp @@ -2,6 +2,7 @@ #include #include +#include #include "OBSWConfig.h" #include "commonConfig.h" From 3f079b415d0b83e9cb07cbb94b42b542a9325fe7 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 13 Jan 2023 11:59:11 +0100 Subject: [PATCH 3/7] small tweaks --- bsp_q7s/obsw.cpp | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/bsp_q7s/obsw.cpp b/bsp_q7s/obsw.cpp index 6b179058..6f42d984 100644 --- a/bsp_q7s/obsw.cpp +++ b/bsp_q7s/obsw.cpp @@ -1,8 +1,8 @@ #include "obsw.h" #include -#include #include +#include #include "OBSWConfig.h" #include "commonConfig.h" @@ -39,24 +39,25 @@ int obsw::obsw() { #endif // Init delay handling. - if(std::filesystem::exists("$HOME/boot_delay.txt")) { - std::ifstream ifile("$HOME/boot_delay.txt"); - std::string lineStr; - unsigned int bootDelaySecs = 0; - unsigned int line = 0; - // Try to reas delay seconds from file. - while(std::getline(ifile, lineStr)) { - std::istringstream iss(lineStr); - if(!(iss >> bootDelaySecs)) { - break; - } - line++; - } - if(line == 0) { - // If the file is empty, assume default of 6 seconds - bootDelaySecs = 6; - } - TaskFactory::delayTask(bootDelaySecs); + if (std::filesystem::exists("$HOME/boot_delay_secs.txt")) { + std::ifstream ifile("$HOME/boot_delay_secs.txt"); + std::string lineStr; + unsigned int bootDelaySecs = 0; + unsigned int line = 0; + // Try to reas delay seconds from file. + while (std::getline(ifile, lineStr)) { + std::istringstream iss(lineStr); + if (!(iss >> bootDelaySecs)) { + break; + } + line++; + } + if (line == 0) { + // If the file is empty, assume default of 6 seconds + bootDelaySecs = 6; + } + std::cout << "Delaying OBSW start for " << bootDelaySecs << " seconds" << std::endl; + TaskFactory::delayTask(bootDelaySecs); } scheduling::initMission(); From 9e9aa71e9b8924f57edcfe47d6cc36ef830c1413 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 13 Jan 2023 13:14:11 +0100 Subject: [PATCH 4/7] this works --- bsp_q7s/obsw.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/bsp_q7s/obsw.cpp b/bsp_q7s/obsw.cpp index 6f42d984..dd0c486b 100644 --- a/bsp_q7s/obsw.cpp +++ b/bsp_q7s/obsw.cpp @@ -4,6 +4,10 @@ #include #include +#include +#include +#include + #include "OBSWConfig.h" #include "commonConfig.h" #include "core/scheduling.h" @@ -38,9 +42,15 @@ int obsw::obsw() { } #endif + const char* homedir = nullptr; + homedir = getenv("HOME"); + if(homedir == nullptr) { + homedir = getpwuid(getuid())->pw_dir; + } + std::filesystem::path bootDelayFile = std::filesystem::path(homedir) / "boot_delay_secs.txt"; // Init delay handling. - if (std::filesystem::exists("$HOME/boot_delay_secs.txt")) { - std::ifstream ifile("$HOME/boot_delay_secs.txt"); + if (std::filesystem::exists(bootDelayFile)) { + std::ifstream ifile(bootDelayFile); std::string lineStr; unsigned int bootDelaySecs = 0; unsigned int line = 0; @@ -57,7 +67,7 @@ int obsw::obsw() { bootDelaySecs = 6; } std::cout << "Delaying OBSW start for " << bootDelaySecs << " seconds" << std::endl; - TaskFactory::delayTask(bootDelaySecs); + TaskFactory::delayTask(bootDelaySecs * 1000); } scheduling::initMission(); From f6706c4f9bc83e4ed70edbebd09aabf98062be7e Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Fri, 13 Jan 2023 13:16:26 +0100 Subject: [PATCH 5/7] update changelog --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e04ce0f6..463e983d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,13 @@ list yields a list of all related PRs for each release. # [unreleased] +## Added + +- The Q7S SW now checks for a file named `boot_delay_secs.stxt` in the home directory. + If it exists and the file is empty, it will delay for 6 seconds before continuing + with the regular boot. It can also try to read delay seconds from the file. + PR: https://egit.irs.uni-stuttgart.de/eive/eive-obsw/pulls/340. + ## Changed - Bumped FSFW for Service 11 improvement which includes size and CRC check for contained TC From 588a6572b36439be6c262336923a48637acdfb95 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 16 Jan 2023 15:17:47 +0100 Subject: [PATCH 6/7] bump tmtc --- tmtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmtc b/tmtc index d652c466..4839ab43 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit d652c4663b6e738345799026a16d6d2f00d7e65d +Subproject commit 4839ab43657dc3e5feb1d37adfbc00da049811f8 From b78fa73c75c24e3aa40b7aa1931029784e4204c8 Mon Sep 17 00:00:00 2001 From: Marius Eggert Date: Mon, 16 Jan 2023 17:12:32 +0100 Subject: [PATCH 7/7] sus PoolIds fix --- .../controller/controllerdefinitions/AcsCtrlDefinitions.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mission/controller/controllerdefinitions/AcsCtrlDefinitions.h b/mission/controller/controllerdefinitions/AcsCtrlDefinitions.h index 2652ca3c..d9b1deea 100644 --- a/mission/controller/controllerdefinitions/AcsCtrlDefinitions.h +++ b/mission/controller/controllerdefinitions/AcsCtrlDefinitions.h @@ -182,9 +182,9 @@ class SusDataProcessed : public StaticLocalDataSet { lp_vec_t sus6vec = lp_vec_t(sid.objectId, SUS_6_VEC, this); lp_vec_t sus7vec = lp_vec_t(sid.objectId, SUS_7_VEC, this); lp_vec_t sus8vec = lp_vec_t(sid.objectId, SUS_8_VEC, this); - lp_vec_t sus9vec = lp_vec_t(sid.objectId, SUS_8_VEC, this); - lp_vec_t sus10vec = lp_vec_t(sid.objectId, SUS_8_VEC, this); - lp_vec_t sus11vec = lp_vec_t(sid.objectId, SUS_8_VEC, this); + lp_vec_t sus9vec = lp_vec_t(sid.objectId, SUS_9_VEC, this); + lp_vec_t sus10vec = lp_vec_t(sid.objectId, SUS_10_VEC, this); + lp_vec_t sus11vec = lp_vec_t(sid.objectId, SUS_11_VEC, this); lp_vec_t susVecTot = lp_vec_t(sid.objectId, SUS_VEC_TOT, this); lp_vec_t susVecTotDerivative = lp_vec_t(sid.objectId, SUS_VEC_TOT_DERIVATIVE, this);