EVerest / everest-demo

EVerest demo: Dockerized demo with software in the loop simulation
Apache License 2.0
11 stars 13 forks source link

Citrine Demo Not Working After Recent Changes #50

Closed louisg1337 closed 1 month ago

louisg1337 commented 1 month ago

After the #39 changes were merged into main, the Citrine demo using SP1 no longer works. All the software loads properly and runs, but once we get into the SIL simulation, EVerest is unable to connect to the websocket. I even tried connecting EVerest to Citrine's 8081 port which is unsecured, yet it still is unable to connect.

To Reproduce

Hardware MacBook - macOS Ventura: 13.6.7 - Intel Core i7

shankari commented 1 month ago

The error is

2024-06-04 22:47:20.503637 [INFO] ocpp:OCPP201     :: Reconnecting to plain websocket at uri: ws://localhost:9000/cp001 with security profile: 1

It seems like the device_model is not being copied properly or is invalid...

shankari commented 1 month ago

There are three databases in here

# find / -name \*device_model_storage.db\*
/ext/source/build/_deps/libocpp-build/config/v201/device_model_storage.db
/ext/source/build/dist/share/everest/modules/OCPP201/device_model_storage.db
/workspace/dist/share/everest/modules/OCPP201/device_model_storage.db

The one in dist/share/everest/modules/OCPP201/device_model_storage.db has the correct URL

# sqlite3 dist/share/everest/modules/OCPP201/device_model_storage.db
sqlite> select * from VARIABLE_ATTRIBUTE;
22|22|2|1|0|0|[{"configurationSlot": 1, "connectionData": {"messageTimeout": 30, "ocppCsmsUrl": "ws://host.docker.internal/ws/cp001", "ocppInterface": "Wired0", "ocppTransport": "JSON", "ocppVersion": "OCPP20", "securityProfile": 1}}]

The one in /ext/source/build/dist/share/everest/modules/OCPP201/device_model_storage.db has the wrong one

# sqlite3 /ext/source/build/dist/share/everest/modules/OCPP201/device_model_storage.db
sqlite> select * from VARIABLE_ATTRIBUTE;
35|35|2|1|0|0|[{"configurationSlot": 1, "connectionData": {"messageTimeout": 30, "ocppCsmsUrl": "ws://localhost:9000/cp001", "ocppInterface": "Wired0", "ocppTransport": "JSON", "ocppVersion": "OCPP20", "securityProfile": 1}}]

Given that this is working for MaEVe, I wonder if we are not copying the device model over properly

shankari commented 1 month ago

Duh! @louisg1337 you needed to fix the TODO!

if [[ ${CSMS} == "citrine" ]]; then
  echo "TODO: Set up device model correctly!"
else