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

Implemented Set Charging Profile API #44

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

Conversation

louisg1337
Copy link

Context

Hello! I am on a team that is working on setting up software simulated demos for the charging software EVerest. These demos showcase how EVerest interacts with different CSMSs, especially using the latest protocols. One of the CSMSs that we really enjoy using is MaEVe, but we noticed that there wasn't any support for setting charging profiles just yet. This was one feature that we wanted to use to demonstrate EVerest's capabilities at the CharIn Testival, which just passed a few days ago, so we decided to implement it ourselves.

Implementation

For our use case, all we wanted was an API endpoint that, when called, would send a charging profile to EVerest. We made the API call accessible via POST /cs/{csId}/setchargingprofile, and the ChargingProfileType object would be provided in the body of the call.

Testing Done

To test this new feature out, I used one of the software simulations demos that was setup to showcase EVerest during CharIn, which can be found here. These demos are meant to be plug and play as long as you have Docker and docker-compose installed. I'll walk through the steps here on how to run the demos and observe the setChargingProfile API request working.

  1. Clone repo and check out branch.
    git clone https://github.com/US-JOET/everest-demo.git
    git checkout -b test-demo origin/charin-e2e-demo  
    
  2. Run the software simulation demo.
    bash demo-iso15118-2-ac-plus-ocpp.sh -r $(pwd) -b test-demo -3   
    
  3. Sit back and wait until the EVerest software boots up and you see the following (may take a few minutes).
    2024-06-18 18:23:22.836788 [INFO] ocpp:OCPP201     :: Received BootNotificationResponse: {
        "currentTime": "2024-06-18T18:23:22.000Z",
        "interval": 300,
        "status": "Accepted"
    }
    
  4. In a different terminal, navigate back to the everest-demo repo and run this script to call the new setChargingProfile API.
    bash demo-scripts/maeve-set-charging-profile.sh cp001 TXProfile_1.json    
    
  5. Go back to the terminal with the EVerest software running and observe EVerest receiving the charging profile and accepting it.
    2024-06-14 04:30:42.750178 [ERRO] ocpp:OCPP201    void 
    ocpp::v201::ChargePoint::handle_set_charging_profile_req(ocpp::Call) :: Received profile validity: Validsetting response to {
        "status": "Accepted"
    }
    
    

We would love to integrate these changes into maeve-csms for future use and availability for anyone else whom may need it. Please let me know any changes that may need to be made to integrate this, thank you!

… it to work with the current code I have. Also added in a few new structs to handle the request/response of the call, and started working on the handler function to deal with the response
Copy link

@shankari shankari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@louisg1337 My high level feedback is that you should move the [TEST] log messages to Debug. And maybe label them as [API TRACE] so we know what they are doing.

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