{"id":20172272,"url":"https://github.com/apostoldevel/ocpp-cs","last_synced_at":"2026-03-07T22:31:21.334Z","repository":{"id":63464077,"uuid":"214462607","full_name":"apostoldevel/ocpp-cs","owner":"apostoldevel","description":"OCPP Central System and Charge Point emulator.","archived":false,"fork":false,"pushed_at":"2025-12-01T18:11:02.000Z","size":37921,"stargazers_count":63,"open_issues_count":1,"forks_count":17,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-12-04T02:50:27.921Z","etag":null,"topics":["central","ocpp","ocpp-central","ocpp-css","ocpp-j","ocpp-j-simulator","ocpp-server","ocpp-ws-client","ocpp15j","ocpp16","ocpp16j"],"latest_commit_sha":null,"homepage":"https://ocpp-css.com","language":"CSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/apostoldevel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2019-10-11T14:53:50.000Z","updated_at":"2025-12-01T18:11:06.000Z","dependencies_parsed_at":"2026-02-09T21:04:57.906Z","dependency_job_id":null,"html_url":"https://github.com/apostoldevel/ocpp-cs","commit_stats":{"total_commits":209,"total_committers":1,"mean_commits":209.0,"dds":0.0,"last_synced_commit":"86649adc0e30772f64af36dfaf6df87095aa9f96"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/apostoldevel/ocpp-cs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apostoldevel%2Focpp-cs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apostoldevel%2Focpp-cs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apostoldevel%2Focpp-cs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apostoldevel%2Focpp-cs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apostoldevel","download_url":"https://codeload.github.com/apostoldevel/ocpp-cs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apostoldevel%2Focpp-cs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30234488,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T19:01:10.287Z","status":"ssl_error","status_checked_at":"2026-03-07T18:59:58.103Z","response_time":53,"last_error":"SSL_read: 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":["central","ocpp","ocpp-central","ocpp-css","ocpp-j","ocpp-j-simulator","ocpp-server","ocpp-ws-client","ocpp15j","ocpp16","ocpp16j"],"created_at":"2024-11-14T01:29:28.057Z","updated_at":"2026-03-07T22:31:21.302Z","avatar_url":"https://github.com/apostoldevel.png","language":"CSS","funding_links":[],"categories":["Tools and Resources"],"sub_categories":["OCPP"],"readme":"[![ru](https://img.shields.io/badge/lang-ru-green.svg)](https://github.com/apostoldevel/ocpp-cs/blob/master/README.ru-RU.md)\n\n![image](https://user-images.githubusercontent.com/91010417/230783150-ea57f6c4-ba8a-43cf-a033-ef5ffa3a19ff.png)\n\n# OCPP Central System\n\n**OCPP Central System** - Central system and charge station emulator, source code in C++.\n\nImplemented using [Apostol](https://github.com/ufocomp/apostol).\n\nOverview\n-\n**OCPP Central System** is both a ready-to-use solution that you can easily integrate into your project and a set of tools for developing applications that work with the OCPP protocol.\n\nThis solution can be used for:\n- Developing or integrating a central charging station system;\n- Emulating charging stations;\n- Developing charging station firmware.\n\nOCPP\n-\nOpen Charge Point Protocol [OCPP](http://ocppforum.net) is a communication protocol between charging stations (\"charge points\") and a central management system (\"central system\").\n\n**OCPP Central System** supports all commands for OCPP protocol versions (1.5 and 1.6).\n\nVersion 1.5 uses SOAP over HTTP as the RPC/transport protocol. Version 1.6 uses SOAP and JSON over WebSocket.\n\nAPI\n-\nWe use OpenAPI for interaction with the `Central System (CS)`. You can directly access Swagger UI at [http://cs.ocpp-css.com/docs](http://cs.ocpp-css.com/docs).\n\nAdditionally, you can use any OpenAPI client to import the [api.yaml](https://github.com/apostoldevel/ocpp-cs/blob/master/www/docs/api.yaml) file from our repository.\n\nDemonstration\n-\nYou can connect your charging station to the demo version of the `Central System`.\n\n---\nConnection addresses:\n- WebSocket: ws://ws.ocpp-css.com/ocpp\n- SOAP: http://soap.ocpp-css.com/Ocpp\n---\n\nTo manage the charging station, use the web interface at:\n- [http://cs.ocpp-css.com](http://cs.ocpp-css.com)\n\nAuthorization:\n```\nusername: demo\npassword: demo\n```\n\nRFID card:\n```\nidTag: demo\n```\n\nBuild and Installation\n-\nThe easiest way to install the `Central System` is as a container.\n\n### Docker hub\n\nYou can get a ready-made image on Docker Hub:\n```shell\ndocker pull apostoldevel/cs\n```\nRun the container:\n```shell\ndocker run -p 9220:9220 --network host --env WEBHOOK_URL=https://cloud.ocpp-css.com/api/v1/ocpp --rm --name cs apostoldevel/cs\n```\n\nBuilding the Container Image\n-\nYou can build the container image yourself with settings tailored to your server's domain name or IP address.\n\nClone the repository:\n```shell\ngit clone https://github.com/apostoldevel/ocpp-cs.git \u0026\u0026 cd ocpp-cs\n```\n\nConfigure it according to your requirements:\n\n- Edit the `./docker/default.conf` file, paying special attention to the `[webhook]` section;\n- Edit the `./docker/www/config.js` file to specify your server's domain name or IP address;\n- Edit the `./docker/conf/sites/default.json` file to add your server's IP address:\n\n  For example, your server's IP address is `192.168.1.100` or DNS name `cs.example.com`.\n  ```json\n  {\n    \"hosts\": [\"cs.example.com\", \"cs.example.com:9220\", \"192.168.1.100:9220\", \"localhost:9220\"]\n  }\n  ```\n\nCreate and start the container with a single command:\n```shell\ndocker compose up\n```\n\nWeb Application\n-\nAfter starting the container, the `Central System` will be available at http://localhost:9220 in your browser.\n\nSwagger UI will also be available at http://localhost:9220/docs/ in your browser.\n\n###### Launching from the container does not require authorization.\n\nIntegration\n-\n\nThere are several ways to integrate the `Central System` with your project. The simplest way is through a `Webhook endpoint`.\n\nIn the `Central System` configuration file, specifically `./docker/default.conf` when building the container or `/etc/cs/cs.conf` inside the container, there is a section `[webhook]`.\n\n```text\n## Webhook configuration\n[webhook]\n## default: false\nenable=false\n\n## Webhook endpoint URL\nurl=http://localhost:8080/api/v1/ocpp\n\n## Authorization schema value: Off | Basic | Bearer\nauthorization=Basic\n## Username for basic schema\nusername=ocpp\n## Password for basic schema\npassword=ocpp\n## Token for Bearer schema\ntoken=\n```\n\nIn this section, you can specify the `endpoint URL` to which the `Central System` will send packets received from charging stations. \n\nSpecifically, these are ten commands from section **4. Operations Initiated by Charge Point** of the OCPP v1.6 specification: \n\n- 4.1. Authorize\n- 4.2. Boot Notification\n- 4.3. Data Transfer\n- 4.4. Diagnostics Status Notification\n- 4.5. Firmware Status Notification\n- 4.6. Heartbeat\n- 4.7. Meter Values\n- 4.8. Start Transaction\n- 4.9. Status Notification\n- 4.10. Stop Transaction\n\nAdditionally, you can set up authorization parameters on your server side, which will receive requests from the `Central System`.\n\nData from the `Central System` will be in the following JSON format:\n```json lines\n{\n  \"identity\": \"string\",\n  \"uniqueId\": \"string\",\n  \"action\": \"string\",\n  \"payload\": \"JSON Object\",\n  \"account\": \"string\"\n}\n```\nWhere:\n- `identity`: Required. The charging station identifier;\n- `uniqueId`: Required. The data packet (request) identifier;\n- `action`: Required. The action name;\n- `payload`: Required. Payload - data from the charging station;\n- `account`: Optional. The user account identifier in your system.\n\n###### Using `account`, you can associate the charging station with a user account in your system if the project's business logic requires it. Typically, the charging station's connection address to the central system is specified in the format `ws://webServices/ocpp/EM-A0000001`, if you append an additional value to the charging station identifier `EM-A0000001`, for example: `/EM-A0000001/AC0001`, then `AC0001` will be the user account identifier.\n\nThe `Central System` will expect a response from your information system in the same JSON format. Field values (`identity`, `uniqueId`, `action`) should be filled with values from the incoming request, but the `payload` should contain response data to the `action` in the OCPP protocol specification format. Data in the `payload` will be sent to the charging station as a response to its request.\n\nExample request:\n```json lines\n{\n  \"identity\": \"EM-A0000001\",\n  \"uniqueId\": \"25cf07c9ae20a0566d1043587b5790a6\",\n  \"action\": \"BootNotification\",\n  \"payload\": {\n    \"firmwareVersion\": \"1.0.0.1\",\n    \"chargePointModel\": \"CP_EM\",\n    \"chargePointVendor\": \"Apostol\",\n    \"chargePointSerialNumber\": \"202206040001\"\n  },\n  \"account\": \"AC0001\"\n}\n```\n\nExample response:\n```json lines\n{\n  \"identity\": \"EM-A0000001\",\n  \"uniqueId\": \"25cf07c9ae20a0566d1043587b5790a6\",\n  \"action\": \"BootNotification\",\n  \"payload\": {\n    \"status\": \"Accepted\",\n    \"interval\": 600,\n    \"currentTime\": \"2024-10-22T23:08:58.205Z\"\n  }\n}\n```\n### PostgreSQL\nAnother way to integrate the `Central System` is through direct connection to a PostgreSQL database.\n\nFor integration with your system via the PostgreSQL database, you will need to create the `ocpp` schema and several functions in the database:\n- ocpp.Parse;\n- ocpp.ParseXML;\n- ocpp.ChargePointList;\n- ocpp.TransactionList;\n- ocpp.ReservationList;\n- ocpp.JSONToSOAP;\n- ocpp.SOAPToJSON.\n\n##### Function parameters can be provided to developers upon request to our support team.\n\nWhen communicating with charging stations, the `Central System` will call these functions and pass data from the charging stations in JSON format directly to the database. Data parsing and business logic implementation will be performed in PostgreSQL using the PL/pgSQL programming language.\n\n#### Note: The repository version is configured for integration with the database.\n\nTo build the `Central System` without database integration, change the following settings in the [CMakeLists.txt](https://github.com/apostoldevel/ocpp-cs/blob/master/CMakeLists.txt) file:\n```\nWITH_AUTHORIZATION OFF\nWITH_POSTGRESQL OFF\n```\n\nCharging Station Emulator\n-\n\nThe `Central System` can create charging station emulators, which is very useful during development.\n\nSettings for the emulators are located in the `/etc/cs/cp` folder (when building the container in `./docker/conf/cp`). Inside `cp`, there are folders with emulator settings in the form of `configuration.json` files, which contain the configuration of the charging station emulator.\n\nYou can enable emulation mode in the `Central System` configuration file - `/etc/cs/cs.conf` (when building the container in `./docker/conf/default.conf`):\n```text\n## Process: Charging point emulator\n[process/ChargePoint]\n## default: false\nenable=true\n```\n\nIf you disable the `master` process in the settings, the application will only operate in charging station emulator mode (`Central System` will be disabled).\n\n```text\n## Create master process\n## Master process run processes:\n## - worker (if count not equal 0)\n## - helper (if value equal true)\n## default: true\nmaster=false\n```\n\nBuilding from Source Code\n-\nYou can build the application from the source code yourself.\n\n### Preparation for Building\n\nTo build, you will need to install the following packages:\n\n1. C++ Compiler;\n1. [CMake](https://cmake.org);\n1. [libpq-dev](https://www.postgresql.org/download/) library (libraries and headers for frontend development in C);\n1. [postgresql-server-dev-all](https://www.postgresql.org/download/) library (libraries and headers for backend development in C).\n\nTo install the C++ compiler and necessary libraries on Debian/Ubuntu, run:\n```\nsudo apt-get install build-essential libssl-dev libcurl4-openssl-dev make cmake gcc g++\n```\n\nTo install PostgreSQL, use the instructions on [this](https://www.postgresql.org/download/) link.\n\n###### Detailed instructions for installing C++, CMake, IDE, and other components required for building the project are not included in this guide.\n\nClone the repository:\n```shell\ngit clone https://github.com/apostoldevel/ocpp-cs.git \u0026\u0026 cd ocpp-cs\n```\n\nConfigure it according to your requirements:\n\n- Edit the `./conf/default.conf` file, paying special attention to the `[webhook]` section;\n- Edit the `./www/config.js` file to specify your server's domain name or IP address;\n- Edit the `./conf/sites/default.json` file to add your server's IP address:\n\n  For example, your server's IP address is `192.168.1.100` or DNS name `cs.example.com`.\n  ```json\n  {\n    \"hosts\": [\"cs.example.com\", \"cs.example.com:9220\", \"192.168.1.100:9220\", \"localhost:9220\"]\n  }\n  ```\n- Edit the `CMakeLists.txt` file to disable database mode and authorization:\n  ```\n  WITH_AUTHORIZATION OFF\n  WITH_POSTGRESQL OFF\n  ```\n\n###### CMake Configuration:\n```\n/// Install as root.\n/// Disable for local installation.\n/// Default: ON \nINSTALL_AS_ROOT = {ON | OFF}\n\n/// Build with OAuth 2.0 authorization for industrial version.\n/// Disable for emulator mode.\n/// Default: ON\nWITH_AUTHORIZATION = {ON | OFF}\n\n/// Build with PostgreSQL support for industrial version.\n/// Disable for emulator mode.\n/// Default: ON\nWITH_POSTGRESQL = {ON | OFF}\n```\n\nBuild and Installation\n-\n\nIn the `ocpp-cs` source code folder, execute the following commands:\n\nConfiguration:\n```shell\n./configure\n```\n\nBuild and install:\n```shell\nsudo ./deploy --install\n```\nor\n```shell\ncd cmake-build-release\nmake\nsudo make install\n```\n\nBy default, **cs** will be installed in:\n```\n/usr/sbin\n```\n\nThe configuration file and necessary files for operation, depending on the installation option, will be located in:\n```\n/etc/cs\nor\n~/cs\n```\n\nRun\n-\n###### If `INSTALL_AS_ROOT` is set to `ON`.\n\n`cs` is a Linux system service (daemon).\n\nTo manage `cs`, use standard service management commands.\n\nTo start, execute:\n```shell\nsudo systemctl start cs\n```\n\nTo check the status, execute:\n```shell\nsudo systemctl status cs\n```\n\nThe result should be **approximately** like this:\n```\n● cs.service - OCPP Central System\n     Loaded: loaded (/etc/systemd/system/cs.service; enabled; vendor preset: enabled)\n     Active: active (running) since Wed 2024-09-25 20:22:15 MSK; 3 weeks 6 days ago\n    Process: 1195974 ExecStartPre=/usr/bin/rm -f /run/cs.pid (code=exited, status=0/SUCCESS)\n    Process: 1195975 ExecStartPre=/usr/sbin/cs -t (code=exited, status=0/SUCCESS)\n    Process: 1195976 ExecStart=/usr/sbin/cs (code=exited, status=0/SUCCESS)\n   Main PID: 1195977 (cs)\n      Tasks: 3 (limit: 2347)\n     Memory: 7.9M\n        CPU: 35min 23.394s\n     CGroup: /system.slice/cs.service\n             ├─1195977 cs: master process /usr/sbin/cs\n             ├─1195978 cs: worker process (\"ocpp central system service\")\n             └─1195979 cs: charging point emulator process\n```\n\nManagement\n-\n\nYou can manage `cs` using signals.\nThe main process number is recorded by default in the `/run/cs.pid` file.\nYou can change this filename during the build configuration or in `cs.conf` section `[daemon]` key `pid`.\n\nThe main process supports the following signals:\n\n|Signal   |Action             |\n|---------|-------------------|\n|TERM, INT|fast shutdown      |\n|QUIT     |graceful shutdown  |\n|HUP      |configuration reload, start new worker processes with the new configuration, graceful shutdown of old worker processes|\n|WINCH    |graceful shutdown of worker processes|\t\n\nManaging worker processes individually is not necessary. However, they also support some signals:\n\n|Signal   |Action             |\n|---------|-------------------|\n|TERM, INT|fast shutdown      |\n|QUIT     |graceful shutdown  |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapostoldevel%2Focpp-cs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapostoldevel%2Focpp-cs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapostoldevel%2Focpp-cs/lists"}