RZ/G3E - EV Charging Station - Ubuntu/Debian

RZ/G3E - EV Charging Station - Ubuntu/Debian

1. Introduction

This user guide describes the procedure for implementing the OCPP compliant EV charging station use case application on the RZ/G3E Smarc EVK using AWS Greengrass, supported on Ubuntu & Debian for RZ MPU.

In the scenario of the EV charging station, the application running on the RZ/G3E Smarc EVK operates as an

EV charging station, while the AWS Cloud infrastructure functions as the Central Management System (CMS). This application complies with OCPP 2.1 standards and is capable of start/stop charging as well as get the meter reading during the charging.

Prerequisites

  • The following guide assumes that instructions from Getting Started - Ubuntu and Debian for RZ MPU Linux were followed and user is able to run Ubuntu / Debian on RZ/G3E Smarc EVK.
    Note: All instructions will be executed on the RZ/G3E Smarc EVK board via the terminal, and the board must have an internet connection.

  • AWS Credentials were prepared according to : RZ/G2L - EV Charging Station | Step 1.1 AWS Credentials Preparation. However, additional steps are required, as described in 3.1 AWS Credentials Preparation. These steps are necessary because an MFA device must be assigned to the IAM user before calling the GetSessionToken API operation.

  • While the application was initially developed for RZ/G2L and based on OCPP v2.0.1, this RZ/G3E Smarc EVK support version utilizes OCPP v2.1 by default.

2. Architecture Description

The architecture diagram presented below illustrates the AWS services utilized in the cloud and the RZ/G3E Smarc EVK. This diagram features two environments: the AWS cloud and the RZ/G3E Smarc EVK. Both environments are interconnected through internet communication protocols, such as WebSocket.

Architecture.png

3. Infrastructure Setup

3.1 AWS Credentials Preparation

Please follow the existing AWS Credentials Preparation guide in RZ/G2L - EV Charging Station | Step 1.1 AWS Credentials Preparation up to step 2. Export AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY as environment variables on Host Machine.

At this point, AWS IAM users need to register MFA device in order to generate AWS_SESSION_TOKEN On AWS Management Console:

  1. From IAM go to Users -> Security credentials -> Assign MFA device

MFA1.png
  1. Enter your Device name and select device option, we recommend Authenticator app.

MFA2.png
  1. Open your Authenticator app and complete the device setup process. Then choose Add MFA.

MFA3.png
  1. Once these steps are completed, MFA setup is successful.

MFA4.png

On Host Machine:

Run following AWS cli command to generate AWS_SESSION_TOKEN for 36 hours duration.

$ aws sts get-session-token --serial-number <MFA_Identifier> --token-code <CODE> --duration-seconds 129600

CODE : from Authenticator app on your mobile phone (e.g. 243037)

MFA_Identifier: from step 4 (e.g. arn:aws:iam::630493028811:mfa/RZG3E_Smarc)

--duration-seconds: range from 900 to 129600 seconds (from 15 minutes to 36 hours)

3.2 Setup EV Charging Station use case infrastructure

3.2.1 Steps to run EV Charging Station on RZ/G3E Smarc EVK:

Both Ubuntu and Debian require login as root user.

Step 1 - Download from GitHub page, the evse-g3e-ubuntu-debian-v1.0.zip file

# wget https://raw.githubusercontent.com/renesas-rz/rz-gateway-solution/main/Demo/RZG3E/Demo%20-%20EV%20Charging%20Station/Ubuntu_Debian/evse-g3e-ubuntu-debian-v1.0.zip

Step 2 - Install necessary software.

Unzip command:

# apt-get update # apt install unzip

Step 3 - Extract the zip file and remove the zip file.

# unzip evse-g3e-ubuntu-debian-v1.0.zip # rm evse-g3e-ubuntu-debian-v1.0.zip

Step 4 - Change directory to scripts.

# cd evse/scripts/

Step 5 - Add execution permission for script

# chmod +x evse.sh

Step 6 - Run evse.sh script and provide AWS credentials and the AWS region as arguments.

# ./evse.sh <AWS_ACCESS_KEY_ID> <AWS_SECRET_ACCESS_KEY> <AWS_SESSION_TOKEN> <AWS_REGION>

The script will take about 30 to 40 minutes to setup the infrastructure on RZ/G3E Smarc EVK and AWS cloud.

During the execution, it will generate logs for each step so that user can review and validate the installation in run time.

3.2.2 Setup process on RZ/G3E Smarc EVK:

All setup steps are the same as those in RZ/G2L - EV Charging Station. For runtime logs of each step, refer to Setup on RZ/G2L EVK of Step 1.2 - Setup EV charging station use case infrastructure.

4. Execute EV Charging Station use case

The execution steps are similar to RZ/G2L - EV Charging Station | Step 2 - Execute EV Charging Station use case.

After completing all setup and execution steps, the following results can be expected from the EV Charging Station demo.

  • Login page (as admin):

login.png
  • Click on Control Center app:

control_center.png
  • Select the Charge point from list:

choose_CP.png
  • Click on SET UNAVAILABLE option to disable the charge point and click on SET AVAILABLE option to enable the charge point. For example, below picture shows the disabling charge point:

set_unavailable.png
  • To set the charge point charge rate, select charge point and select charge rate from the drop-down list:

set_charge_rate.png
  • In main page, start charging by choosing the chargepoint and press START CHARGING button:

start_charging.png
  • After finishing charging, energy consumption graph is displayed at the bottom of main page:

energy_consumption.png

 

Additional Note

If the RZ/G3E Smarc EVK is restarted after the EV Charging Station setup has finished, follow the steps below to restore the EV Charging Station application and AWS Greengrass services to their operational state.

Make sure that the RZ/G3E Smarc EVK is connected to the internet:

# source /opt/venv/bin/activate # systemctl restart greengrass

After 1–2 minutes, the application will be ready to use again.

Remove the instances from both device and AWS Cloud

Since all setup steps are the same as those in RZ/G2L - EV Charging Station, the clean up process is also similar. For a complete guide on removing the instances from both device and AWS Cloud, refer to Remove the instances from both device and AWS Cloud.