From 211a2c22cc9df6e79ac249438cdba3cba72e391a Mon Sep 17 00:00:00 2001 From: Shankari Date: Sun, 17 Nov 2024 18:09:48 -0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=8AAdd=20in=20additional=20logs=20to?= =?UTF-8?q?=20help=20us=20debug=20composite=20schedules?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As outlined in https://github.com/EVerest/everest-demo/issues/90#issuecomment-2481606481 Signed-off-by: Shankari --- .../apply-compile-patches.sh | 1 + .../composite_schedule_fixes.patch | 34 +++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 manager/demo-patches/composite_schedule_fixes.patch diff --git a/manager/demo-patch-scripts/apply-compile-patches.sh b/manager/demo-patch-scripts/apply-compile-patches.sh index b23195dd..943eea0d 100644 --- a/manager/demo-patch-scripts/apply-compile-patches.sh +++ b/manager/demo-patch-scripts/apply-compile-patches.sh @@ -3,3 +3,4 @@ echo "Applying compile-time patches" cd / && patch -p0 -i /tmp/demo-patches/enable_iso_dt.patch +cd / && patch -p1 -i /tmp/demo-patches/composite_schedule_fixes.patch diff --git a/manager/demo-patches/composite_schedule_fixes.patch b/manager/demo-patches/composite_schedule_fixes.patch new file mode 100644 index 00000000..c9608f9e --- /dev/null +++ b/manager/demo-patches/composite_schedule_fixes.patch @@ -0,0 +1,34 @@ +diff --git a/modules/API/API.cpp b/modules/API/API.cpp +index 68c4900d..03425dc4 100644 +--- a/ext/source/modules/API/API.cpp ++++ b/ext/source/modules/API/API.cpp +@@ -573,6 +573,7 @@ void API::init() { + if (this->r_ocpp.size() == 1) { + + this->r_ocpp.at(0)->subscribe_is_connected([this](bool is_connected) { ++ EVLOG_info << "Received OCPP connection status callback with is_connected: " << is_connected; + std::scoped_lock lock(ocpp_data_mutex); + if (is_connected) { + this->ocpp_connection_status = "connected"; +@@ -582,6 +583,7 @@ void API::init() { + }); + + this->r_ocpp.at(0)->subscribe_charging_schedules([this, &var_ocpp_schedule](json schedule) { ++ EVLOG_info << "Received OCPP charging schedule update: " << schedule; + std::scoped_lock lock(ocpp_data_mutex); + this->ocpp_charging_schedule = schedule; + this->ocpp_charging_schedule_updated = true; +diff --git a/modules/OCPP201/OCPP201.cpp b/modules/OCPP201/OCPP201.cpp +index 83f2324b..8eb7900f 100644 +--- a/ext/source/modules/OCPP201/OCPP201.cpp ++++ b/ext/source/modules/OCPP201/OCPP201.cpp +@@ -1181,6 +1181,9 @@ void OCPP201::process_deauthorized(const int32_t evse_id, const int32_t connecto + } + + void OCPP201::publish_charging_schedules(const std::vector& composite_schedules) { ++ EVLOG_info << "About to publish composite charging schedules: "; ++ for (ocpp::v201::CompositeSchedule cs: composite_schedules) ++ EVLOG_info << cs << '\n'; + const auto everest_schedules = conversions::to_everest_charging_schedules(composite_schedules); + this->p_ocpp_generic->publish_charging_schedules(everest_schedules); + }