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

Expand the "one-line shell script" to download, patch and run MaEVe as well #22

Merged
merged 2 commits into from
Mar 7, 2024
Merged
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 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
- 🚨 Two EVSE Charging ⚡: `curl https://raw.githubusercontent.com/everest/everest-demo/main/demo-two-evse.sh | bash`
- 🚨 E2E Automated Tests ⚡: `curl https://raw.githubusercontent.com/everest/everest-demo/main/demo-automated-testing.sh | bash`
- 🚨 Basic and ISO 15118-2 AC Charging with OCPP 1.6J CSMS ⚡: `curl https://raw.githubusercontent.com/everest/everest-demo/main/demo-iso15118-2-ac-plus-ocpp16j.sh | bash`
- 🚨 Basic and ISO 15118-2 AC Charging with OCPP 1.6J CSMS ⚡: `curl https://raw.githubusercontent.com/everest/everest-demo/main/demo-iso15118-2-ac-plus-ocpp16j.sh | bash`
- 🚨 Basic and ISO 15118-2 AC Charging with OCPP 1.6J CSMS ⚡: `curl https://raw.githubusercontent.com/everest/everest-demo/main/demo-iso15118-2-ac-plus-ocpp201.sh | bash`

Check notice on line 66 in README.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

README.md#L66

Expected: 2; Actual: 4

### STEP 2: Interact with the demo
- Open the `nodered` flows to understand the module flows at http://127.0.0.1:1880
Expand Down
29 changes: 29 additions & 0 deletions demo-iso15118-2-ac-plus-ocpp201.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
local -r repo_raw_url='https://raw.githubusercontent.com/everest/everest-demo/main'
local -r destination_path="${DEMO_DIR}/${repo_file_path}"

echo "Downloading ${repo_raw_url}/${repo_file_path} to ${destination_path}"

mkdir -p "$(dirname ${destination_path})"
curl -s -o "${destination_path}" "${repo_raw_url}/${repo_file_path}"
if [[ "$?" != 0 ]]; then
Expand All @@ -30,5 +32,32 @@
download_demo_file "${DEMO_COMPOSE_FILE_NAME}"
download_demo_file .env

echo "Cloning MaEVe CSMS and starting it"
git clone https://github.com/thoughtworks/maeve-csms.git ${DEMO_DIR}/maeve-csms

Check warning on line 36 in demo-iso15118-2-ac-plus-ocpp201.sh

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

demo-iso15118-2-ac-plus-ocpp201.sh#L36

Double quote to prevent globbing and word splitting.
pushd ${DEMO_DIR}/maeve-csms

Check warning on line 37 in demo-iso15118-2-ac-plus-ocpp201.sh

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

demo-iso15118-2-ac-plus-ocpp201.sh#L37

Double quote to prevent globbing and word splitting.
download_demo_file "maeve/maeve-csms.patch"
mv ../maeve/maeve-csms.patch .
patch -p1 -i maeve-csms.patch
docker compose up -d
echo "MaEVe CSMS started, adding charge station"

curl http://localhost:9410/api/v0/cs/cp001 -H 'content-type: application/json' \
-d '{"securityProfile": 0, "base64SHA256Password": "3oGi4B5I+Y9iEkYtL7xvuUxrvGOXM/X2LQrsCwf/knA="}'

echo "Charge station added, adding user token"

curl http://localhost:9410/api/v0/token -H 'content-type: application/json' -d '{
"countryCode": "GB",
"partyId": "TWK",
"type": "RFID",
"uid": "DEADBEEF",
"contractId": "GBTWK012345678V",
"issuer": "Thoughtworks",
"valid": true,
"cacheMode": "ALWAYS"
}'

echo "User token added, starting EVerest..."

docker compose --project-name everest-ac-demo \
--file "${DEMO_DIR}/${DEMO_COMPOSE_FILE_NAME}" up