-
Notifications
You must be signed in to change notification settings - Fork 1
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
Fixes to get the simulation to work with the current HEAD #4
Conversation
This fixes the third issue in US-JOET/base-camp#153 (comment) which was first reported at US-JOET/base-camp#153 (comment) and the fix was outlined in US-JOET/base-camp#153 (comment) Signed-off-by: Shankari <[email protected]>
This is no longer required given 3372b2b And it can potentially break given EVerest#44 (comment) given that our simulator has a single port, let's restore to simplicity Signed-off-by: Shankari <[email protected]>
This fixes the second issue in US-JOET/base-camp#153 (comment) by making the nodered consistent with EVerest/everest-core@993a60c - we pass in `ac` or `dc` as the energy type - we add in the payment method, which we will plumb through in the next commit - we change the mqtt toptic, also consistent with the commit above Signed-off-by: Shankari <[email protected]>
Changes needed: - change the `iso_start_v2g_session` to take two parameters - convert the first to the payment method and use the second for the energy type - add a new argument to the module method for `start_charging` - pass the payment method through properly The changes are applied by: - checking in another patch - applying the patch after changing into the build directory Testing done: - AC EIM works ``` 2024-06-12 05:40:37.622543 [INFO] car_simulator_1 :: { cmd: 'iso_start_v2g_session', args: [ 'externalpayment', 'ac' ], exec: [Function (anonymous)] } 2024-06-12 05:40:37.624913 [DEBG] iso15118_car Everest::Everest::provide_cmd(std::string, std::string, JsonCommand)::<lambda(Everest::json)> :: Incoming iso15118_car:PyEvJosev->ev:ISO15118_ev->start_charging(EnergyTransferMode) for <handler> 2024-06-12 05:40:42.726368 [DEBG] iso15118_car pybind11_init_everestpy(pybind11::module_&)::<lambda(const std::string&)> :: Message to encode (ns=urn:iso:15118:2:2013:MsgDef): {"V2G_Message": {"Header": {"SessionID": "6954F76C3DCCE6FD"}, "Body": {"PaymentServiceSelectionReq": {"SelectedPaymentOption": "ExternalPayment", "SelectedServiceList": {"SelectedService": [{"ServiceID": 1}]}}}}} 2024-06-12 05:40:46.308633 [DEBG] iso15118_car pybind11_init_everestpy(pybind11::module_&)::<lambda(const std::string&)> :: Decoded message (ns=urn:iso:15118:2:2013:MsgDef): {"V2G_Message":{"Header":{"SessionID":"6954F76C3DCCE6FD"},"Body":{"ChargeParameterDiscoveryRes":{"ResponseCode":"OK","EVSEProcessing":"Finished","SAScheduleList":{"SAScheduleTuple":[{"SAScheduleTupleID":1,"PMaxSchedule":{"PMaxScheduleEntry":[{"RelativeTimeInterval":{"start":0,"duration":86400},"PMax":{"Multiplier":0,"Unit":"W","Value":22080}}]}}]},"AC_EVSEChargeParameter":{"AC_EVSEStatus":{"NotificationMaxDelay":0,"EVSENotification":"None","RCD":false},"EVSENominalVoltage":{"Multiplier":-1,"Unit":"V","Value":2300},"EVSEMaxCurrent":{"Multiplier":-1,"Unit":"A","Value":320}}}}}} 2024-06-12 05:40:46.310640 [DEBG] iso15118_car pybind11_init_everestpy(pybind11::module_&)::<lambda(const std::string&)> :: Message to encode (ns=urn:iso:15118:2:2013:MsgDef): {"V2G_Message": {"Header": {"SessionID": "6954F76C3DCCE6FD"}, "Body": {"PowerDeliveryReq": {"ChargeProgress": "Start", "SAScheduleTupleID": 1, "ChargingProfile": {"ProfileEntry": [{"ChargingProfileEntryStart": 0, "ChargingProfileEntryMaxPower": {"Value": 22080, "Multiplier": 0, "Unit": "W"}}, {"ChargingProfileEntryStart": 86400, "ChargingProfileEntryMaxPower": {"Value": 0, "Multiplier": 0, "Unit": "W"}}]}}}}} ``` - AC contract cert works ``` cmd: 'iso_start_v2g_session', args: [ 'contract', 'ac' ], exec: [Function (anonymous)] } 2024-06-12 05:48:00.517485 [DEBG] iso15118_car pybind11_init_everestpy(pybind11::module_&)::<lambda(const std::string&)> :: Message to encode (ns=urn:iso:15118:2:2013:MsgDef): {"V2G_Message": {"Header": {"SessionID": "18B5F6A7DB7EEE7F"}, "Body": {"PaymentServiceSelectionReq": {"SelectedPaymentOption": "Contract", "SelectedServiceList": {"SelectedService": [{"ServiceID": 1}]}}}}} 2024-06-12 05:48:04.212986 [DEBG] iso15118_car pybind11_init_everestpy(pybind11::module_&)::<lambda(const std::string&)> :: Decoded message (ns=urn:iso:15118:2:2013:MsgDef): {"V2G_Message":{"Header":{"SessionID":"18B5F6A7DB7EEE7F"},"Body":{"ChargeParameterDiscoveryRes":{"ResponseCode":"OK","EVSEProcessing":"Finished","SAScheduleList":{"SAScheduleTuple":[{"SAScheduleTupleID":1,"PMaxSchedule":{"PMaxScheduleEntry":[{"RelativeTimeInterval":{"start":0,"duration":86400},"PMax":{"Multiplier":0,"Unit":"W","Value":22080}}]}}]},"AC_EVSEChargeParameter":{"AC_EVSEStatus":{"NotificationMaxDelay":0,"EVSENotification":"None","RCD":false},"EVSENominalVoltage":{"Multiplier":-1,"Unit":"V","Value":2300},"EVSEMaxCurrent":{"Multiplier":-1,"Unit":"A","Value":320}}}}}} 2024-06-12 05:48:04.215246 [DEBG] iso15118_car pybind11_init_everestpy(pybind11::module_&)::<lambda(const std::string&)> :: Message to encode (ns=urn:iso:15118:2:2013:MsgDef): {"V2G_Message": {"Header": {"SessionID": "18B5F6A7DB7EEE7F"}, "Body": {"PowerDeliveryReq": {"ChargeProgress": "Start", "SAScheduleTupleID": 1, "ChargingProfile": {"ProfileEntry": [{"ChargingProfileEntryStart": 0, "ChargingProfileEntryMaxPower": {"Value": 22080, "Multiplier": 0, "Unit": "W"}}, {"ChargingProfileEntryStart": 86400, "ChargingProfileEntryMaxPower": {"Value": 0, "Multiplier": 0, "Unit": "W"}}]}}}}} ``` Signed-off-by: Shankari <[email protected]>
After creating the PR, re-ran the command again and then charged again. |
Without this change, while trying to set a charging profile, the validation fails because no units are configured. Sqlite commands used: ``` sqlite> select * from variable; 170|RateUnit||17|170|1 sqlite> select * from variable_attribute where variable_id=170; 170|170|0|1|0|0| sqlite> update variable_attribute set value="A" where variable_id=170; sqlite> select * from variable_attribute where variable_id=170; 170|170|0|1|0|0|A ```
Since we need to recompile after making everest module and libocpp changes, and make (or more accurately `ld`) fails if there is insufficient memory.
- Adding additional logs indicating when the `set_external_limits` function was called - Bumped up the log level in a couple of places so that they would show up - 💩Hack to fix the indicies of the evse and the mapping to the evse manager - the list simply iterates over an array of charging schedules and sets the limits for each one - however, our list of valid EVSE IDs starts with 1 - so the first entry/zeroth EVSE ID should be skipped - and the evse manager list indices are off by one from the EVSE IDs, so we should subtract one before looking it up
- Add additional logging (lots, and all with warning or above so it shows up). This should be cleaned up once the feature is complete and before the final submission. - Call `handle_set_charging_profile_req` from `handleMessage` so that when the CSMS makes the call, it actually triggers the EVerest implementation - Parse the message properly in the way EVerest expects it in the `messages/SetChargingProfile.cpp` class - Add logging to verify this - Import a bunch of header files to enable the logging - leave in commented code in which we tried to handle the parsing mismatch while receiving the message, but failed due to const issues. This should be removed once the compatibility between the CSMS and the station is sorted out.
These were required to get the charge profiles to work. The changes require recompile, so they are applied first, and then we recompile Recompiling overrides code in `libexec`, so we apply those changes later
Testing done:
However, the detailed ISO logging isn't showing up. fixing that... |
So that the recompile does not overwrite it This fixes #4 (comment)
Fixed. Now tried to call
|
Everything seems to work now. @louisg1337 can you pull from this branch, run and verify that you get the same results? I can then merge this to the Testing done: Plugged in the car and got a charge delivery of 22kW with a 230V and 32 A
Unplugged the car, and set a profile that was valid starting `2024-06-13T00:00:00.000Z` and a limit of 20 A (the file is attached)
Plugged in the car again, and got max power of 4600 W, with 230V and 6.6A
|
After Louis fixed it in his MaEVe repo This fixes #4 (comment)
Updated Testing As I said in the edit section above, I was running the script without pointing it to my local directory, so I wasn't getting any of the patches. Now that I have the patches, things are working as expected.
Same as the comment above.
Got the same response after setChargingProfile API call
Got the same result once started charging using new profile
|
The changes are outlined in https://github.com/US-JOET/base-camp/issues/153#issuecomment-2161931501