EDF R&D implementation of ISO 15118-20 FDIS.

Related tags

MiscellaneousEDF
Overview

EDF R&D implementation of ISO 15118-20 FDIS

============

This project implements the ISO 15118-20 using Python.

Supported features:

  • DC Bidirectional Power Transfer BPT with dynamic control mode.
  • TLS 1.3 with mutual authentication.
  • Set departure time from SECC side.

Project setup

Installation and setup for Ubuntu

Update your system using the command below:

sudo apt-get update

1. Install MiniConda

Visit the conda installation website link to install MiniConda according to your operating system.

If your operating system is Ubuntu, you can visit this link and follow instructions.

Next, to activate the command conda, execute the line below:

export PATH="[YOUR PATH OF INSTALLED MINICONDA]/bin":$PATH

Example path: /home/trang/miniconda3/bin/

To install conda's shell functions for easier access, once conda command is activated, then:

conda init bash

2. Install PyCharm

Install by Terminal:

sudo snap install pycharm-community --classic

Or you can download the installer via the following link: Download PyCharm Community for Ubuntu

Extract the downloaded file in [YOUR EXTRACTED DIRECTORY OF PYCHARM]. Then, to open PyCharm, run in Terminal :

cd [YOUR EXTRACTED DIRECTORY OF PYCHARM]
./pycharm-community-2021.3.1/bin/pycharm.sh

3. Install Java

This proyect uses OpenEXI for decode/encode xml to EXI. This is a java library, which has been coupled to python using jPype. Since the project imports java libraries, it is required to install JDK. For installing JDK follow the instructions here

For Ubuntu/Debian, you can follow instructions here

4. Create virtual environment and install dependencies

First of all, it is necessary to download the project Raiden V2X from github.

In Terminal:

cd [YOUR DOWNLOADED DIRECTORY OF PROJECT]
conda env create -f environment.yml

Normally, all of project's dependencies are installed automatically when setting virtual environment.

5. Setup virtual environment

From command line

To activate your new virtual environment in Terminal,run the command below:

conda activate edf15118-20

From PyCharm

Step 1:
Add your new virtual environment and interpreter in PyCharm:

In Python Interpreter on bottom right corner of windows, choose Add Interpreter... like the screen shot below

Step 2:

In the popup window, choose your Python interpreter of edf15118-20 environment.

The environment is located in [YOUR PATH OF INSTALLED MINICONDA]/envs/

Then choose the package python of edf15118-20 virtual environment.

For example, the complete Python Interpreter path is:

/home/trang/miniconda3/envs/edf15118-20/bin/python

Installation and setup for Raspberry Pi

1. Install VSCode:

Install with the command line below:

sudo apt-get update
sudo apt install code

2. Install dependencies:

First, install PyQt5 independently with the following command :

sudo apt-get install python3-pyqt5

Next, install all remaining dependencies as below:

pip install -r requirement_rasp.txt

3. Install missing packages

Some packages are not installed automatically via requirement_rasp.txt. To execute the project, it is required to install these librairies manually via the command below:

sudo apt-get install libatlas-base-dev libhdf5-dev libhdf5-serial-dev libatlas-base-dev libjasper-dev

4. Setup Python for VSCode:

In VSCode, press Ctrl+Shift+X to install Python extension then select Python interpreter

5. Install Java

Follow the same steps of Linux PC.

Execute EVCC and SECC

1. Setup configuration files config.ini:

From the terminal, check for network interfaces by using the following command:

ifconfig

For example, the result returned by ifconfig:

enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.0.2.15  netmask 255.255.255.0  broadcast 10.0.2.255
        inet6 fe80::1c00:5e0f:2cb2:e69f  prefixlen 64  scopeid 0x20<link>
        ether 08:00:27:e4:6d:1b  txqueuelen 1000  (Ethernet)
        RX packets 277  bytes 39834 (39.8 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1110  bytes 92105 (92.1 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 475  bytes 42714 (42.7 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 475  bytes 42714 (42.7 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Setup the configuration file an interface which has ipv6 address. In this case, we will use enp0s3 interface.

EVSE :

In file evse_config.ini, setup the parameters as shown below:

[NETWORK]
    interface = enp0s3
    tcp_port = 49152
    # See table 10, must range from 49152 to 65535

[SETTINGS]
    virtual_mode = true

The parameter virtual_mode in [SETTINGS], allows to set and verify the 61851-1 states from a communication card.To simulate the communication card the virtual_mode parmeter can be set to true.

If it is required to verify or set 61851-1 states, some adaptations of the provided interfaces are needed to read and set the states from the communication card.

EVCC :

Setup configuration file ev_config.ini, as follows:

[NETWORK]
    interface = enp0s3
    udp_port = 49153
    # See table 18, must range from 49152 to 65535
    tcp_port = 49154
    # See table 10, must range from 49152 to 65535

[SETTINGS]
    virtual_mode = true

Like EVSE, you set virtual_mode = true/false based on your own situation.

2. Install certificates for mutual authentication

Before running ISO 15118-20, you need to install the certificates for TLS with mutual authentication by running the command below in the terminal:

cd /shared/certificates/

and then run :

sh generateCertificates.sh

3. Run ISO 15118-20

To run a communication session, the server which corresponds to the SECC needs to be running first:

  • If you run using the GUI, go to directory /secc run python3 evse_gui.py
    • In GUI, click Set to define a departure time and target state of charge SoC from the charging station side and then click Start

Start Window SECC

  • If you run without GUI, run start_evse.py

Then, you can run electric vehicle communication controller EVCC:

  • If you execute with GUI, go to directory /evcc and execute python3 ev_gui.py
  • In GUI, click Set to define a departure time and target state of charge SoC from the EV and then click Start

Start Window EVCC

  • To execute without GUI, run start_ev.py

The session sequence can be seen in the terminal by the printed logs or in the GUI, in the information tab.

Information tab EVCC

Once the session is in the charging loop you can control dinamically the power transfer by moving the control bar at the left side of the SECC control window:

Control Window SECC

To stop the charging session, click on stop button of the EVCC start window.

Note: If you have the error message below when runing the project:

qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.

Aborted (core dumped)

This error comes from the library libxcb which is used in package Qt for GUI. To fix it, you need to re-install this library with the command below:

sudo apt-get install libxcb-randr0-dev libxcb-xtest0-dev libxcb-xinerama0-dev libxcb-shape0-dev libxcb-xkb-dev

Generate documentation


In order to generate the documentation, one has to use the sphinx module from the docs directory:

    make html
Comments
  • Stop button from EVCC side is not working systematically.

    Stop button from EVCC side is not working systematically.

    Stop from the EVCC side without GUI works fine. Hint: The problem seems to be related to accelerated message exchange, the GUI seems to need more time to process the stop request.

    opened by OSkrdgz 4
  • Fix: comply with schemas from e58323a

    Fix: comply with schemas from e58323a

    When verifying my decoder, I ran in the issue that ScheduleExchangeReq message couldn't be decoded. After some research I found a mismatch in schema updates but not in the code see: e58323a 2048 -> 1024

    Ps, thanks for open-sourcing this project

    opened by jessekerkhoven 4
  • This piece of code takes too much time to be executed

    This piece of code takes too much time to be executed

    https://github.com/EDF-Lab/eVDriveFlow/blob/23766073bad54cb7366ab41d90acc6b1e505b5a9/evcc/tcp_client.py#L119

    https://github.com/EDF-Lab/eVDriveFlow/blob/23766073bad54cb7366ab41d90acc6b1e505b5a9/secc/tcp_server.py#L98

    xml_object = self.message_handler.unmarshall(xml) request_type = type(xml_object).name logger.info("Received %s.", request_type) # TODO: This method takes too long

    opened by OSkrdgz 1
  • Support fragment encoding for signing data

    Support fragment encoding for signing data

    According to the standard; For PnC support certain fields need to be encoded as an EXI fragment by the EVCC or SECC (for verification or to add in the message):

    • [x] PnC_AReqIdentificationMode
    • [ ] SignedInstallationData
    • [ ] Fields of MeteringConfirmationReq
    • [ ] ChargeParameterDiscoveryRes
    • [x] SignatureInfo (with the xmldsig schema)

    This commit simply adds the support to encode the marked types, but doesn't use any yet.

    opened by SirTates 0
  • Update certificate configuration files to fill required elements:

    Update certificate configuration files to fill required elements:

    In order to generate the certifcates compliant with the standard the .cnf files corresponding to each certificatemust contain the required and critical extensions as specified in the Certificate profiles in Annex B of 15118-20.

    | x | Required: issuing CA must make sure that this extension is present certificate validating entity must ensure that this extension is present | |-----|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | (x) | Optional it is upto the discretion of the issuing CA and/or certificate requester to either include or omit this extension certificate validating entity must ignore the absence of this extension | | - | Must not be present issuing CA must make sure that this extension is not present certificate validating entity must ensure that this extension is not present | | c | This extension is critical, see IETF RFC 5280 if this extension is present, the certificate validating entity must process it. If an implementation recognizes that a “critical” extension is present, but the implementation cannot interpret the extension, the implementation has to reject the certificate. Quote from IETF RFC 5280: “A certificate-using system MUST reject the certificate if it encounters a critical extension it does not recognize or a critical extension that contains information that it cannot process." NOTE: IETF RFC 5280 has been updated by IETF RFC 6818, IETF RFC 8398 and IETF RFC 8399. These updates are considered to be included for this version of ISO 15118-20 standard. | | nc | This extension is non-critical, see IETF RFC 5280 if this extension is present, the certificate validating entity may ignore it if either the entity is unable to process the extension or if the requirements allow the entity to ignore the extension. If an implementation recognizes that a “non-critical” extension is present, but the implementation cannot interpret the extension, the extension can be ignored. Quote from IETF RFC 5280: “A non-critical extension MAY be ignored if it is not recognized, but MUST be processed if it is recognized." NOTE: IETF RFC 5280 has been updated by IETF RFC 6818, IETF RFC 8398 and IETF RFC 8399. These updates are considered to be included for this version of ISO 15118-20 standard. ||

    opened by OSkrdgz 0
Releases(v0.1.1)
Owner
GitHub organization of EDF Research & Development
Weakly-Divisable - Takes an interger and seee if it is weakly divisible by seven

Weakly Divisble Project by Diana Arce-Hernandez, Ryan McAlpine, and Rommel Ravan

Diana Arce-Hernandez 1 Jan 12, 2022
Easily map device and application controls to a midi controller

pymidicontroller Introduction Easily map device and application controls to a midi controller

Tane Barriball 24 May 16, 2022
Predict if a fuse is usable on an appliance depending on the fuse rating

fuse-feasibility-analysis Predict if a fuse is usable on an appliance depending on the fuse rating , Power rating and resistance in the appliance

Sebastian Muchui 4 Jul 21, 2022
Code repo for the book "Feature Engineering for Machine Learning," by Alice Zheng and Amanda Casari, O'Reilly 2018

feature-engineering-book This repo accompanies "Feature Engineering for Machine Learning," by Alice Zheng and Amanda Casari. O'Reilly, 2018. The repo

Alice Zheng 1.3k Dec 30, 2022
Blender Add-on to Add Metal Materials to Your Scene

Blender QMM (Quick Metal Materials) Blender Addon to Add Metal Materials to Your Scene Installation Download the latest ZIP from Releases. Usage This

Don Schnitzius 27 Dec 26, 2022
Better firefox bookmarks script for rofi

rofi-bookmarks Small python script to open firefox bookmarks with rofi. Features Icons! Only show bookmarks in a specified bookmark folder Show entire

32 Nov 10, 2022
GDSC UIET KUK 📍 , welcomes you all to this amazing event where you will be introduced to the world of coding 💻 .

GDSC UIET KUK 📍 , welcomes you all to this amazing event where you will be introduced to the world of coding 💻 .

Google Developer Student Club UIET KUK 9 Mar 24, 2022
Application launcher and environment management

Application launcher and environment management for 21st century games and digital post-production, built with bleeding-rez and Qt.py News Date Releas

10 Nov 03, 2022
Voldemort's Python import helper

importmagician Voldemort's Python import helper pip install importmagician Import from uninstalled Python directories Say you have a directory (relat

Zhengyang Feng 4 Mar 09, 2022
Ontario-Covid19-Screening - An automated Covid-19 School Screening Tool for Ontario

Ontario-Covid19-Screening An automated Covid-19 School Screening Tool for Ontari

Rayan K 0 Feb 20, 2022
Python Service for MISP Feed Management

Python Service for MISP Feed Management This set of scripts is designed to offer better reliability and more control over the fetching of feeds into M

Chris 7 Aug 24, 2022
Chicks get hostloc points regularly

hostloc_getPoints 小鸡定时获取hostloc积分 github action大规模失效,mjj平均一人10鸡,以下可以部署到自己的小鸡上

59 Dec 28, 2022
A not exist cat image generator python package

A not exist cat image generator python package

Fayas Noushad 2 Dec 03, 2021
Usos Semester average helper

Usos Semester average helper Dzieki temu skryptowi mozesz sprawdzic srednia ocen na kazdy odbyty przez ciebie semestr PARAMETERS required: '--username

2 Jan 17, 2022
Runtime fault injection platform by Daniele Rizzieri (2021)

GDBitflip [v1.04] Runtime fault injection platform by Daniele Rizzieri (2021) This platform executes N times a binary and during each execution it inj

Daniele Rizzieri 1 Dec 07, 2021
An OpenSource crowd-sourced cooking recipes website

An OpenSource crowd-sourced cooking recipes website

21 Jul 31, 2022
Student Management System Built With Python

Student-Management-System Group Members 19BCE183 - Patel Sarthak 19BCE195 - Patel Jinil 19BCE220 - Rana Yash Project Description In our project Studen

Sarthak Patel 6 Oct 20, 2022
A series of basic programs written in Python

Primeros programas en Python Una serie de programas básicos escritos en Python

Madirex 1 Feb 15, 2022
Writeup of NilbinSec's participation in the Winja CTF for c0c0n 2021

Winja-CTF-c0c0n-2021-Writeup NilbinSec's participation in the Winja CTF for c0c0n 2021 This repo covers NilbinSec's participation in the Winja CTF dur

1 Nov 15, 2021
Insert a Spotify Playlist, Get a list of YouTube URLs from it.

spotbee This is a module that spits out YouTube URLs from Spotify Playlist URLs Why use this? It is asynchronous which makes it compatible to use with

Nishant Sapkota 10 Apr 06, 2022