Skip to content

Conversation

barsnick
Copy link
Contributor

@barsnick barsnick commented Aug 27, 2025

Describe your changes

This introduces a new API module RpcApi, which uses JSON RPC, and WebSockets as a transport layer.

It uses both RPC Methods and Notifications.

This is the implementation according to the proposal with was discussed here on Zulip and documented here. The original proposal what slightly modified, as several details proved inconsistent, impractical, or just mis-specified.

Documentation of the current state of implementation is included in the module's docs/ subdirectory. The current (or the final merged) state will be manifested as API version 1.0.0. Future updates to the external API definition will require version bumps.

A Python GUI test client is included under modules/API/RpcApi/tools/python-client-gui/.

Not implemented in the current state of the API:

  • DC charging
  • TLS
  • API authentication

This will be added later, with corresponding bumps of the API version (where applicable).

A non-squashed version of this work is found in the branch feature/json-rpc-api-nosquash. for reference regarding small change steps, commit messages with motivations, and so on.

Co-authored-by: Fabian Hartung [email protected]
Co-authored-by: Moritz Barsnick [email protected]

Issue ticket number and link

Checklist before requesting a review

  • I have performed a self-review of my code
  • I have made corresponding changes to the documentation
  • I read the contribution documentation and made sure that my changes meet its requirements

@barsnick barsnick force-pushed the feature/json-rpc-api branch 8 times, most recently from acd8932 to 9dc9ae4 Compare August 29, 2025 07:20
@barsnick barsnick marked this pull request as ready for review August 29, 2025 07:23
Copy link
Member

@hikinggrass hikinggrass left a comment

Choose a reason for hiding this comment

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

just a first quick review, I haven't look into it in detail yet

Copy link
Contributor Author

@barsnick barsnick left a comment

Choose a reason for hiding this comment

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

Discovery of json-rpc-cxx in non-EDM builds (e.g. Yocto) is broken.

This is pending a fix.

@barsnick barsnick requested a review from james-ctc as a code owner September 5, 2025 15:04
@barsnick
Copy link
Contributor Author

barsnick commented Sep 5, 2025

This is pending a fix.

Fixed.

barsnick and others added 25 commits September 22, 2025 14:19
Signed-off-by: Moritz Barsnick <[email protected]>
As changed in the merged PR #1319.

Signed-off-by: Moritz Barsnick <[email protected]>
Signed-off-by: Fabian Hartung <[email protected]>
Signed-off-by: Fabian Hartung <[email protected]>
Add a Findjson-rpc-cxx.cmake for non-EDM builds.

The target_include_directories() directive needs to be different for EDM and
non-EDM (Yocto) builds for the header-only json-rpc-cxx.

Also remove json-rpc-cxx from target_link_libraries(), as it is header-only.

Signed-off-by: Moritz Barsnick <[email protected]>
…figuration from YAML files

Signed-off-by: Fabian Hartung <[email protected]>
Introduce a little bit more consistency.

Signed-off-by: Moritz Barsnick <[email protected]>
Only listen on all interfaces if explicitly asked via config "all".
Do not accept an empty string.

Signed-off-by: Moritz Barsnick <[email protected]>
… flag

EVSE index 0 is reserved for the charger itself and should not be used to
set/clear the EVSE error present flag. In the future, we might want to
introduce a charger error present flag.

Signed-off-by: Fabian Hartung <[email protected]>
In case charging is already paused, it is not necessary to set the current limit to 0.
The current limit is only set to 0 if it is necessary to prevent charging.

Signed-off-by: Fabian Hartung <[email protected]>
…nd charging is not allowed

Signed-off-by: Fabian Hartung <[email protected]>
Added a wait_for_current_limit_applied method to the EVSEStatusStore to allow
waiting for the requested current limit to be applied with a timeout. This
allows correct error reporting if the limit could not be applied in time.
The timeout is set to 5 seconds in the RpcApiRequestHandler.cpp.

Signed-off-by: Fabian Hartung <[email protected]>
…ts when applying phase count

Signed-off-by: Fabian Hartung <[email protected]>
barsnick added a commit to EVerest/meta-everest that referenced this pull request Oct 1, 2025
This library is required for the RpcApi module from everest-core PR
EVerest/everest-core#1324.

Also provide a minimal json-rpc-cxxConfig.cmake with INTERFACE target for
the header-only library. This allows CMake to resolve and include the
json-rpc-cxx target using find_package(json-rpc-cxx REQUIRED).

Signed-off-by: Fabian Hartung <[email protected]>
Signed-off-by: Moritz Barsnick <[email protected]>
Co-authored-by: Fabian Hartung <[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

Successfully merging this pull request may close these issues.

3 participants