#
(Linux) Vehicle to Home Charger Hacking
#
🌟 Project Overview
The BeagleBone-V2H project focused on the reverse engineering and experimentation of an Indra Vehicle to Grid (V2G) bi-directional charging system. The aim was to replicate the functionality of the existing system with local control only. This involved building a completely new BeagleBone firmware image, writing custom kernel overlays for hardware support, and developing a bespoke application in Rust. Additionally, a SvelteKit webUI was prototyped to provide local user control through a websockets interface. Upon completing a proof of concept, a load matching Vehicle to Home (V2H) feature was added so that the connected electric vehicle could safely power an entire home and charge from excess solar automatically.
#
🔑 Stages
🔧 Reverse Engineering Commercial CHAdeMO V2G System:
- Dumped eMMC image of existing firmware, extracted configs, and decompiled main executable
- Ghidra for reverse engineering existing C++ CHAdeMO V2G firmware
- Extracted boot and runtime logs through TTL UART
🛠 Implementing Peripherals and Drivers:
- Retained access to hardware components using bespoke Linux kernel overlays
- Designed custom libraries for EV DC rapid charging CHAdeMO CAN, PRE 6kW bi-directional CAN charger, STMicro STPM3x SPI energy monitor, Analog Devices AD7237 SPI ADC, and Philips PCA95xx I2C GPIO extender
- 💡 Designing Replacement Application:
🔬 Experimenting with CCS Adaption:
- Developed a ground-up replacement application in Rust with the aim of cloud disconnection and local control only.
- Conducted experiments on adapting the CHAdeMO interface using pyPLC to enable CCS for EV charging using GreenPHY for protocol communication.
#
🛠️ Technical Stack
💻 Programming and Runtime:
- Rust with Tokio async runtime.
- SQLx for database interactions.
- Async SocketCAN for CAN network communication.
- I2C and SPI for interfacing with STMicro energy monitor, Analog Devices ADC, and Philips GPIO panel interface.
- Tokio Tungstenite websocket API.
- SvelteKit web interface.
📊 Database Management:
🔌 Hardware Platform:
💻 Operating System:
- SQLite3 for local events recording and datalogging.
- JSON based charging/discharging scheduler.
- Existing BeagleBone Green - Texas Instruments (Ti) System-on-Chip (SoC).
- Linux Debian 10 - SD boot.