Skip to content

Conversation

@Abby-Wheelis
Copy link
Collaborator

In alignment with #101 (comment), creating a quick script to highlight to CSMS's that they can test with EVerest!

Abby-Wheelis and others added 22 commits November 14, 2024 12:12
update to demo-iso15118-2-ocpp-201.sh from deprecated demo-iso15118-2-ac-plus-ocpp.sh 

Signed-off-by: Abby Wheelis <54848919+Abby-Wheelis@users.noreply.github.com>
AC -> DC

Signed-off-by: Abby Wheelis <54848919+Abby-Wheelis@users.noreply.github.com>
It looks like the limits applied to the JsYetiSimulator are
on a per-phase basis, although limits applied elsewhere are
not. This makes things very confusing. We will fix this by
configuring everything to a per-phase limit of 16A

Please see
EVerest#92 (comment)
to
EVerest#92 (comment)

Locations changed:
- config
- JsYetiSimulator
- SmartCharging OCPP defaults

Also fix the disable_iso_tls patch to not have a starting `/`

Add a new patch file to enable limit logging but don't enable
it by default. This may help future efforts to debug this.

Signed-off-by: Shankari <k.shankari@driveelectric.gov>
Consistent with
EVerest#92 (comment)

History starts at:
EVerest#92 (comment)

Also show dots in the chart
Also convert the time range to/from local time so it makes
sense

Signed-off-by: Shankari <k.shankari@driveelectric.gov>
Signed-off-by: Shankari <k.shankari@driveelectric.gov>
🔧 configure limits in a way that is consistent and makes sense
- Do not throttle the SASchedule from the EV based on departure time, only
  transmit the composite pmax schedule. The EV will deareate based on
  departure time
- Show the values in the current power delivery request instead of the
  progress towards the eamount so that we can see the impact of curtailing the
  pmax
- Pass in the pmax to the power curve computation algo, although it is
  currently a NOP

This fixes: EVerest#92 (comment)

Signed-off-by: Shankari <k.shankari@driveelectric.gov>
+ configure the chart to display kW
+ convert relative timestamps to display timestamps by adding to the start time
of the charge session

Signed-off-by: Shankari <k.shankari@driveelectric.gov>
Signed-off-by: Shankari <k.shankari@driveelectric.gov>
Make the EV-computed curve more meaningful
…hanges

Changes:
- EVerest manager uses the changes to receive a limit through the API, pass it
  through to the OCPP module, store it in the database and use it to influence
  the power limits
- Node-red sends the correct MQTT messages
- MaEVe manager has an NOP implementation of notify limit

The actual changes/patches are listed here and will need to be merged in one
step at a time
EVerest#101 (comment)

Testing done:
```
$ bash demo-iso15118-2-ocpp-201.sh -1 -r $(pwd) -m
$ docker exec -it everest-ac-demo-manager-1 /bin/bas
(container) $ sh /ext/build/run-scripts/run-sil-ocpp201-pnc.sh
```

Then
- moved the slider to various points, the max current changed
- plugged in car, handshake was successful
- moved the slider while the car was plugged in, max current changed and power drawn changed
- cleared limit, max current went to 16 and max power went to 11kW

Signed-off-by: Shankari <k.shankari@driveelectric.gov>
💩 🔧 Configure the demo to use pre-built images for the notify limit c…
required for demo functionality after switching to one phase so charging will actually initiate

Signed-off-by: Abby Wheelis <54848919+Abby-Wheelis@users.noreply.github.com>
demo follows demo-iso15118-2-ocpp-201.sh except: checks for url in environment, if not configured, exits

tested by: setting url as patch would, working normally, removed, failed with error message

Signed-off-by: Abby Wheelis <54848919+Abby-Wheelis@users.noreply.github.com>
include instructions to set csms url

Signed-off-by: Abby Wheelis <54848919+Abby-Wheelis@users.noreply.github.com>
Signed-off-by: Abby Wheelis <54848919+Abby-Wheelis@users.noreply.github.com>
clarify direction and give and example

Signed-off-by: Abby Wheelis <54848919+Abby-Wheelis@users.noreply.github.com>
make it more clear what is code, and what is prose

Signed-off-by: Abby Wheelis <54848919+Abby-Wheelis@users.noreply.github.com>
Signed-off-by: Abby Wheelis <54848919+Abby-Wheelis@users.noreply.github.com>
@Abby-Wheelis
Copy link
Collaborator Author

Testing done:

had regular 1-line demo up, ran before setting url then after

awheelis@sdesk-37031s ~ % curl https://raw.githubusercontent.com/abby-wheelis/everest-demo/create-external-csms-demo/demo-iso15118-2-ocpp-201-ext-csms.sh | bash -s -- -1 -m
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  5584  100  5584    0     0  13496      0 --:--:-- --:--:-- --:--:-- 13487
Error: no csms url provided.

set with export CSMS_SP1_URL="url"
awheelis@sdesk-37031s ~ % export CSMS_SP1_URL="ws://host.docker.internal/ws/cp001"
awheelis@sdesk-37031s ~ % curl https://raw.githubusercontent.com/abby-wheelis/everest-demo/create-external-csms-demo/demo-iso15118-2-ocpp-201-ext-csms.sh | bash -s -- -1 -m 
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  5584  100  5584    0     0   118k      0 --:--:-- --:--:-- --:--:--  118k
DEMO REPO:        https://github.com/everest/everest-demo.git
DEMO BRANCH:      main
DEMO VERSION:     v2.0.1-sp1
DEMO CONFIG:      docker-compose.ocpp201.yml
DEMO DIR:         /var/folders/40/kvb685dn3wd4zz7twz3rbjxw0000gr/T/tmp.tSsUJi54WB
DEMO CSMS:        external
CSMS_SP1_URL:     ws://host.docker.internal/ws/cp001
CSMS_SP2_URL:     
CSMS_SP3_URL:     
Cloning EVerest from https://github.com/everest/everest-demo.git into /var/folders/40/kvb685dn3wd4zz7twz3rbjxw0000gr/T/tmp.tSsUJi54WB/everest-demo
Cloning into 'everest-demo'...
remote: Enumerating objects: 1161, done.
remote: Counting objects: 100% (480/480), done.
remote: Compressing objects: 100% (187/187), done.
remote: Total 1161 (delta 384), reused 294 (delta 293), pack-reused 681 (from 2)
Receiving objects: 100% (1161/1161), 3.02 MiB | 2.47 MiB/s, done.
Resolving deltas: 100% (597/597), done.
/var/folders/40/kvb685dn3wd4zz7twz3rbjxw0000gr/T/tmp.tSsUJi54WB/everest-demo /var/folders/40/kvb685dn3wd4zz7twz3rbjxw0000gr/T/tmp.tSsUJi54WB
API calls to CSMS finished, Starting everest
WARN[0000] /var/folders/40/kvb685dn3wd4zz7twz3rbjxw0000gr/T/tmp.tSsUJi54WB/everest-demo/docker-compose.ocpp201.yml: the attribute `version` is obsolete, it will be ignored, please remove it to avoid potential confusion 
[+] Running 3/3
 ✔ Container everest-ac-demo-mqtt-server-1  Healthy                                                                                       0.5s 
 ✔ Container everest-ac-demo-nodered-1      Healthy                                                                                       0.5s 
 ✔ Container everest-ac-demo-manager-1      Healthy                                                                                       0.5s 
Successfully copied 5.63kB to everest-ac-demo-manager-1:/ext/source/config/config-sil-ocpp201-pnc.yaml
rm: cannot remove '/ext/dist/share/everest/modules/OCPP201/component_config/custom/EVSE_2.json': No such file or directory
rm: cannot remove '/ext/dist/share/everest/modules/OCPP201/component_config/custom/Connector_2_1.json': No such file or directory
Configured to SecurityProfile: 1, disabling TLS and configuring server to ws://host.docker.internal/ws/cp001
Successfully copied 2.05kB to everest-ac-demo-manager-1:/tmp/
/ext/source /workspace
patching file config/config-sil-ocpp201-pnc.yaml
Please start the software in the loop simulation manually by running
on your laptop: docker exec -it everest-ac-demo-manager-1 /bin/bash
in the container: sh /ext/build/run-scripts/run-sil-ocpp201-pnc.sh
You can now stop and restart the manager without re-creating the container

saw log error before setting, after setting seemed to work. Able to run manager and charge in UI just as expected!

@Abby-Wheelis
Copy link
Collaborator Author

Wanted to test with something else ... maeve requires me to work out the certificate situation ...
So does citrine.

I don't think I can chase that down tonight, but I am reasonably confident that this script does what we think it does because I was able to set the url to the working maeve container and see an error when it was not set - so the environment variable does what we want it to do.

If I manage to find some time in the morning I'll work through as much of the certificates as I can.

@Abby-Wheelis Abby-Wheelis marked this pull request as ready for review January 28, 2025 04:44
@Abby-Wheelis
Copy link
Collaborator Author

maeve failed:

 => ERROR [manager builder 6/8] RUN go mod download                                                                                       3.4s 
------                                                                                                                                         
 > [manager builder 6/8] RUN go mod download:                                                                                                  
3.331 go: cloud.google.com/go@v0.111.0: Get "https://proxy.golang.org/cloud.google.com/go/@v/v0.111.0.mod": tls: failed to verify certificate: [+] Running 0/1te signed by unknown authority                                                                                                  
 ⠹ Service manager  Building                                                                                                            106.2s 
failed to solve: process "/bin/sh -c go mod download" did not complete successfully: exit code: 1

so did citrene:

 => ERROR [citrine build 5/5] RUN npm rebuild bcrypt --build-from-source && npm rebuild deasync --build-from-source                       4.2s
------
 > [citrine build 5/5] RUN npm rebuild bcrypt --build-from-source && npm rebuild deasync --build-from-source:
4.165 npm error code 1
4.166 npm error path /usr/local/apps/citrineos/node_modules/bcrypt
4.166 npm error command failed
4.166 npm error command sh -c node-pre-gyp install --fallback-to-build
4.166 npm error Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/usr/local/apps/citrineos/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node --module_name=bcrypt_lib --module_path=/usr/local/apps/citrineos/node_modules/bcrypt/lib/binding/napi-v3 --napi_version=9 --node_abi_napi=napi --napi_build_version=3 --node_napi_label=napi-v3' (1)
4.166 npm error node-pre-gyp info it worked if it ends with ok
4.166 npm error node-pre-gyp info using node-pre-gyp@1.0.11
4.166 npm error node-pre-gyp info using node@18.20.6 | linux | x64
4.166 npm error node-pre-gyp info build requesting source compile
4.166 npm error gyp info it worked if it ends with ok
4.166 npm error gyp info using node-gyp@10.1.0
4.166 npm error gyp info using node@18.20.6 | linux | x64
4.166 npm error gyp info ok 
4.166 npm error gyp info it worked if it ends with ok
4.166 npm error gyp info using node-gyp@10.1.0
4.166 npm error gyp info using node@18.20.6 | linux | x64
4.166 npm error gyp info find Python using Python version 3.11.2 found at "/usr/bin/python3"
4.166 npm error gyp http GET https://nodejs.org/download/release/v18.20.6/node-v18.20.6-headers.tar.gz
4.166 npm error gyp http fetch GET https://nodejs.org/download/release/v18.20.6/node-v18.20.6-headers.tar.gz attempt 1 failed with SELF_SIGNED_CERT_IN_CHAIN
4.166 npm error gyp WARN install got an error, rolling back install
4.166 npm error gyp ERR! configure error 
4.166 npm error gyp ERR! stack FetchError: request to https://nodejs.org/download/release/v18.20.6/node-v18.20.6-headers.tar.gz failed, reason: self-signed certificate in certificate chain
4.166 npm error gyp ERR! stack at ClientRequest.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/minipass-fetch/lib/index.js:130:14)
4.166 npm error gyp ERR! stack at ClientRequest.emit (node:events:517:28)
4.166 npm error gyp ERR! stack at _destroy (node:_http_client:882:13)
4.166 npm error gyp ERR! stack at onSocketNT (node:_http_client:902:5)
4.166 npm error gyp ERR! stack at process.processTicksAndRejections (node:internal/process/task_queues:83:21)
4.166 npm error gyp ERR! System Linux 6.10.14-linuxkit
4.166 npm error gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/usr/local/apps/citrineos/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node" "--module_name=bcrypt_lib" "--module_path=/usr/local/apps/citrineos/node_modules/bcrypt/lib/binding/napi-v3" "--napi_version=9" "--node_abi_napi=napi" "--napi_build_version=3" "--node_napi_label=napi-v3"
4.166 npm error gyp ERR! cwd /usr/local/apps/citrineos/node_modules/bcrypt
4.166 npm error gyp ERR! node -v v18.20.6
4.166 npm error gyp ERR! node-gyp -v v10.1.0
4.166 npm error gyp ERR! not ok 
4.166 npm error node-pre-gyp ERR! build error 
4.166 npm error node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/usr/local/apps/citrineos/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node --module_name=bcrypt_lib --module_path=/usr/local/apps/citrineos/node_modules/bcrypt/lib/binding/napi-v3 --napi_version=9 --node_abi_napi=napi --napi_build_version=3 --node_napi_label=napi-v3' (1)
4.166 npm error node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/usr/local/apps/citrineos/node_modules/@mapbox/node-pre-gyp/lib/util/compile.js:89:23)
4.166 npm error node-pre-gyp ERR! stack     at ChildProcess.emit (node:events:517:28)
4.166 npm error node-pre-gyp ERR! stack     at maybeClose (node:internal/child_process:1098:16)
4.166 npm error node-pre-gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:303:5)
4.166 npm error node-pre-gyp ERR! System Linux 6.10.14-linuxkit
4.166 npm error node-pre-gyp ERR! command "/usr/local/bin/node" "/usr/local/apps/citrineos/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
4.166 npm error node-pre-gyp ERR! cwd /usr/local/apps/citrineos/node_modules/bcrypt
4.166 npm error node-pre-gyp ERR! node -v v18.20.6
4.166 npm error node-pre-gyp ERR! node-pre-gyp -v v1.0.11
[+] Running 1/2 node-pre-gyp ERR! not ok
 ✔ Service directus  Built                                                                                                              115.7s 
 ⠇ Service citrine   Building                                                                                                           267.8s 
failed to solve: process "/bin/sh -c npm rebuild bcrypt --build-from-source && npm rebuild deasync --build-from-source" did not complete successfully: exit code: 1

@Abby-Wheelis
Copy link
Collaborator Author

Quick test w/ Cintrene by calling our docker compose, then exporting the same url as the patch:

Getting issues with the nodered container in EVerest which won't start, so wiping and trying again

@Abby-Wheelis
Copy link
Collaborator Author

Abby-Wheelis commented Jan 28, 2025

Error:

 ✔ Network everest-ac-demo_default                                                                                                                        Created                                                         0.1s 
 ✔ Container everest-ac-demo-mqtt-server-1                                                                                                                Started                                                         5.1s 
 ✔ Container everest-ac-demo-manager-1                                                                                                                    Started                                                         1.0s 
 ⠴ Container everest-ac-demo-nodered-1                                                                                                                    Starting                                                        1.0s 
 ! nodered The requested image's platform (linux/arm64) does not match the detected host platform (linux/amd64/v3) and no specific platform was requested                                                                 0.0s 
Error response from daemon: driver failed programming external connectivity on endpoint everest-ac-demo-nodered-1 (2a2d39b9d72dc05c561bf0e58294ab4a7ca16cd3fff017ab14988687707193e8): Bind for 0.0.0.0:1880 failed: port is already allocated

It looks like citrene and everest are trying to use the same port?

In any case, this is looking like a fail for now, running the manager and OCPP is not connecting to the client:

2025-01-28 17:31:25.061493 [ERRO] ocpp:OCPP201    int ocpp::WebsocketTlsTPM::process_callback(void*, int, void*, void*, size_t) :: CLIENT_CONNECTION_ERROR: conn fail: 111
2025-01-28 17:31:25.061698 [ERRO] ocpp:OCPP201    void ocpp::WebsocketTlsTPM::on_conn_fail() :: OCPP client connection to server failed

@Abby-Wheelis
Copy link
Collaborator Author

Trying MobilityHouse with the EVerest implementation (https://github.com/EVerest/ocpp-csms) and it is also erroring out, complaining about some dependencies:

Traceback (most recent call last):
  File "/Users/awheelis/Documents/ocpp-csms/central_system.py", line 6, in <module>
    from central_systems.central_system_v16 import ChargePoint16
  File "/Users/awheelis/Documents/ocpp-csms/central_systems/central_system_v16.py", line 29, in <module>
    from ocpp.v201.enums import (AuthorizationStatusType, GenericStatusType,
ImportError: cannot import name 'AuthorizationStatusType' from 'ocpp.v201.enums' (/Users/awheelis/Library/Python/3.9/lib/python/site-packages/ocpp/v201/enums.py)

@Abby-Wheelis
Copy link
Collaborator Author

This is because ocpp (directly from MobilityHouse) is a requirement of the EVerest scripts, but not by a tagged version ... so they're out of sync

Signed-off-by: Abby Wheelis <54848919+Abby-Wheelis@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants