Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🔌📊 Generate PowerGraphs for Charging Sessions W/O DT #95

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
TAG=0.0.21
TAG=0.0.22

EVEREST_MANAGER_CPUS='1.0'
EVEREST_MANAGER_MEMORY='1024mb'
1 change: 1 addition & 0 deletions manager/config-sil-ocpp201-pnc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ active_modules:
ac_hlc_enabled: true
ac_hlc_use_5percent: false
ac_enforce_hlc: false
max_current_import_A: 16
connections:
bsp:
- module_id: yeti_driver_1
Expand Down
Binary file not shown.
4 changes: 4 additions & 0 deletions manager/demo-patch-scripts/apply-runtime-patches.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,15 @@ echo "Applying pyjosev_module_enabledt.patch"
cd / && patch -p0 -N -i /tmp/demo-patches/pyjosev_module_enabledt.patch
echo "Applying simulator_enabledt.patch"
cd / && patch -p0 -N -i /tmp/demo-patches/simulator_enabledt.patch
echo "Applying iso15118_prevent_m1_crash.patch"
cd / && patch -p0 -N -i /tmp/demo-patches/iso15118_prevent_m1_crash.patch

echo "Applying enabled_payment_method_in_python.patch"
cd /ext && patch -p0 -i /tmp/demo-patches/enable_payment_method_in_python.patch
echo "Applying support_payment_in_jsevmanager.patch"
cd /ext/dist/libexec/everest && patch -p1 -i /tmp/demo-patches/support_payment_in_jsevmanager.patch
echo "Applying hw_cap_down_to_16A.patch"
cd / && patch -p0 -i /tmp/demo-patches/hw_cap_down_to_16A.patch

cp /tmp/demo-patches/power_curve.py \
/ext/dist/libexec/everest/3rd_party/josev/iso15118/evcc/states/
Expand Down
22 changes: 22 additions & 0 deletions manager/demo-patches/hw_cap_down_to_16A.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
--- /ext/dist/libexec/everest/modules/JsYetiSimulator/index.js
+++ /ext/dist/libexec/everest/modules/JsYetiSimulator/index.js
@@ -1434,7 +1434,7 @@ boot_module(async ({
clearData(mod);

mod.provides.board_support.publish.capabilities({
- max_current_A_import: 32.0,
+ max_current_A_import: 16.0,
min_current_A_import: 6.0,
max_phase_count_import: 3,
min_phase_count_import: 1,
--- /ext/dist/share/everest/modules/OCPP201/component_config/standardized/SmartChargingCtrlr.json
+++ /ext/dist/share/everest/modules/OCPP201/component_config/standardized/SmartChargingCtrlr.json
@@ -191,7 +191,7 @@
{
"type": "Actual",
"mutability": "ReadWrite",
- "value": 48
+ "value": 16
}
],
"type": "integer",
10 changes: 10 additions & 0 deletions manager/demo-patches/iso15118_prevent_m1_crash.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
--- /ext/dist/libexec/everest/3rd_party/josev/iso15118/evcc/transport/udp_client.py
+++ /ext/dist/libexec/everest/3rd_party/josev/iso15118/evcc/transport/udp_client.py
@@ -65,7 +65,7 @@
# as the dual of bind(), in the server side, since bind() controls which
# interface(s) the socket receives multicast packets from.
interface_index = socket.if_nametoindex(iface)
- sock.setsockopt(socket.IPPROTO_IPV6, socket.IPV6_MULTICAST_IF, interface_index)
+ # sock.setsockopt(socket.IPPROTO_IPV6, socket.IPV6_MULTICAST_IF, interface_index)

return sock
56 changes: 56 additions & 0 deletions manager/demo-patches/limit_logging.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
diff --git a/modules/EnergyNode/energy_grid/energyImpl.cpp b/modules/EnergyNode/energy_grid/energyImpl.cpp
index f7afcc99..fc88f8c2 100644
--- a/modules/EnergyNode/energy_grid/energyImpl.cpp
+++ b/modules/EnergyNode/energy_grid/energyImpl.cpp
@@ -64,6 +64,7 @@ void energyImpl::init() {

types::energy::ScheduleReqEntry energyImpl::get_local_schedule() {
// local schedule of this module
+ EVLOG_debug << "Getting local schedule with fuse limit: " << mod->config.fuse_limit_A;;
types::energy::ScheduleReqEntry local_schedule;
auto tp = date::utc_clock::now();

@@ -79,6 +80,7 @@ types::energy::ScheduleReqEntry energyImpl::get_local_schedule() {

void energyImpl::set_external_limits(types::energy::ExternalLimits& l) {
std::scoped_lock lock(energy_mutex);
+ EVLOG_debug << "Setting external limits with fuse limit: " << mod->config.fuse_limit_A;;

if (l.schedule_import.has_value()) {
energy_flow_request.schedule_import = l.schedule_import;
diff --git a/modules/EvseManager/energy_grid/energyImpl.cpp b/modules/EvseManager/energy_grid/energyImpl.cpp
index af290e86..2260e819 100644
--- a/modules/EvseManager/energy_grid/energyImpl.cpp
+++ b/modules/EvseManager/energy_grid/energyImpl.cpp
@@ -54,6 +54,7 @@ void energyImpl::clear_import_request_schedule() {
const auto tp =
Everest::Date::to_rfc3339(date::floor<std::chrono::hours>(tpnow) + date::get_leap_second_info(tpnow).elapsed);

+ EVLOG_info << "Clearing import request schedule by setting max current from hw_caps = " << hw_caps.max_current_A_import;
entry_import.timestamp = tp;
entry_import.limits_to_root.ac_max_phase_count = hw_caps.max_phase_count_import;
entry_import.limits_to_root.ac_min_phase_count = hw_caps.min_phase_count_import;
@@ -79,6 +80,7 @@ void energyImpl::clear_export_request_schedule() {
const auto tp =
Everest::Date::to_rfc3339(date::floor<std::chrono::hours>(tpnow) + date::get_leap_second_info(tpnow).elapsed);

+ EVLOG_info << "Clearing export request schedule by setting max current from hw_caps = " << hw_caps.max_current_A_import;
entry_export.timestamp = tp;
entry_export.limits_to_root.ac_max_phase_count = hw_caps.max_phase_count_export;
entry_export.limits_to_root.ac_min_phase_count = hw_caps.min_phase_count_export;
@@ -353,6 +355,7 @@ void energyImpl::handle_enforce_limits(types::energy::EnforcedLimits& value) {
if (value.limits_root_side.has_value()) {
// set enforced AC current limit
if (value.limits_root_side.value().ac_max_current_A.has_value()) {
+ EVLOG_info << "Handle enforce limits with ac_max_current_A = " << value.limits_root_side.value().ac_max_current_A.value();
limit = value.limits_root_side.value().ac_max_current_A.value();
}

@@ -383,6 +386,7 @@ void energyImpl::handle_enforce_limits(types::energy::EnforcedLimits& value) {
mod->mqtt.publish(fmt::format("everest_external/nodered/{}/state/max_watt", mod->config.connector_id),
value.limits_root_side.value().total_power_W.value());

+ EVLOG_info << "Handle enforce limits with total_power_W = " << value.limits_root_side.value().total_power_W.value();
float a = value.limits_root_side.value().total_power_W.value() / mod->config.ac_nominal_voltage /
mod->ac_nr_phases_active;
if (a < limit) {
2 changes: 1 addition & 1 deletion manager/disable_iso_tls.patch
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
--- /tmp/config-sil-ocpp201-pnc.yaml
--- config/config-sil-ocpp201-pnc.yaml
+++ config/config-sil-ocpp201-pnc.yaml
@@ -14,7 +14,7 @@
config_module:
Expand Down
9 changes: 9 additions & 0 deletions nodered/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
FROM nodered/node-red:4.0.5

# Install Node Dependancies
RUN npm install node-red-dashboard
RUN npm install node-red-contrib-ui-actions
RUN npm install node-red-node-ui-table
RUN npm install node-red-contrib-ui-level

# Setup Python Virtual Environment for Powercurve Generation
RUN python3 -m venv /usr/src/node-red/python_environments/everest
RUN /usr/src/node-red/python_environments/everest/bin/python3 -m ensurepip
RUN /usr/src/node-red/python_environments/everest/bin/pip3 install numpy control
COPY --chown=node-red:root scripts /bin/scripts/

#Copy over node-red flows
COPY --chown=node-red:root config /config

LABEL org.opencontainers.image.source=https://github.com/everest/everest-demo
Loading
Loading