guide quick start - Sevenstax/FreeV2G GitHub Wiki
This quick start guide will lead you to the initial setup of a Whitebeet
. It will also show you how to setup FreeV2G
in an Debian/RaspberryPi based environment using ethernet and SPI as host controller interface. Please follow allong to get started. If you are experience any issues, please have a look into the FAQ
first. You can finde solutions to the most common problems there. Then check the issue tracker. If you do not find a solution to you problem please open an issue by using the bug report
template. Please fill in the issue template and keep the Guide: Creating log files in mind.
Connect your Whitebeet
directly to an ethernet interface of your host system (e.g. PC), NO routers or switches in between.
Connect the UART port of your Whitebeet
to a PC (please see the UART section in the Guide: Creating log files for more details).
Next, set the Whitebeet to use ethernet as host controller interface. Connect the Whitebeet
pins like shown in the table below.
Whitebeet | Whitebeet Carrier Board | Level |
---|---|---|
PAD 85 (PC2) | J4 PC2 | GND |
PAD 84 (PA4) | J4 PA4 | GND |
Power up your Whitbeet
by connection J12 or J14 to a powersource (e.g. external power supply, USB charger, USB port on your PC).
To use FreeV2G
you need to install python3
and download the FreeV2G
repository first. You can either download FreeV2G
via a git
client or by downloading the repository as a zip
archive.
Please note: Although the environment can be set up in Windows, it is not officially supported at the moment.
Get the latest python3
installation from here or use the package manager of your distribution. On debian you can use apt-get
.
- First install all nessecary linux packages
sudo apt-get install git python3 python3-pip python3-venv libpcap-dev
- Open a new terminal window and navigate to the place where you want to place the
FreeV2G
repository to.
cd ~/dev
- Clone the reporitory and navigate to it:
git clone https://github.com/Sevenstax/FreeV2G.git
cd FreeV2G
- Create a virtual environment called
.venv
virtualenv .venv
- Activate the environment and install the dependecies
source .venv/bin/activate
(.venv) pip3 install -r requirements_eth.txt
When everything is installed and setup correctly you can start FreeV2G
. You need to provide the name of the interface, the MAC address of your Whitebeet
and if it is EV
or EVSE
.
- get the MAC address, please refer to the knowledge base
- get the interface where the Whitebeet pluged in over
ip a
1: lo: <LOOPBACK,UP,LOWER_UP> ...
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> ...
...
6: eth-wb-evse: <BROADCAST,MULTICAST,UP,LOWER_UP> ....
The MAC address is printed on the Whitebeet
itself. There are different MAC addresses in the Whitebeet
, please refer to the knowledge base for more information. Thie example uses a eth-wb-evse
with the MAC address c4:93:00:22:22:22
as an example.
Important: use
.venv/bin/python3
for the pyhton3 interpretor inside of the enviroment!
To start FreeV2G you need to run Application.py
. To load a config file, use -c
and the path to .json
running.
sudo .venv/bin/python3 Application.py eth -i eth-wb-evse -m c4:93:00:22:22:22 -r EVSE -c ./config_evse.json # with config file
or use the default config
sudo .venv/bin/python3 Application.py eth -i eth-wb-evse -m c4:93:00:22:22:22 -r EVSE # without config file
Note: This example uses a RaspberryPi as host system for the
Whitebeet
, but this guide also applies to other Linux based systems with userspace access to thespidev
device. TThis setup was tested on a RaspberryPi 4 running Raspbian.
Connect the SPI interface of your Whitebeet
to your host system. Please see the table below for pin assignments:
Signal | Whitebeet | Whitebeet Carrier Board | Raspberry Pi 4 (name / wPi / BCM) |
---|---|---|---|
CLK | PAD 24 (PD3) | J8 SCK | SPI0 SCLK / 14 / 11 |
MOSI | PAD 36 (PB15) | J8 MOSI | SPI0 MOSI / 12 / 10 |
MISO | PAD 35 (PB14) | J8 MISO | SPI0 MISO / 13 / 9 |
NSS | PAD 77 (PB9) | J8 NSS | GPIO.5 / 5 / 24 |
RxReady | PAD 37 (PD4) | J1 PD4 | GPIO.3 / 3 / 22 |
TxPending | PAD 38 (PD11) | J1 PD11 | GPIO.2 / 2 / 27 |
UART RX | PAD 75 | RXD (near J11) | TxD / 15 / 14 |
UART TX | PAD 76 | TXD (near J11) | RxD / 16 / 15 |
Connect the UART port of your Whitebeet
to a PC or the RaspberryPi (please see the UART section in the Guide: Creating log files for more details).
Next, set the Whitebeet
to use SPI as host controller interface. Connect the Whitebeet
pins like shown in the table below.
Whitebeet | Whitebeet Carrier Board | Level |
---|---|---|
PAD 85 (PC2) | J4 PC2 | 3.3V |
PAD 84 (PA4) | J4 PA4 | GND |
Power up your Whitbeet
by connection J12 or J14 to a powersource (e.g. external power supply, USB charger, USB port on your PC).
Get the latest python3
and git
version from the package manager of your distribution. On RaspberryPi with raspbian you can use apt-get
.
$ sudo apt-get install python3 git
Open a new terminal window and navigate to the place where you want to place the FreeV2G
repository to.
$ cd ~/dev
Then clone the reporitory and navigate to it:
$ git clone https://github.com/Sevenstax/FreeV2G.git
$ cd FreeV2G
Now you need create a virtual environment called .venv
:
$ python3 -m venv .venv
Activate the environment and install the dependecies:
$ source .venv/bin/activate
$ pip install --pre scapy[basic]
$ pip install Cython
$ pip install python-libpcap
$ pip install spidev
$ pip install RPi.GPIO
When everything is installed and setup correctly you can start FreeV2G
. You need to provide the name of the SPI interface and if it is EV
or EVSE
.
The interface name can be obtained by using the ls
command:
$ ls /dev/spi*
/dev/spidev0.0
Here it is /dev/spidev0.0
as an example.
This example uses a WB-EI
as an example. You need to run
.venv\Scripts\python3.exe Application.py spi -i "spidev0.0" -r EVSE