How uhi22/pyplc works
Project Type and Purpose
This is a specialized communication software project that enables communication between electric vehicles and charging stations using the CCS protocol. The project supports three main modes:
• ListenMode: For sniffing traffic between CCS charger and car
• EvseMode: For implementing a charger with CCS support
• PevMode: For implementing charging unit communication
Main Components
A. Core Communication Components:
• PLC (Power Line Communication) Layer
• HomePlug Green PHY implementation
• SLAC (Signal Level Attenuation Characterization)
• Network management (NMK/NID handling)
B. Protocol Stack Layers:
• Physical Layer (PLC/HomePlug)
• Network Layer (IPv6)
• Transport Layer (TCP/UDP)
• Application Layer (ISO15118/DIN)
• V2GTP (Vehicle-to-Grid Transfer Protocol)
• EXI (Efficient XML Interchange)
C. State Machines:
• EVSE State Machine (fsmEvse.py)
• PEV State Machine (fsmPev.py)
D. Hardware Interface:
• Control Pilot Interface
• Power Supply Control
• GPIO Management
E. Support Systems:
• Configuration Management
• Logging System
• Debug/Analysis Tools
[User Interface Layer]
• ↕
[Application Logic Layer (State Machines)]
• ↕
[Protocol Layer]
• ↕
[Network Layer]
• ↕
[Hardware Interface Layer]
Key Relationships to Highlight
a) Communication Flow:
[PLC Modem] ↔ [Network Stack] ↔ [Protocol Handler] ↔ [State Machine] ↔ [Application Logic]
b) Hardware Control:
[State Machine] → [Hardware Interface] → [Physical Hardware]
c) Configuration and Monitoring:
[Configuration] → [All Components]
[Logging] ← [All Components]
Implementation Details
• How pyPlc.py acts as the main entry point
• How configmodule.py manages system configuration
• Relationship between hardwareInterface.py and the state machines
• EXI encoding/decoding process using OpenV2Gx
Testing and Simulation
A section showing:
• Test interfaces (mytestsuite.py)
• Simulation capabilities (simulateMqttBackend.py)
• Monitoring tools (scope.py, udplog.py)