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

Citrine Demo Not Working After Recent Changes #50

Closed
louisg1337 opened this issue Jun 3, 2024 · 3 comments
Closed

Citrine Demo Not Working After Recent Changes #50

louisg1337 opened this issue Jun 3, 2024 · 3 comments

Comments

@louisg1337
Copy link
Contributor

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
Copy link
Collaborator

shankari commented Jun 4, 2024

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
Copy link
Collaborator

shankari commented Jun 5, 2024

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
Copy link
Collaborator

shankari commented Jun 5, 2024

Duh! @louisg1337 you needed to fix the TODO!

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

the-bay-kay pushed a commit to the-bay-kay/everest-demo that referenced this issue Jun 12, 2024
This fixes EVerest#50
by copying over the device model for Citrine SP1 as well.
Note that the location where the device model is read is different after 0.0.16

EVerest#50 (comment)

Testing done:

```
$ bash demo-iso15118-2-ac-plus-ocpp.sh -c -1

/var/folders/y5/cx3cfzrd2q116myv9ly86sw1rnlmdj/T/tmp.hzWe2rEL/citrine-csms /var/folders/y5/cx3cfzrd2q116myv9ly86sw1rnlmdj/T/tmp.hzWe2rEL
HEAD is now at 63670f3 Merge pull request #99 from citrineos/fix/fix-container-build-pipeline
...

 ✔ Network server_default          Created                                                                0.1s
 ✔ Container server-amqp-broker-1  Created                                                                0.1s
 ✔ Container server-ocpp-db-1      Healthy                                                                0.1s
 ✔ Container server-directus-1     Created                                                                0.1s
 ✔ Container server-citrine-1      Created                                                               10.9s

...
200Password update successful.
API calls to CSMS finished, starting EVerest...
...
[+] Running 4/4
 ✔ Network everest-ac-demo_default          Created                                                       0.0s
 ✔ Container everest-ac-demo-mqtt-server-1  Healthy                                                       0.1s
 ✔ Container everest-ac-demo-manager-1      Healthy                                                       0.1s
 ✔ Container everest-ac-demo-nodered-1      Healthy                                                       0.1s
                                             Successfully copied 6.66kB to everest-ac-demo-manager-1:/ext/source/config/config-sil-ocpp201-pnc.yaml
Copying device DB, configured to SecurityProfile: 1
                                             Successfully copied 84.5kB to everest-ac-demo-manager-1:/ext/source/build/dist/share/everest/modules/OCPP201/device_model_storage.db

2024-06-05 03:46:08.957953 [INFO] ocpp:OCPP201     :: Connecting to plain websocket at uri: ws://host.docker.internal/ws/cp001 with security profile: 1

2024-06-05 03:46:09.053553 [INFO] ocpp:OCPP201     :: OCPP client successfully connected to plain websocket server

2024-06-05 03:47:19.161544 [INFO] ocpp:OCPP201     :: Received BootNotificationResponse: {
    "currentTime": "2024-06-05T03:47:19.157Z",
    "interval": 60,
    "status": "Accepted"
}
```

Signed-off-by: the-bay-kay <[email protected]>
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

No branches or pull requests

2 participants