Skip to content

⚡ChargePi🔌 is an open-source Raspberry Pi 4 based ⚡Charging Point🔌 project, which supports multiple EVSEs and simple connectors🔌. A charging connector🔌 consists of a WS281x RGB 🚥 LED strip, a relay and a power meter.

Notifications You must be signed in to change notification settings

ChargePi/ChargePi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⚡ChargePi🔌

⚡ChargePi⚡ is an open-source Raspberry Pi 4 based ⚡Charging Point🔌 project, which supports multiple EVSEs and simple connectors🔌. A charging connector🔌 consists of a WS281x RGB 🚥 LED strip, a relay and a power meter.

ChargePi client can be deployed/run in multiple ways:

  • standalone
  • Docker 🐳 by building the image and running the container
  • Docker-compose to be deployed with SteVe Central System and Watchtower (recommended for dev/testing only)
  • Docker-compose by running the client

Charging station specifications

Protocol implementation Core functionalities Offline charging Local authorization Charging profiles
OCPP 1.6 JSON/WS ✔️ ✔️ ✔️
OCPP 2.0.1 JSON/WS Will be implemented Will be implemented Will be implemented

Graylog logging server

ChargePi uses Graylog logging server for storing logs, so a logging server should be up and running if you want the logs to be stored. Logs are sent through GELF UDP protocol to the logging server at port 12201. The library used for logging is graypy.

Configure the log_server property in the settings.json file with your logging server IP.

Initial setup

  1. If you want to run SteVe on the same host:

    ChargePi/steve/

    *When cloning Steve from GitHub, steve directory should be automatically generated. Replace SteVe's default Dockerfile with Dockerfile provided in ChargePi/steve/Dockerfile to run on Raspberry Pi.

  2. Wire the hardware according to the schematics.

  3. Configure the client.

Running standalone

  1. Python 3.7+ and pip3 must be installed as they are necessary to support asynchronous operations:

    sudo apt-get install python3 python3-pip
  2. This client uses SteVe for the Central System, but can connect to other Central Systems as well.

    • Optional: Clone the repository and run SteVe.
    • Be sure the Central system is up when running the client and that the client is added to the Charge Point list.
  3. Run the following command to install necessary dependencies:

    sudo pip3 install -r requirements.txt
  4. Run the client as sudo:

    sudo python3 ChargePi_client.py

Docker

Deploying on Docker

  1. Configure the configuration file and make sure you have the proper directory structure. Be sure your Central System is running and create/add a charge point.

  2. Build the client image on Docker:

    cd ChargePi/client
    docker build -t chargepi .
  3. Run the container from built image:

    docker run --device /dev/ttyAMA0:/dev/ttyAMA0 --device /dev/mem:/dev/mem --privileged chargepi

Deploying using docker-compose

If you wish, you can run client, SteVe server and Watchtower on the same Pi using docker-compose. The Watchtower service will automatically pull the newest image and run it when it is available.

  1. Change the IP address under server_uri in the settings file to 172.0.1.121.

  2. Build services:

    docker-compose build
  3. Run services in daemon mode using the following command:

    docker-compose up -d

Note:

The project is still under development. There are some known issues to be addressed:

  • Multithreading makes the client very unstable. The client may crash for unknown reasons at any time.
  • Sampling, sending values or overall responsiveness when using the power meter may not be perfect or work as intended.

Any contributions to the project are more than welcome. Fork and submit the PR with proper documentation and i'll review it. Thanks!

If you are interested in a Go version of the project, which is optimized and supports more features and hardware, please check out ChargePi-go.

About

⚡ChargePi🔌 is an open-source Raspberry Pi 4 based ⚡Charging Point🔌 project, which supports multiple EVSEs and simple connectors🔌. A charging connector🔌 consists of a WS281x RGB 🚥 LED strip, a relay and a power meter.

Topics

Resources

Stars

Watchers

Forks