{"id":30754929,"url":"https://github.com/tommymalmqvist/rust-ocpp","last_synced_at":"2026-03-07T17:32:01.459Z","repository":{"id":40658193,"uuid":"373774510","full_name":"tommymalmqvist/rust-ocpp","owner":"tommymalmqvist","description":"Libraries for ocpp 1.6, 2.0.1 and 2.1","archived":false,"fork":false,"pushed_at":"2026-03-02T13:17:25.000Z","size":11081,"stargazers_count":96,"open_issues_count":6,"forks_count":30,"subscribers_count":6,"default_branch":"main","last_synced_at":"2026-03-02T16:55:50.266Z","etag":null,"topics":["charging","ev","ocpp","ocpp-j","ocpp16j","ocpp201","rust"],"latest_commit_sha":null,"homepage":"https://docs.rs/rust-ocpp/latest/rust_ocpp/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tommymalmqvist.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-06-04T08:32:04.000Z","updated_at":"2026-02-25T19:30:06.000Z","dependencies_parsed_at":"2022-07-14T05:00:28.483Z","dependency_job_id":"edf2c22e-c36b-4d1b-99df-4f1191cdde40","html_url":"https://github.com/tommymalmqvist/rust-ocpp","commit_stats":{"total_commits":175,"total_committers":6,"mean_commits":"29.166666666666668","dds":0.05714285714285716,"last_synced_commit":"71b78abac2bbabd8a82c3f637c249814d6355671"},"previous_names":["tommymalmqvist/rust-ocpp","codelabsab/rust-ocpp"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/tommymalmqvist/rust-ocpp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tommymalmqvist%2Frust-ocpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tommymalmqvist%2Frust-ocpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tommymalmqvist%2Frust-ocpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tommymalmqvist%2Frust-ocpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tommymalmqvist","download_url":"https://codeload.github.com/tommymalmqvist/rust-ocpp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tommymalmqvist%2Frust-ocpp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30223288,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T17:00:40.062Z","status":"ssl_error","status_checked_at":"2026-03-07T17:00:39.026Z","response_time":53,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["charging","ev","ocpp","ocpp-j","ocpp16j","ocpp201","rust"],"created_at":"2025-09-04T10:01:18.851Z","updated_at":"2026-03-07T17:32:01.430Z","avatar_url":"https://github.com/tommymalmqvist.png","language":"Rust","funding_links":[],"categories":["Tools and Resources"],"sub_categories":["OCPP"],"readme":"# rust-ocpp\n\n[![crates.io](https://img.shields.io/crates/v/rust-ocpp.svg)](https://crates.io/crates/rust-ocpp)\n[![workflow](https://img.shields.io/github/actions/workflow/status/codelabsab/rust-ocpp/rust.yml)](https://github.com/codelabsab/rust-ocpp/actions)\n[![codecov](https://codecov.io/gh/codelabsab/rust-ocpp/branch/main/graph/badge.svg?token=23C458RC3S)](https://codecov.io/gh/codelabsab/rust-ocpp)\n\nThe `rust-ocpp` libs implements the Open Charge Point Protocol\nused in charging stations. You can read more on the official [Open Charge Alliance](https://www.openchargealliance.org/) website.\n\nOCPP versions v1.6, v2.0.1, and v2.1 are implemented and validated using the official json schemas from Open Charge Alliance.\n\nYou can find the tests in `schema_validation.rs` for all supported versions.\n\n## repo structure\n\n`src/` : library files for v1.6, v2.0.1, and v2.1\n\n`docs/` : official ocpp specification\n\n## How to Use\n\nAdd `rust-ocpp` as a dependency in your `Cargo.toml`. Note that there is no default version - you must explicitly specify which OCPP version(s) you want to use via feature flags.\n\n```toml\n[dependencies]\nrust-ocpp = \"3.0\"\n```\n\nTo use a specific version, specify it with a feature flag:\n\n```toml\n[dependencies]\nrust-ocpp = { version = \"2.0\", features = [\"v1_6\"] }  # For OCPP 1.6\nrust-ocpp = { version = \"2.0\", features = [\"v2_0_1\"] }  # For OCPP 2.0.1\nrust-ocpp = { version = \"2.0\", features = [\"v2_1\"] }  # For OCPP 2.1\n```\n\nYou can also use multiple versions:\n\n```toml\n[dependencies]\nrust-ocpp = { version = \"2.0\", features = [\"v2_0_1\", \"v2_1\"] }\n```\n\n## How to Build\n\nTo build the `rust-ocpp` library, you need to have Rust and Cargo installed on your system. You can install them by\nfollowing the instructions provided at the official [Rust website](https://www.rust-lang.org/tools/install).\n\nOnce you have Rust and Cargo installed, you can build the library using the following steps:\n\n1. Clone the `rust-ocpp` repository:\n\n   ```bash\n   git clone https://github.com/codelabsab/rust-ocpp.git\n   ```\n\n2. Change into the `rust-ocpp` directory:\n\n   ```bash\n   cd rust-ocpp\n   ```\n\n3. Build the library using Cargo for all versions:\n\n   ```bash\n   cargo build --all-features\n   ```\n\n   This command will compile the library and its dependencies. If the build is successful, you will find the compiled\n   artifacts in the `target/debug` directory.\n\n4. Run the tests on all versions:\n\n   ```bash\n   cargo test --all-features\n\n   ```\n\n   This command will execute the tests for all OCPP versions. If all tests pass, it means that the library is\n   functioning correctly.\n\n5. Build a specific version:\n\n   To build a specific version of `rust-ocpp`, you can use the appropriate feature flag when running the build command.\n   For example, to build `v1_6`:\n\n   ```bash\n   cargo build --features v1_6\n   ```\n\n   To build `v2_0_1`:\n\n   ```bash\n   cargo build --features v2_0_1\n   ```\n\n   To build `v2_1`:\n\n   ```bash\n   cargo build --features v2_1\n   ```\n\n6. (Optional) Build for release:\n\n   If you want to build the library for release, with optimizations enabled, you can use the following command:\n\n   ```bash\n   cargo build --features v2_0_1 --release\n   ```\n\n   The release build will produce optimized artifacts in the `target/release` directory.\n\n7. (Optional) Install the library:\n\n   If you want to install the library globally on your system, you can use the following command:\n\n   ```bash\n   cargo install --path .\n   ```\n\n   This command will compile the library and its dependencies and install it in the Cargo binary directory, so you can\n   use it as a dependency in other projects.\n\nThat's it! You have successfully built the `rust-ocpp` library. If you encounter any issues during the build process,\nplease check the project's issue tracker on GitHub or open a new issue for assistance.\n\n## Testing\n\n`rust-ocpp` provides testing against json schemas for all supported OCPP versions. To run the tests, you can use\nCargo's built-in test runner.\n\n### Running Tests\n\nTo run the tests for a specific version, use the appropriate feature flag:\n\n```bash\ncargo test --features v1_6      # For OCPP 1.6 tests\ncargo test --features v2_0_1    # For OCPP 2.0.1 tests\ncargo test --features v2_1      # For OCPP 2.1 tests\n```\n\nTo run all tests for all versions:\n\n```bash\ncargo test --all-features\n```\n\n### Test Coverage\n\nThe test coverage for rust-ocpp is measured using Codecov. You can find the current test coverage report\non [codecov](https://codecov.io/gh/codelabsab/rust-ocpp).\n\n### Contributing to Tests\n\nContributions to the test suite are very much appreciated. If you encounter any bugs, discover edge cases, or have ideas\nfor\nadditional test cases, feel free to open an issue or submit a pull request.\nWe will be happy to review and incorporate your contributions.\n\nPlease ensure that you run the tests and maintain or improve the overall test coverage before submitting any changes.\nAdditionally, adhere to the existing testing conventions and follow the code style guidelines to maintain consistency.\n\n## Contribute\n\nUse `rustfmt` before you PR.\n\npre-commit config is available. You can read more about it at [pre-commits](https://pre-commit.com) website and checkout their repo on [github](https://github.com/pre-commit/pre-commit)\n\n## Releasing a new version\n\n1. Update the version of the library and push the changes to the main branch.\n2. Create a [new release](https://github.com/codelabsab/rust-ocpp/releases/new) on GitHub with the new version number and some release notes (optional).\n\nThis will trigger the [publish workflow](./.github/workflows/publish.yml) which will publish the new version to crates.io.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftommymalmqvist%2Frust-ocpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftommymalmqvist%2Frust-ocpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftommymalmqvist%2Frust-ocpp/lists"}