Skip to content

Commit 48dbdd0

Browse files
committed
Merge branch 'main' into the-bay-kay/add_edgeshark_and_eonti_mre
2 parents 7d8ae57 + 0feea2d commit 48dbdd0

7 files changed

+2589
-13
lines changed

demo-iso15118-2-ac-plus-ocpp.sh

+22-7
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
DEMO_REPO="https://github.com/everest/everest-demo.git"
55
DEMO_BRANCH="main"
66

7-
CSMS_REPO="https://github.com/thoughtworks/maeve-csms.git"
8-
CSMS_BRANCH="b990d0eddf2bf80be8d9524a7b08029fbb305c7d" # patch files are based on this commit
7+
CSMS_REPO="https://github.com/louisg1337/maeve-csms.git"
8+
# CSMS_BRANCH="b990d0eddf2bf80be8d9524a7b08029fbb305c7d" # patch files are based on this commit
9+
CSMS_BRANCH="set_charging_profile"
910
CSMS="maeve"
1011

1112

@@ -91,6 +92,7 @@ cd "${DEMO_DIR}" || exit 1
9192

9293
echo "Cloning EVerest from ${DEMO_REPO} into ${DEMO_DIR}/everest-demo"
9394
git clone --branch "${DEMO_BRANCH}" "${DEMO_REPO}" everest-demo
95+
# cp -r "${DEMO_REPO}" everest-demo
9496

9597
echo "Run with Edgeshark? $RUN_WITH_EDGESHARK"
9698

@@ -102,7 +104,12 @@ fi
102104

103105
if [[ "$DEMO_VERSION" != v1.6j ]]; then
104106
echo "Cloning ${CSMS} CSMS from ${CSMS_REPO} into ${DEMO_DIR}/${CSMS}-csms and starting it"
105-
git clone ${CSMS_REPO} ${CSMS}-csms
107+
108+
if [[ ${CSMS} == "maeve" ]]; then
109+
git clone --branch "${CSMS_BRANCH}" "${CSMS_REPO}" ${CSMS}-csms
110+
else
111+
git clone ${CSMS_REPO} ${CSMS}-csms
112+
fi
106113

107114
pushd ${CSMS}-csms || exit 1
108115

@@ -123,9 +130,6 @@ if [[ "$DEMO_VERSION" != v1.6j ]]; then
123130
fi
124131
else
125132
cp ../everest-demo/manager/cached_certs_correct_name_emaid.tar.gz .
126-
127-
echo "Patching the CSMS to disable load balancer"
128-
patch -p1 -i ../everest-demo/maeve/maeve-csms-no-lb.patch
129133
fi
130134

131135
# Set up certificates for SP2 and SP3
@@ -185,6 +189,7 @@ if [[ "$DEMO_VERSION" != v1.6j ]]; then
185189
fi
186190
fi
187191

192+
docker compose build
188193
docker compose up -d
189194

190195
echo "Waiting 5s for CSMS to start..."
@@ -349,7 +354,17 @@ fi
349354

350355
pushd everest-demo || exit 1
351356
docker compose --project-name everest-ac-demo --file "${DEMO_COMPOSE_FILE_NAME}" up -d --wait
357+
358+
# Configure and restart nodered
359+
docker cp nodered/config/config-sil-iso15118-ac-flow.json everest-ac-demo-nodered-1:/config/config-sil-two-evse-flow.json
360+
docker restart everest-ac-demo-nodered-1
361+
362+
# Configure and restart EVerest
352363
docker cp config-sil-ocpp201-pnc.yaml everest-ac-demo-manager-1:/ext/source/config/config-sil-ocpp201-pnc.yaml
364+
docker cp manager/enable_payment_method.patch everest-ac-demo-manager-1:/tmp/
365+
docker cp manager/enable_evcc_logging.cfg everest-ac-demo-manager-1:/ext/source/build/dist/etc/everest/default_logging.cfg
366+
docker exec everest-ac-demo-manager-1 /bin/bash -c "apk add patch && cd /ext && patch -p0 -i /tmp/enable_payment_method.patch"
367+
353368
if [[ "$DEMO_VERSION" =~ sp2 || "$DEMO_VERSION" =~ sp3 ]]; then
354369
docker cp manager/cached_certs_correct_name_emaid.tar.gz everest-ac-demo-manager-1:/ext/source/build
355370
docker exec everest-ac-demo-manager-1 /bin/bash -c "pushd /ext/source/build && tar xf cached_certs_correct_name_emaid.tar.gz"
@@ -358,7 +373,7 @@ if [[ "$DEMO_VERSION" =~ sp2 || "$DEMO_VERSION" =~ sp3 ]]; then
358373
docker exec everest-ac-demo-manager-1 /bin/bash -c "pushd /ext/source/build && openssl verify -show_chain -CAfile dist/etc/everest/certs/ca/v2g/V2G_ROOT_CA.pem --untrusted dist/etc/everest/certs/ca/csms/CPO_SUB_CA1.pem --untrusted dist/etc/everest/certs/ca/csms/CPO_SUB_CA2.pem dist/etc/everest/certs/client/csms/CSMS_LEAF.pem"
359374
fi
360375

361-
if [[ ${CSMS} == "citrine" ]]; then
376+
if [[ ${CSMS} == "citrine" && ! ("$DEMO_VERSION" =~ sp1) ]]; then
362377
echo "TODO: Set up device model correctly!"
363378
else
364379
if [[ "$DEMO_VERSION" =~ sp1 ]]; then
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
#!/bin/bash
2+
3+
# Check if the correct number of arguments are provided
4+
if [ "$#" -ne 2 ]; then
5+
echo "Usage: $0 <identifier> <tenantId>"
6+
exit 1
7+
fi
8+
9+
# Assign arguments to variables
10+
IDENTIFIER=$1
11+
TENANT_ID=$2
12+
13+
echo "setChargingProfile called with Identifier: ${IDENTIFIER} and tenandId: ${TENANT_ID}"
14+
15+
curl -X 'POST' \
16+
"http://localhost:8080/ocpp/smartcharging/setChargingProfile?identifier=${IDENTIFIER}&tenantId=${TENANT_ID}" \
17+
-H 'accept: */*' \
18+
-H 'Content-Type: application/json' \
19+
-d '{
20+
"customData": {
21+
"vendorId": "string"
22+
},
23+
"evseId": 0,
24+
"chargingProfile": {
25+
"customData": {
26+
"vendorId": "string"
27+
},
28+
"id": 0,
29+
"stackLevel": 0,
30+
"chargingProfilePurpose": "ChargingStationExternalConstraints",
31+
"chargingProfileKind": "Absolute",
32+
"recurrencyKind": "Daily",
33+
"validFrom": "2024-06-03T21:58:35.240Z",
34+
"validTo": "2024-06-03T21:58:35.240Z",
35+
"chargingSchedule": [
36+
{
37+
"customData": {
38+
"vendorId": "string"
39+
},
40+
"id": 0,
41+
"startSchedule": "2024-06-03T21:58:35.240Z",
42+
"duration": 0,
43+
"chargingRateUnit": "W",
44+
"chargingSchedulePeriod": [
45+
{
46+
"customData": {
47+
"vendorId": "string"
48+
},
49+
"startPeriod": 0,
50+
"limit": 0,
51+
"numberPhases": 0,
52+
"phaseToUse": 0
53+
}
54+
],
55+
"minChargingRate": 0,
56+
"salesTariff": {
57+
"customData": {
58+
"vendorId": "string"
59+
},
60+
"id": 0,
61+
"salesTariffDescription": "string",
62+
"numEPriceLevels": 0,
63+
"salesTariffEntry": [
64+
{
65+
"customData": {
66+
"vendorId": "string"
67+
},
68+
"relativeTimeInterval": {
69+
"customData": {
70+
"vendorId": "string"
71+
},
72+
"start": 0,
73+
"duration": 0
74+
},
75+
"ePriceLevel": 0,
76+
"consumptionCost": [
77+
{
78+
"customData": {
79+
"vendorId": "string"
80+
},
81+
"startValue": 0,
82+
"cost": [
83+
{
84+
"customData": {
85+
"vendorId": "string"
86+
},
87+
"costKind": "CarbonDioxideEmission",
88+
"amount": 0,
89+
"amountMultiplier": 0
90+
}
91+
]
92+
}
93+
]
94+
}
95+
]
96+
}
97+
}
98+
],
99+
"transactionId": "string"
100+
}
101+
}'
+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
#!/bin/bash
2+
3+
if [ "$#" -ne 1 ]; then
4+
echo "Usage: $0 <chargingStation>"
5+
exit 1
6+
fi
7+
8+
CS=$1
9+
10+
echo "setChargingProfile called with Charging Station: ${CS}"
11+
12+
curl -X POST \
13+
"http://localhost:9410/api/v0/cs/${CS}/setchargingprofile" \
14+
-H "Content-Type: application/json" \
15+
-d '{
16+
"chargingProfileKind": "Absolute",
17+
"chargingProfilePurpose": "TxProfile",
18+
"chargingSchedule": [
19+
{
20+
"chargingRateUnit": "W",
21+
"chargingSchedulePeriod": [
22+
{
23+
"limit": 22.5,
24+
"startPeriod": 0,
25+
"numberPhases": 3
26+
},
27+
{
28+
"limit": 20.0,
29+
"startPeriod": 3600,
30+
"numberPhases": 3
31+
}
32+
],
33+
"id": 1,
34+
"minChargingRate": 5.0,
35+
"salesTariff": {
36+
"id": 1,
37+
"numEPriceLevels": 2,
38+
"salesTariffDescription": "Standard Tariff",
39+
"salesTariffEntry": [
40+
{
41+
"relativeTimeInterval": {
42+
"start": 0,
43+
"duration": 3600
44+
},
45+
"consumptionCost": [
46+
{
47+
"cost": [
48+
{
49+
"amount": 15,
50+
"costKind": "RelativePricePercentage"
51+
}
52+
],
53+
"startValue": 10.0
54+
}
55+
]
56+
}
57+
]
58+
}
59+
}
60+
],
61+
"id": 1,
62+
"stackLevel": 0,
63+
"transactionId": "12345",
64+
"validFrom": "2024-06-07T10:00:00Z",
65+
"validTo": "2024-06-07T18:00:00Z"
66+
}'

maeve/maeve-csms-ignore-ocsp.patch

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,29 @@ diff --git a/manager/handlers/ocpp201/authorize.go b/manager/handlers/ocpp201/au
22
index 5df2305..0db9f79 100644
33
--- a/manager/handlers/ocpp201/authorize.go
44
+++ b/manager/handlers/ocpp201/authorize.go
5-
@@ -49,7 +49,12 @@ func (a AuthorizeHandler) HandleCall(ctx context.Context, chargeStationId string
5+
@@ -38,7 +38,12 @@ func (a AuthorizeHandler) HandleCall(ctx context.Context, chargeStationId string
66
if req.Certificate != nil {
77
_, err = a.CertificateValidationService.ValidatePEMCertificateChain(ctx, []byte(*req.Certificate), req.IdToken.IdToken)
8-
status, certificateStatus = handleCertificateValidationError(err)
8+
idTokenInfo.Status, certificateStatus = handleCertificateValidationError(err)
99
- if err != nil {
1010
+ if err.Error() == "failed to perform ocsp check after 1 attempts" {
1111
+ var tempStatus = types.AuthorizeCertificateStatusEnumTypeAccepted
1212
+ certificateStatus = &tempStatus
13-
+ status = types.AuthorizationStatusEnumTypeAccepted
13+
+ idTokenInfo.Status = types.AuthorizationStatusEnumTypeAccepted
1414
+ span.SetAttributes(attribute.String("authorize.cert_warn", "No OCSP, but ignoring for testing purpose."))
1515
+ } else if err != nil {
1616
span.SetAttributes(attribute.String("authorize.cert_error", err.Error()))
1717
}
1818
}
19-
@@ -57,7 +62,12 @@ func (a AuthorizeHandler) HandleCall(ctx context.Context, chargeStationId string
19+
@@ -46,7 +46,12 @@ func (a AuthorizeHandler) HandleCall(ctx context.Context, chargeStationId string
2020
if req.Iso15118CertificateHashData != nil {
2121
_, err := a.CertificateValidationService.ValidateHashedCertificateChain(ctx, *req.Iso15118CertificateHashData)
22-
status, certificateStatus = handleCertificateValidationError(err)
22+
idTokenInfo.Status, certificateStatus = handleCertificateValidationError(err)
2323
- if err != nil {
2424
+ if err.Error() == "failed to perform ocsp check after 1 attempts" {
2525
+ var tempStatus = types.AuthorizeCertificateStatusEnumTypeAccepted
2626
+ certificateStatus = &tempStatus
27-
+ status = types.AuthorizationStatusEnumTypeAccepted
27+
+ idTokenInfo.Status = types.AuthorizationStatusEnumTypeAccepted
2828
+ span.SetAttributes(attribute.String("authorize.cert_warn", "No OCSP, but ignoring for testing purpose."))
2929
+ } else if err != nil {
3030
span.SetAttributes(attribute.String("authorize.cert_error", err.Error()))

manager/enable_evcc_logging.cfg

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# for documentation on this file format see:
2+
# https://www.boost.org/doc/libs/1_54_0/libs/log/doc/html/log/detailed/utilities.html#log.detailed.utilities.setup.filter_formatter
3+
4+
[Core]
5+
DisableLogging=false
6+
7+
# To get debug logs of only one module, add the "%Process% contains" filter, e.g.:
8+
#
9+
# "(%Process% contains OCPP201 and %Severity% >= DEBG)"
10+
#
11+
# whereas "OCPP201" is the value of the field `active_modules.NAME.module` in the respective /config/config-*.yaml.
12+
Filter="%Severity% >= INFO or (%Process% contains iso15118_car and %Severity% >= DEBG)"
13+
14+
[Sinks.Console]
15+
Destination=Console
16+
# Filter="%Target% contains \"MySink1\""
17+
Format="%TimeStamp% [%Severity%] \033[1;32m%Process%\033[0m \033[1;36m%function%\033[0m \033[1;30m%file%:\033[0m\033[1;32m%line%\033[0m: %Message%"
18+
Asynchronous=false
19+
AutoFlush=true
20+
SeverityStringColorDebug="\033[1;30m"
21+
SeverityStringColorInfo="\033[1;37m"
22+
SeverityStringColorWarning="\033[1;33m"
23+
SeverityStringColorError="\033[1;31m"
24+
SeverityStringColorCritical="\033[1;35m"

0 commit comments

Comments
 (0)