Add OCPP 1.6 GetConfiguration and ChangeConfiguration support - #105
Open
loosrob wants to merge 1 commit into
Open
Add OCPP 1.6 GetConfiguration and ChangeConfiguration support#105loosrob wants to merge 1 commit into
loosrob wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add OCPP 1.6 GetConfiguration and ChangeConfiguration support
Summary
This PR adds two backend-initiated OCPP 1.6 messages that the server does not currently support:
Both follow the existing pattern used by
Reset,UnlockConnector,SetChargingLimit, etc.: an API endpoint onOCPP.Core.Serverbuilds the request, sends it over the charge point's WebSocket, waits for the answer, and returns it to the API caller.Motivation
Many chargers expose vendor-specific settings (e.g. dynamic load-management limits) as OCPP configuration keys. Without GetConfiguration/ChangeConfiguration there is no way to inspect or change these from OCPP.Core. In my case (an eNovates-based charge point) the dynamic load-balancing ceiling is the key
MaxInstallationLoad, which is read/writable over OCPP but was previously unreachable.New API endpoints
Responses:
GetConfigurationreturns the raw OCPPGetConfiguration.confpayload:{"configurationKey":[{"key":"...","readonly":false,"value":"..."}],"unknownKey":[...]}ChangeConfigurationreturns{"status":"Accepted"}(orRejected/RebootRequired/NotSupported).(Consistent with the existing convention, these use the URL segments already parsed by the middleware:
urlConnectorIdcarries the key,urlParamcarries the value for ChangeConfiguration;urlConnectorIdoptionally carries a single key for GetConfiguration.)Files
New:
OCPP.Core.Server/Messages_OCPP16/GetConfigurationRequest.csOCPP.Core.Server/Messages_OCPP16/GetConfigurationResponse.csOCPP.Core.Server/Messages_OCPP16/ChangeConfigurationRequest.csOCPP.Core.Server/Messages_OCPP16/ChangeConfigurationResponse.csOCPP.Core.Server/ControllerOCPP16.GetConfiguration.csOCPP.Core.Server/ControllerOCPP16.ChangeConfiguration.csModified:
OCPP.Core.Server/ControllerOCPP16.cs– twocaseentries added toProcessAnswerOCPP.Core.Server/OCPPMiddleware.OCPP16.cs–GetConfiguration16andChangeConfiguration16sender methodsOCPP.Core.Server/OCPPMiddleware.cs– twoelse if (cmd == ...)dispatch blocks in the/APIhandlerScope note: this PR only implements the OCPP 1.6 path. The OCPP 2.0/2.1 controllers are untouched (the dispatch returns
501 Not Implementedfor those protocols), matching how some other commands are staged.Testing
Built from source and run against a live eNovates-based charge point (OCPP 1.6J):
The full-configuration read (
GetConfigurationwith no key) also returns the complete key list from the charger.Documentation
Server-API.mdis updated with the two new endpoints (seeServer-API.additions.mdin this package for the text to merge).Notes / open questions for the maintainer
Schema16/for the new messages.DeserializeMessage<T>already falls back to schema-less deserialization when a schema file is absent, so validation is simply skipped for these two. Happy to addGetConfigurationResponse.json/ChangeConfigurationResponse.jsonschemas if you'd prefer validation.UniqueId. That is not part of this PR (it does not affect KEBA or spec-compliant chargers). It is documented separately inUNIQUEID_NOTE.mdin case it's of interest, but I've deliberately kept it out of this change so the feature can be reviewed on its own.Licensed under GPLv3, consistent with the rest of the project. File headers copied from existing files.