From 327646c0a1aa8fc59b9b5447fe18675bb768ec84 Mon Sep 17 00:00:00 2001 From: louisg1337 Date: Sat, 8 Jun 2024 11:44:39 -0400 Subject: [PATCH 1/2] Fixed demo script to point to my MaEVe branch that supports set charging profile. Also added a script that will make that API request for us Signed-off-by: louisg1337 --- demo-iso15118-2-ac-plus-ocpp.sh | 8 ++- demo-scripts/maeve-set-charging-profile.sh | 66 ++++++++++++++++++++++ 2 files changed, 71 insertions(+), 3 deletions(-) create mode 100644 demo-scripts/maeve-set-charging-profile.sh diff --git a/demo-iso15118-2-ac-plus-ocpp.sh b/demo-iso15118-2-ac-plus-ocpp.sh index 30b7a67b..970a2593 100755 --- a/demo-iso15118-2-ac-plus-ocpp.sh +++ b/demo-iso15118-2-ac-plus-ocpp.sh @@ -4,8 +4,9 @@ DEMO_REPO="https://github.com/everest/everest-demo.git" DEMO_BRANCH="main" -CSMS_REPO="https://github.com/thoughtworks/maeve-csms.git" -CSMS_BRANCH="b990d0eddf2bf80be8d9524a7b08029fbb305c7d" # patch files are based on this commit +CSMS_REPO="https://github.com/louisg1337/maeve-csms.git" +# CSMS_BRANCH="b990d0eddf2bf80be8d9524a7b08029fbb305c7d" # patch files are based on this commit +CSMS_BRANCH="set_charging_profile" CSMS="maeve" @@ -93,7 +94,7 @@ git clone --branch "${DEMO_BRANCH}" "${DEMO_REPO}" everest-demo if [[ "$DEMO_VERSION" != v1.6j ]]; then echo "Cloning ${CSMS} CSMS from ${CSMS_REPO} into ${DEMO_DIR}/${CSMS}-csms and starting it" - git clone ${CSMS_REPO} ${CSMS}-csms + git clone --branch "${CSMS_BRANCH}" "${CSMS_REPO}" ${CSMS}-csms pushd ${CSMS}-csms || exit 1 @@ -176,6 +177,7 @@ if [[ "$DEMO_VERSION" != v1.6j ]]; then fi fi + docker compose build docker compose up -d echo "Waiting 5s for CSMS to start..." diff --git a/demo-scripts/maeve-set-charging-profile.sh b/demo-scripts/maeve-set-charging-profile.sh new file mode 100644 index 00000000..c0aaca53 --- /dev/null +++ b/demo-scripts/maeve-set-charging-profile.sh @@ -0,0 +1,66 @@ +#!/bin/bash + +if [ "$#" -ne 1 ]; then + echo "Usage: $0 " + exit 1 +fi + +CS=$1 + +echo "setChargingProfile called with Charging Station: ${CS}" + +curl -X POST \ + "http://localhost:9410/api/v0/cs/${CS}/setchargingprofile" \ + -H "Content-Type: application/json" \ + -d '{ + "chargingProfileKind": "Absolute", + "chargingProfilePurpose": "TxProfile", + "chargingSchedule": [ + { + "chargingRateUnit": "W", + "chargingSchedulePeriod": [ + { + "limit": 22.5, + "startPeriod": 0, + "numberPhases": 3 + }, + { + "limit": 20.0, + "startPeriod": 3600, + "numberPhases": 3 + } + ], + "id": 1, + "minChargingRate": 5.0, + "salesTariff": { + "id": 1, + "numEPriceLevels": 2, + "salesTariffDescription": "Standard Tariff", + "salesTariffEntry": [ + { + "relativeTimeInterval": { + "start": 0, + "duration": 3600 + }, + "consumptionCost": [ + { + "cost": [ + { + "amount": 15, + "costKind": "RelativePricePercentage" + } + ], + "startValue": 10.0 + } + ] + } + ] + } + } + ], + "id": 1, + "stackLevel": 0, + "transactionId": "12345", + "validFrom": "2024-06-07T10:00:00Z", + "validTo": "2024-06-07T18:00:00Z" + }' From 8f2b2a412a429d88b0d250404d0b349079bc7cd2 Mon Sep 17 00:00:00 2001 From: louisg1337 Date: Sat, 8 Jun 2024 12:57:37 -0400 Subject: [PATCH 2/2] Fixed git cloning issue. MaEVe depends on my branch, while Citrine depends on specific SHA of a commit on the main, so handle accordingly Signed-off-by: louisg1337 --- demo-iso15118-2-ac-plus-ocpp.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/demo-iso15118-2-ac-plus-ocpp.sh b/demo-iso15118-2-ac-plus-ocpp.sh index 970a2593..6a96e158 100755 --- a/demo-iso15118-2-ac-plus-ocpp.sh +++ b/demo-iso15118-2-ac-plus-ocpp.sh @@ -94,7 +94,12 @@ git clone --branch "${DEMO_BRANCH}" "${DEMO_REPO}" everest-demo if [[ "$DEMO_VERSION" != v1.6j ]]; then echo "Cloning ${CSMS} CSMS from ${CSMS_REPO} into ${DEMO_DIR}/${CSMS}-csms and starting it" - git clone --branch "${CSMS_BRANCH}" "${CSMS_REPO}" ${CSMS}-csms + + if [[ ${CSMS} == "maeve" ]]; then + git clone --branch "${CSMS_BRANCH}" "${CSMS_REPO}" ${CSMS}-csms + else + git clone ${CSMS_REPO} ${CSMS}-csms + fi pushd ${CSMS}-csms || exit 1