# advantics/examples architecture

> Architecture diagram of the GitHub repository advantics/examples, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/advantics/examples
- Repository: https://github.com/advantics/examples

## Overview

This repository provides example EVSE and PEV controller implementations with simulated power stacks, plus CAN-bus monitors for observing charging sessions. The documented workflow runs both simulators and both monitors as separate processes; controller protocol messages are decoded into status displayed in terminal interfaces. Simulator internals were not sampled, so their interactions with the CAN bus are shown as unverified. The README also documents use with real charge controllers and optional bidirectional charging, but the corresponding controller-side configuration is external to this repository.

Main entry points: [`charge-controllers/monitors/evse-monitor.py`](https://github.com/advantics/examples/blob/main/charge-controllers/monitors/evse-monitor.py) (EVSE CAN interface), [`charge-controllers/monitors/pev-monitor.py`](https://github.com/advantics/examples/blob/main/charge-controllers/monitors/pev-monitor.py) (PEV CAN interface), [`charge-controllers/tutorials/EVSE Generic Interface v3/evse-simulator.py`](https://github.com/advantics/examples/blob/main/charge-controllers/tutorials/EVSE%20Generic%20Interface%20v3/evse-simulator.py) (EVSE simulator), [`charge-controllers/tutorials/PEV Generic Interface v2/pev-simulator.py`](https://github.com/advantics/examples/blob/main/charge-controllers/tutorials/PEV%20Generic%20Interface%20v2/pev-simulator.py) (PEV simulator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_simulation["Simulated power stacks"]
  node_evse_sim["EVSE simulator<br/>[evse-simulator.py]"]
  node_pev_sim["PEV simulator<br/>[pev-simulator.py]"]
end

subgraph group_monitoring["CAN monitoring"]
  node_evse_monitor["EVSE monitor<br/>[evse-monitor.py]"]
  node_pev_monitor["PEV monitor<br/>[pev-monitor.py]"]
  node_evse_interface["EVSE CAN interface<br/>[evse-monitor.py]"]
  node_pev_interface["PEV CAN interface<br/>[pev-monitor.py]"]
  node_terminal["Terminal display"]
end

subgraph group_protocol["Controller protocols"]
  node_evse_protocol["EVSE protocol definitions"]
  node_pev_protocol["PEV protocol definitions"]
end

subgraph group_hardware["Charge hardware"]
  node_can_bus["CAN bus"]
  node_secc["SECC controller"]
  node_evcc["EVCC controller"]
end

node_operator(("Operator"))

node_operator -->|"runs"| node_evse_sim
node_operator -->|"runs"| node_pev_sim
node_operator -->|"runs"| node_evse_monitor
node_operator -->|"runs"| node_pev_monitor
node_evse_sim -.->|"uses CAN"| node_can_bus
node_pev_sim -.->|"uses CAN"| node_can_bus
node_can_bus -->|"delivers frames"| node_evse_interface
node_can_bus -->|"delivers frames"| node_pev_interface
node_evse_interface -->|"decodes with"| node_evse_protocol
node_pev_interface -->|"decodes with"| node_pev_protocol
node_evse_interface -->|"updates status"| node_evse_monitor
node_pev_interface -->|"updates status"| node_pev_monitor
node_evse_monitor -->|"renders status"| node_terminal
node_pev_monitor -->|"renders status"| node_terminal
node_secc -->|"communicates over"| node_can_bus
node_evcc -->|"communicates over"| node_can_bus
node_secc -.->|"customer-side example"| node_evse_sim
node_evcc -.->|"customer-side example"| node_pev_sim

click node_evse_sim "https://github.com/advantics/examples/blob/main/charge-controllers/tutorials/EVSE%20Generic%20Interface%20v3/evse-simulator.py"
click node_pev_sim "https://github.com/advantics/examples/blob/main/charge-controllers/tutorials/PEV%20Generic%20Interface%20v2/pev-simulator.py"
click node_evse_monitor "https://github.com/advantics/examples/blob/main/charge-controllers/monitors/evse-monitor.py"
click node_pev_monitor "https://github.com/advantics/examples/blob/main/charge-controllers/monitors/pev-monitor.py"
click node_evse_interface "https://github.com/advantics/examples/blob/main/charge-controllers/monitors/evse-monitor.py"
click node_pev_interface "https://github.com/advantics/examples/blob/main/charge-controllers/monitors/pev-monitor.py"
click node_evse_protocol "https://github.com/advantics/examples/blob/main/charge-controllers/monitors/Advantics_Generic_EVSE_protocol_v3.kcd"
click node_pev_protocol "https://github.com/advantics/examples/blob/main/charge-controllers/monitors/Advantics_Generic_PEV_protocol_v2.kcd"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_evse_sim,node_pev_sim toneBlue
class node_evse_monitor,node_pev_monitor,node_evse_interface,node_pev_interface,node_terminal toneAmber
class node_evse_protocol,node_pev_protocol toneMint
class node_can_bus,node_secc,node_evcc toneRose
class node_operator toneIndigo
```

## Components

### Simulated power stacks

- [EVSE simulator](https://github.com/advantics/examples/blob/main/charge-controllers/tutorials/EVSE%20Generic%20Interface%20v3/evse-simulator.py): `charge-controllers/tutorials/EVSE Generic Interface v3/evse-simulator.py`
- [PEV simulator](https://github.com/advantics/examples/blob/main/charge-controllers/tutorials/PEV%20Generic%20Interface%20v2/pev-simulator.py): `charge-controllers/tutorials/PEV Generic Interface v2/pev-simulator.py`

### CAN monitoring

- [EVSE monitor](https://github.com/advantics/examples/blob/main/charge-controllers/monitors/evse-monitor.py): `charge-controllers/monitors/evse-monitor.py`
- [PEV monitor](https://github.com/advantics/examples/blob/main/charge-controllers/monitors/pev-monitor.py): `charge-controllers/monitors/pev-monitor.py`
- [EVSE CAN interface](https://github.com/advantics/examples/blob/main/charge-controllers/monitors/evse-monitor.py): `charge-controllers/monitors/evse-monitor.py`
- [PEV CAN interface](https://github.com/advantics/examples/blob/main/charge-controllers/monitors/pev-monitor.py): `charge-controllers/monitors/pev-monitor.py`
- **Terminal display**

### Controller protocols

- [EVSE protocol definitions](https://github.com/advantics/examples/blob/main/charge-controllers/monitors/Advantics_Generic_EVSE_protocol_v3.kcd): `charge-controllers/monitors/Advantics_Generic_EVSE_protocol_v3.kcd`
- [PEV protocol definitions](https://github.com/advantics/examples/blob/main/charge-controllers/monitors/Advantics_Generic_PEV_protocol_v2.kcd): `charge-controllers/monitors/Advantics_Generic_PEV_protocol_v2.kcd`

### Charge hardware

- **CAN bus**
- **SECC controller**
- **EVCC controller**

### Other components

- **Operator**

## Connections

- Operator → EVSE simulator: runs (evidence: `README.md`)
- Operator → PEV simulator: runs (evidence: `README.md`)
- Operator → EVSE monitor: runs (evidence: `README.md`)
- Operator → PEV monitor: runs (evidence: `README.md`)
- EVSE simulator → CAN bus: uses CAN
- PEV simulator → CAN bus: uses CAN
- CAN bus → EVSE CAN interface: delivers frames (evidence: `charge-controllers/monitors/evse-monitor.py`)
- CAN bus → PEV CAN interface: delivers frames (evidence: `charge-controllers/monitors/pev-monitor.py`)
- EVSE CAN interface → EVSE protocol definitions: decodes with (evidence: `charge-controllers/monitors/evse-monitor.py`)
- PEV CAN interface → PEV protocol definitions: decodes with (evidence: `charge-controllers/monitors/pev-monitor.py`)
- EVSE CAN interface → EVSE monitor: updates status (evidence: `charge-controllers/monitors/evse-monitor.py`)
- PEV CAN interface → PEV monitor: updates status (evidence: `charge-controllers/monitors/pev-monitor.py`)
- EVSE monitor → Terminal display: renders status (evidence: `charge-controllers/monitors/evse-monitor.py`)
- PEV monitor → Terminal display: renders status (evidence: `charge-controllers/monitors/pev-monitor.py`)
- SECC controller → CAN bus: communicates over (evidence: `README.md`)
- EVCC controller → CAN bus: communicates over (evidence: `README.md`)
- SECC controller → EVSE simulator: customer-side example
- EVCC controller → PEV simulator: customer-side example
