CitrineOS is an open-source project aimed at providing a modular server runtime for managing Electric Vehicle (EV) charging infrastructure. This README will guide you through the process of installing and running CitrineOS.
This is the main part of CitrineOS containing the actual charging station management logic, OCPP message routing and all modules.
All other documentation and the issue tracking can be found in our main repository here: https://github.com/citrineos/citrineos.
CitrineOS is developed in TypeScript and runs on NodeJS
with ws
and fastify.
The system features:
AJV
@AsHandler
to handle incoming OCPP 2.0.1 messages@AsMessageEndpoint
to expose functions allowing to send messages to charging stations@AsDataEndpoint
to expose CRUD access to entities defined in 10_Data
RabbitMQ
and Google Cloud PubSub
In Memory
and Redis
For more information on the project go to citrineos.github.io.
Before you begin, make sure you have the following installed on your system:
Clone the CitrineOS repository to your local machine:
git clone https://github.com/citrineos/citrineos-core
Install project dependencies from root dir:
npm run install-all
Build project from root dir:
npm run build
The docker container should be initialized from cd /Server
by running docker-compose -f ./docker-compose.yml up -d
or
by using the IntelliJ Server
Run Configuration which was created for this purpose.
Running docker-compose.yml
will ensure that the container is configured to expose the :9229
debugging
port for the underlying NodeJS process. A variety of tools can be utilized to establish a debugger connection
with the exposed localhost 9229 port which is forwarded to the NodeJS service running within docker. The IntelliJ
Attach Debugger
Run Configuration was made to attach to a debugging session.
CitrineOS requires configuration to allow your OCPP 2.0.1 compliant charging stations to connect.
We recommend running and developing the project with the docker-compose
set-up via the existing Run Configurations.
Additional Run Configurations should be made for other IDEs (ex VSCode).
To change necessary configuration for execution outside of docker-compose
, please adjust the configuration file
at 50_Server/src/config/envs/local.ts
. Make sure any changes to the local configuration do not make it into your PR.
To start the CitrineOS server from a unix-like command line, run the following command:
cd Server
npm run start-unix
To start the CitrineOS server from a windows command line, run the following command:
cd Server
npm run start-windows
This will launch the CitrineOS server with the specified configuration. The debugger will be available on port 9229.
Whether you run the application with Docker or locally with npm, you should be able to attach a debugger. With debugger attached you should be able to set breakpoints in the TS code right from your IDE and debug with ease.
--inspect-brk
You can modify nodemon.json
exec command from:
node --inspect=0.0.0.0:9229 --nolazy -r ts-node/register
to
node --inspect-brk=0.0.0.0:9229 --nolazy -r ts-node/register
which will wait for the debugger to attach before proceeding with execution.
You can now connect your OCPP 2.0.1 compliant charging stations to the CitrineOS server. Make sure to configure the charging stations to point to the server's IP address and port as specified in the config.json file.
You need to install docker (>= 20.10) and docker-compose. Furthermore, Visual Studio Code might be handy as a common integrated development environment.
Once Docker is running, the following services should be available:
8080
: webserver http - Swagger
8081
: websocket server tcp connection without auth8082
: websocket server tcp connection with basic http auth5672
: amqp tcp connection15672
: RabbitMQ management interface
5432
: sql tcp connection:8055/admin
: web interface (login = admin@citrineos.com:CitrineOS!)These three services are defined in docker-compose.yml
and they
live inside the docker network docker_default
with their respective
ports. By default these ports are directly accessible by using
localhost:8080
for example.
So, if you want to access the amqp-broker default management port via your
localhost, you need to access localhost:15672
.
All CitrineOS interfaces for OCPP 2.0.1-defined schemas were procedurally generated using the script in 00_Base/json-schema-processor.js. It can be rerun:
npm run generate-interfaces -- ../../Path/To/OCPP-2.0.1_part3_JSON_schemas
This will replace all the files in 00_Base/src/ocpp/model/
,
We welcome contributions from the community. If you would like to contribute to CitrineOS, please follow our contribution guidelines.
CitrineOS and its subprojects are licensed under the Apache License, Version 2.0. See LICENSE for the full license text.
If you have any questions or need assistance, feel free to reach out to us on our community forum or create an issue on the GitHub repository.
A more detailed roadmap is coming soon.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。