Giter Club home page Giter Club logo

ocmf-go's Introduction

⚡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.

ocmf-go's People

Contributors

xblaz3kx avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.