Direct integration between EVerest and WHITE-beet-EI hardware for ISO15118-3 SLAC functionality using Python.
This is a pure Python implementation of the WhiteBeet SLAC module. Unlike the C++ version, this module directly uses the FreeV2G Python library without any language bridging, making it simpler, cleaner, and easier to maintain.
✅ Much Simpler - ~200 lines vs ~800 lines in C++
✅ Direct FreeV2G Integration - No embedding, no wrappers
✅ Easier to Debug - All in one language
✅ No Compilation - Just copy and run
✅ Faster Development - Modify and test immediately
✅ More Maintainable - Clean, readable code
# Install Python and dependencies
sudo apt-get install python3 python3-pip
sudo pip3 install scapy pylibpcap
# Install EVerest (if not already done)
# Follow EVerest installation guideNote: FreeV2G is now included as a git submodule and will be installed automatically with the module.
# Clone with submodules
git clone --recurse-submodules https://github.com/a1miro/whitebeet-slac-python.git
# Or if already cloned:
git submodule update --init --recursive
# Build and install
cmake -B build -S .
sudo cmake --build build --target installThis installs:
- Module to
/usr/local/libexec/everest/modules/WhiteBeetSlac/ - Configs to
/usr/local/etc/everest/ - FreeV2G to
/usr/local/share/FreeV2G/
The module will automatically detect FreeV2G in standard locations.
See BUILD.md for detailed build instructions.
# Copy module to EVerest modules directory
cd /home/amironenko/projects/imx93evk-rolec/workspace/whitebeet-slac-python
cp -r modules/WhiteBeetSlac /path/to/everest/modules/
# Or set module search path
export EV_MODULE_DIR=/home/amironenko/projects/imx93evk-rolec/workspace/whitebeet-slac-python/modulesThe module provides several configuration files for different use cases:
config/config-debug-auto.yaml - Automatically enables SLAC on startup without needing EvseManager:
whitebeet_slac:
module: WhiteBeetSlac
config_implementation:
main:
device: eth0
whitebeet_mac: "c4:93:00:34:a4:e2"
debug_auto_enable: true # Auto-enable for testingUse this for: Quick hardware testing without full EVerest setup.
config/config-with-evse-sim.yaml - Full EVSE simulation with YetiSimulator:
evse_manager:
module: EvseManager
connections:
slac:
- implementation_id: main
module_id: whitebeet_slac
# ... other connectionsUse this for: Testing the full charging workflow with simulated CP states.
config/config-standalone-test.yaml - Minimal config for manual command testing:
# Enable SLAC manually:
everest-cli call whitebeet_slac main reset '{"enable": true}'
everest-cli call whitebeet_slac main enter_bcd '{}'Use this for: Development and debugging with manual control.
# Quick test (auto-enable):
sudo manager --conf config/config-debug-auto.yaml
# Full simulation with EvseManager:
sudo manager --conf config/config-with-evse-sim.yaml
# Manual control:
sudo manager --conf config/config-standalone-test.yamlThe SLAC module only handles the data link layer. A complete charging session requires:
1. SLAC Module (this module)
↓ Establishes PLC communication link
2. ISO15118 Module (EvseV2G)
↓ Handles V2G protocol (SessionSetup, Authorization, etc.)
3. EvseManager
↓ Controls power delivery
4. Charging starts!
When you see "SLAC matching successful", the SLAC module has:
- ✅ Established the PLC data link
- ✅ Published
state = "MATCHED" - ✅ Published
dlink_ready = True
Next step: The ISO15118 module (EvseV2G) should now start the V2G communication protocol. If charging doesn't start, check:
- Is EvseV2G module running? Check logs for ISO15118 messages
- Is the HLC connection configured? EvseManager must connect SLAC → ISO15118
- Are certificates configured? For secure charging (or use
tls_security: prohibitfor testing)
Use config/config-complete-charging.yaml for a full working setup:
# This includes: SLAC + ISO15118 + EvseManager + Auth
sudo manager --conf config/config-complete-charging.yamlThis configuration includes:
- WhiteBeet SLAC - PLC data link (this module)
- EvseV2G - ISO15118-2 protocol handler
- EvseManager - Session orchestration and power control
- YetiSimulator - Simulated board support (CP, relays, power meter)
- Auth modules - Free service for testing
Problem: SLAC matches but charging doesn't start
Check:
# 1. Verify ISO15118 module is loaded
grep "EvseV2G" /tmp/everest-logs/*
# 2. Check if HLC connection exists in config
grep -A5 "hlc:" your-config.yaml
# 3. Monitor V2G messages
tail -f /tmp/everest-logs/*.xmlSolution: Ensure your config has the HLC module connected:
evse_manager:
connections:
slac:
- module_id: whitebeet_slac
hlc: # ← This is required!
- module_id: iso15118_chargermodules/WhiteBeetSlac/
├── manifest.yaml # Module configuration
└── whitebeet_slac.py # Main module (200 lines)
That's it! No build system, no compilation, just Python.
The module is incredibly straightforward:
- Initialize: Connect to WhiteBeet via FreeV2G
- Setup CP: Configure Control Pilot in EVSE mode
- Start SLAC: Enable SLAC module on QCA7005
- Wait for Vehicle: When BCD state entered, start matching
- Match: Call
slacStartMatching()and wait forslacMatched() - Done: Publish MATCHED state and enable high-level communication
- ✅ Direct Whitebeet API calls (no language bridging)
- ✅ Simple thread-based operation
- ✅ Clean error handling
- ✅ Standard EVerest SLAC interface
- ✅ Logging integration
- ✅ No build dependencies
# Initialize WhiteBeet
self.whitebeet = Whitebeet("ETH", self.device, self.whitebeet_mac)
# Setup Control Pilot
self.whitebeet.controlPilotSetMode(1)
self.whitebeet.controlPilotSetDutyCycle(100)
self.whitebeet.controlPilotStart()
# Start SLAC
self.whitebeet.slacStart(1)
# Wait for matching
matched = self.whitebeet.slacMatched()
if matched:
self.publish.state("MATCHED")// Initialize Python interpreter
Py_Initialize();
PyRun_SimpleString("import sys");
PyRun_SimpleString("sys.path.insert(0, '/opt/FreeV2G')");
// Import Python module
PyObject* pName = PyUnicode_DecodeFSDefault("Whitebeet");
PyObject* pModule = PyImport_Import(pName);
Py_DECREF(pName);
// Get class and create instance
PyObject* pClass = PyObject_GetAttrString(pModule, "Whitebeet");
PyObject* pArgs = PyTuple_New(3);
// ... 50 more lines of Python C API callsThe difference is clear!
| Parameter | Type | Default | Description |
|---|---|---|---|
device |
string | eth0 |
Ethernet interface for WhiteBeet |
whitebeet_mac |
string | c4:93:00:34:a4:e4 |
WhiteBeet MAC address |
slac_timeout_ms |
integer | 50000 |
SLAC timeout (ms) |
publish_mac_on_match_cnf |
boolean | true |
Publish EV MAC |
Enable debug logging:
export EVEREST_LOG_LEVEL=debug
sudo manager --conf config/config-basic.yamlMonitor SLAC traffic:
sudo tcpdump -i eth0 -XX ether proto 0x88e1# Check module search path
echo $EV_MODULE_DIR
# Or copy to EVerest modules directory
cp -r modules/WhiteBeetSlac /usr/share/everest/modules/# Verify FreeV2G installation
python3 -c "import sys; sys.path.insert(0, '/opt/FreeV2G'); from Whitebeet import Whitebeet"
# If fails, clone FreeV2G
sudo git clone https://github.com/Sevenstax/FreeV2G.git /opt/FreeV2G# Check network interface
ip link show eth0
# Verify WhiteBeet is reachable
ping <whitebeet_ip>
# Check MAC address (lowercase with colons)
# Correct: c4:93:00:34:a4:e4| Aspect | C++ Module | Python Module ✅ |
|---|---|---|
| Code Size | ~800 lines | ~200 lines |
| Complexity | High (Python embedding) | Low (direct calls) |
| Build Time | Minutes (compilation) | None (interpreted) |
| Debugging | Complex (2 languages) | Simple (Python) |
| Dependencies | Python dev headers, CMake | Just Python3 |
| Maintenance | Hard (cross-language) | Easy (pure Python) |
| Development | Edit → Build → Test | Edit → Test |
| Errors | Compile + runtime | Runtime only |
# Edit the module
vim modules/WhiteBeetSlac/whitebeet_slac.py
# No build needed - just restart EVerest
sudo manager --conf config/config-basic.yamlThe code is straightforward to extend:
# Add EV MAC extraction
def _get_ev_mac(self):
# Extract MAC from WhiteBeet
# ... implementation ...
return mac_address
# Use it
if self.publish_mac:
ev_mac = self._get_ev_mac()
self.publish.ev_mac_address(ev_mac)SLAC is not performance-critical (happens once per charging session), so Python's slightly lower performance vs C++ is completely negligible. The network and hardware operations dominate the timing.
Apache 2.0 - See LICENSE file for details.
- Andrei Mironenko, Parallel Dynamic Ltd.
- EVerest Documentation
- FreeV2G Project
- WhiteBeet Hardware
- C++ version (for comparison):
../whitebeet-slac/