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

💅 Bunch of fixes to the departure time demo #102

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

shankari
Copy link
Collaborator

  • Compile and install even with library fixes
  • switch the EVSE to AC_single_phase so it works in the US context
    • switch the EV as well to match
  • Fix crash on M3 chips
  • Change the text on the CSMS to be more meaningful

Shankari added 5 commits January 14, 2025 16:31
…eter

This fixes
EVerest#99

Testing done:
- started EVerest
    - before this fix: crashed on startup
    - after this fix: did not crash on startup

Signed-off-by: Shankari <k.shankari@driveelectric.gov>
In the Dockerfile, we said

```
```

However, before this change, we were not actually re-installing after rebuild.
This adds the install step.

Testing done:
- Built a new image using `docker compose -f docker-compose.build.yml build` after adding a new patch to the library code (648948c)
    - Before this: patch was not incorporated, EVerest still crashed on startup
    - After this: patch was incorporated, and when a container was launched
      from the image, EVerest did not crash on startup.

Signed-off-by: Shankari <k.shankari@driveelectric.gov>
This will allow us to test against cars in the the US.
US has 1-phase, EU has 3-phase.

We found, during Testival, that sending "three phase" here would break the
handshake in many situations.

Ideally, this would be read from the hw capability.
In particular, something like this
https://github.com/EVerest/everest-core/blob/50d8bacaab06dea0b5a58f5efd212ff1d25de239/modules/EvseManager/EvseManager.cpp#L743

```
r_bsp->subscribe_ac_nr_of_phases_available([this](int n) { signalNrOfPhasesAvailable(n); });
```

But that variable is computed from the min and max phase in the HardwareCapabilities
https://github.com/EVerest/everest-core/blob/50d8bacaab06dea0b5a58f5efd212ff1d25de239/modules/EvseManager/EvseManager.cpp#L134C1-L142C56

```
    r_bsp->subscribe_capabilities([this](types::evse_board_support::HardwareCapabilities c) {
        if (ac_nr_phases_active == 0) {
            ac_nr_phases_active = c.max_phase_count_import;
        }

        if (ac_nr_phases_active > c.max_phase_count_import) {
            ac_nr_phases_active = c.min_phase_count_import;
        }

        signalNrOfPhasesAvailable(ac_nr_phases_active);
```

the micromegawatt BSP defines the min and max phase as 1 and 3 respectively
https://github.com/EVerest/everest-core/blob/3401718254fc6ac2c6e741c5b9db83b5bbc80dc6/modules/MicroMegaWattBSP/board_support/evse_board_supportImpl.cpp#L49

```
        caps.min_phase_count_import = 1;
        caps.max_phase_count_import = 3;
```

so we wouldn't be able to change this from a config file anyway

This would ideally be the location to get it from, but not sure how we can see that in the EvseManager.

```
  grid_connection_point:
    config_module:
      fuse_limit_A: 40
      phase_count: 3
```

Testing done:
- after the change, started a charge session from the simulator

```
2025-01-15 00:21:15.790874 [INFO] evse_manager_1:  :: EVSE ISO V2G ServiceDiscoveryRes
2025-01-15 00:21:15.900073 [DEBG] iso15118_car    pybind11_init_everestpy(pybind11::module_&)::<lambda(const std::string&)> :: Decoded message (ns=Namespace.ISO_V2_MSG_DEF): {"V2G_Message":{"Header":{"SessionID":"C6BFDFDEAC8B3727"},"Body":{"ServiceDiscoveryRes":{"ResponseCode":"OK","PaymentOptionList":{"PaymentOption":["ExternalPayment","Contract"]},"ChargeService":{"ServiceID":1,"ServiceCategory":"EVCharging","FreeService":false,"SupportedEnergyTransferMode":{"EnergyTransferMode":["AC_single_phase_core"]}},"ServiceList":{"Service":[{"ServiceID":2,"ServiceName":"Certificate","ServiceCategory":"ContractCertificate","FreeService":true}]}}}}}
```

Signed-off-by: Shankari <k.shankari@driveelectric.gov>
In 533e664, we changed the default
`EnergyTransfer` mode on the EVSE side to `AC_single_phase_core`, so that we
could deploy it on the uMWC and test it against cars in the US. On the EVSE
side, this value is currently hardcoded and is not settable via a config
option.

This commit makes a similar change to the EV simulator. Both the EVSE and the
EV need to use `AC_single_phase_core` so that the handshake will succeed in the
simulator. Fortunately, this can be set in the config file so we don't need any
additional code changes or patches.

Testing done:
- Before this change:

```
2025-01-15 00:21:11.727113 [INFO] iso15118_car     :: _handler_start_charging() args: {'DepartureTime': None, 'EAmount': 60, 'EnergyTransferMode': 'AC_three_phase_core', 'PaymentOption': 'ExternalPayment'}
2025-01-15 00:21:15.900073 [DEBG] iso15118_car    pybind11_init_everestpy(pybind11::module_&)::<lambda(const std::string&)> :: Decoded message (ns=Namespace.ISO_V2_MSG_DEF): {"V2G_Message":{"Header":{"SessionID":"C6BFDFDEAC8B3727"},"Body":{"ServiceDiscoveryRes":{"ResponseCode":"OK","PaymentOptionList":{"PaymentOption":["ExternalPayment","Contract"]},"ChargeService":{"ServiceID":1,"ServiceCategory":"EVCharging","FreeService":false,"SupportedEnergyTransferMode":{"EnergyTransferMode":["AC_single_phase_core"]}},"ServiceList":{"Service":[{"ServiceID":2,"ServiceName":"Certificate","ServiceCategory":"ContractCertificate","FreeService":true}]}}}}}
2025-01-15 00:21:15.902330 [DEBG] iso15118_car    pybind11_init_everestpy(pybind11::module_&)::<lambda(const std::string&)> :: The data link will SessionStopAction.TERMINATE in 2 seconds and the TCP connection will close in 5 seconds.
2025-01-15 00:21:15.902404 [DEBG] iso15118_car    pybind11_init_everestpy(pybind11::module_&)::<lambda(const std::string&)> :: Reason: Offered energy transfer modes [<EnergyTransferModeEnum.AC_SINGLE_PHASE_CORE: 'AC_single_phase_core'>] not compatible with EnergyTransferModeEnum.AC_THREE_PHASE_CORE
2025-01-15 00:21:20.918795 [ERRO] iso15118_car    pybind11_init_everestpy(pybind11::module_&)::<lambda(const std::string&)> :: EVCC tried to initiate a V2GCommunicationSession, but maximum number of SDP retry cycles (1) is now reached. Shutting down high-level communication. Unplug and plug in the cable again if you want to start anew.
```

- After this change

```
2025-01-15 02:03:15.923599 [INFO] iso15118_car     :: _handler_start_charging() args: {'DepartureTime': None, 'EAmount': 60, 'EnergyTransferMode': 'AC_single_phase_core', 'PaymentOption': 'ExternalPayment'}
2025-01-15 02:03:19.907132 [DEBG] iso15118_car    pybind11_init_everestpy(pybind11::module_&)::<lambda(const std::string&)> :: Decoded message (ns=Namespace.ISO_V2_MSG_DEF): {"V2G_Message":{"Header":{"SessionID":"740DFD76BF38FBFF"},"Body":{"ServiceDiscoveryRes":{"ResponseCode":"OK","PaymentOptionList":{"PaymentOption":["ExternalPayment","Contract"]},"ChargeService":{"ServiceID":1,"ServiceCategory":"EVCharging","FreeService":false,"SupportedEnergyTransferMode":{"EnergyTransferMode":["AC_single_phase_core"]}},"ServiceList":{"Service":[{"ServiceID":2,"ServiceName":"Certificate","ServiceCategory":"ContractCertificate","FreeService":true}]}}}}}
...
2025-01-15 02:03:20.501550 [INFO] evse_manager_1:  ::                                     CAR ISO V2G PaymentServiceSelectionReq
...
2025-01-15 02:03:32.114420 [INFO] evse_manager_1:  ::                                     CAR ISO V2G ChargingStatusReq
2025-01-15 02:03:32.212697 [INFO] evse_manager_1:  :: EVSE ISO V2G ChargingStatusRes
2025-01-15 02:03:32.260171 [DEBG] iso15118_car    pybind11_init_everestpy(pybind11::module_&)::<lambda(const std::string&)> :: Decoded message (ns=Namespace.ISO_V2_MSG_DEF): {"V2G_Message":{"Header":{"SessionID":"740DFD76BF38FBFF"},"Body":{"ChargingStatusRes":{"ResponseCode":"OK","EVSEID":"DE*PNX*00001","SAScheduleTupleID":1,"EVSEMaxCurrent":{"Multiplier":-1,"Unit":"A","Value":160},"MeterInfo":{"MeterID":"YETI_POWERMETER","MeterReading":0},"AC_EVSEStatus":{"NotificationMaxDelay":0,"EVSENotification":"None","RCD":false}}}}}
```

Signed-off-by: Shankari <k.shankari@driveelectric.gov>
To be consistent with OCPP 2.0.1, the "External Limits" should be used for a
local EMS or other controller. However, we have the CSMS now send limits from
two sources - MIDAS or the CSMS' internal operation. Both of them are sent as
`ChargingStationMaxProfile`. Changing the "CSMS internal operation" label to be
more meaningful.

Signed-off-by: Shankari <k.shankari@driveelectric.gov>
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.

1 participant