feat: bootstrap wiki for Anfu home EV charger OCPP integration project
- Created initial wiki structure with CLAUDE.md schema, index.md, and log.md. - Ingested findings and requirements document into the wiki. - Added concepts for authorization methods, network topology, OCPP protocol, and troubleshooting. - Documented entities including the Anfu charger, JC-6620 controller, and CSMS toolkit. - Established configuration files for Obsidian app settings and workspace layout. - Implemented core plugins and appearance settings for the wiki.
This commit is contained in:
Vendored
+1
@@ -0,0 +1 @@
|
||||
{}
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{}
|
||||
Vendored
+33
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"file-explorer": true,
|
||||
"global-search": true,
|
||||
"switcher": true,
|
||||
"graph": true,
|
||||
"backlink": true,
|
||||
"canvas": true,
|
||||
"outgoing-link": true,
|
||||
"tag-pane": true,
|
||||
"footnotes": false,
|
||||
"properties": true,
|
||||
"page-preview": true,
|
||||
"daily-notes": true,
|
||||
"templates": true,
|
||||
"note-composer": true,
|
||||
"command-palette": true,
|
||||
"slash-command": false,
|
||||
"editor-status": true,
|
||||
"bookmarks": true,
|
||||
"markdown-importer": false,
|
||||
"zk-prefixer": false,
|
||||
"random-note": false,
|
||||
"outline": true,
|
||||
"word-count": true,
|
||||
"slides": false,
|
||||
"audio-recorder": false,
|
||||
"workspaces": false,
|
||||
"file-recovery": true,
|
||||
"publish": false,
|
||||
"sync": true,
|
||||
"bases": true,
|
||||
"webviewer": false
|
||||
}
|
||||
Vendored
+22
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"collapse-filter": true,
|
||||
"search": "",
|
||||
"showTags": false,
|
||||
"showAttachments": false,
|
||||
"hideUnresolved": false,
|
||||
"showOrphans": true,
|
||||
"collapse-color-groups": true,
|
||||
"colorGroups": [],
|
||||
"collapse-display": true,
|
||||
"showArrow": false,
|
||||
"textFadeMultiplier": 0,
|
||||
"nodeSizeMultiplier": 1,
|
||||
"lineSizeMultiplier": 1,
|
||||
"collapse-forces": true,
|
||||
"centerStrength": 0.518713248970312,
|
||||
"repelStrength": 10,
|
||||
"linkStrength": 1,
|
||||
"linkDistance": 250,
|
||||
"scale": 1,
|
||||
"close": true
|
||||
}
|
||||
Vendored
+201
@@ -0,0 +1,201 @@
|
||||
{
|
||||
"main": {
|
||||
"id": "845e7cc05ff72205",
|
||||
"type": "split",
|
||||
"children": [
|
||||
{
|
||||
"id": "c87b25e7f6c6596d",
|
||||
"type": "tabs",
|
||||
"children": [
|
||||
{
|
||||
"id": "071e92b44b13465b",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "empty",
|
||||
"state": {},
|
||||
"icon": "lucide-file",
|
||||
"title": "New tab"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "b805d2e359ad49be",
|
||||
"type": "tabs",
|
||||
"children": [
|
||||
{
|
||||
"id": "dd91c0d1025f5890",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "graph",
|
||||
"state": {},
|
||||
"icon": "lucide-git-fork",
|
||||
"title": "Graph view"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"direction": "vertical"
|
||||
},
|
||||
"left": {
|
||||
"id": "a06802947500e445",
|
||||
"type": "split",
|
||||
"children": [
|
||||
{
|
||||
"id": "6bd8575a63e3dd1f",
|
||||
"type": "tabs",
|
||||
"children": [
|
||||
{
|
||||
"id": "3ea02b4f3a691ec9",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "file-explorer",
|
||||
"state": {
|
||||
"sortOrder": "alphabetical",
|
||||
"autoReveal": false
|
||||
},
|
||||
"icon": "lucide-folder-closed",
|
||||
"title": "Files"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "00dc74c738414327",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "search",
|
||||
"state": {
|
||||
"query": "",
|
||||
"matchingCase": false,
|
||||
"explainSearch": false,
|
||||
"collapseAll": false,
|
||||
"extraContext": false,
|
||||
"sortOrder": "alphabetical"
|
||||
},
|
||||
"icon": "lucide-search",
|
||||
"title": "Search"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "1f107c9db45dc3b9",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "bookmarks",
|
||||
"state": {},
|
||||
"icon": "lucide-bookmark",
|
||||
"title": "Bookmarks"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"direction": "horizontal",
|
||||
"width": 300
|
||||
},
|
||||
"right": {
|
||||
"id": "7415e57f7aad22c6",
|
||||
"type": "split",
|
||||
"children": [
|
||||
{
|
||||
"id": "b67160b2e3a4972b",
|
||||
"type": "tabs",
|
||||
"children": [
|
||||
{
|
||||
"id": "be528c0dbc2ec0e6",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "backlink",
|
||||
"state": {
|
||||
"collapseAll": false,
|
||||
"extraContext": false,
|
||||
"sortOrder": "alphabetical",
|
||||
"showSearch": false,
|
||||
"searchQuery": "",
|
||||
"backlinkCollapsed": false,
|
||||
"unlinkedCollapsed": true
|
||||
},
|
||||
"icon": "links-coming-in",
|
||||
"title": "Backlinks"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "c931e44020bf77d2",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "outgoing-link",
|
||||
"state": {
|
||||
"linksCollapsed": false,
|
||||
"unlinkedCollapsed": true
|
||||
},
|
||||
"icon": "links-going-out",
|
||||
"title": "Outgoing links"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "9be8694026ba3bcf",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "tag",
|
||||
"state": {
|
||||
"sortOrder": "frequency",
|
||||
"useHierarchy": true,
|
||||
"showSearch": false,
|
||||
"searchQuery": ""
|
||||
},
|
||||
"icon": "lucide-tags",
|
||||
"title": "Tags"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "a01f0aa6cc119a63",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "all-properties",
|
||||
"state": {
|
||||
"sortOrder": "frequency",
|
||||
"showSearch": false,
|
||||
"searchQuery": ""
|
||||
},
|
||||
"icon": "lucide-archive",
|
||||
"title": "All properties"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "dae30b8411945c80",
|
||||
"type": "leaf",
|
||||
"state": {
|
||||
"type": "outline",
|
||||
"state": {
|
||||
"followCursor": false,
|
||||
"showSearch": false,
|
||||
"searchQuery": ""
|
||||
},
|
||||
"icon": "lucide-list",
|
||||
"title": "Outline"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"direction": "horizontal",
|
||||
"width": 300,
|
||||
"collapsed": true
|
||||
},
|
||||
"left-ribbon": {
|
||||
"hiddenItems": {
|
||||
"switcher:Open quick switcher": false,
|
||||
"graph:Open graph view": false,
|
||||
"canvas:Create new canvas": false,
|
||||
"daily-notes:Open today's daily note": false,
|
||||
"templates:Insert template": false,
|
||||
"command-palette:Open command palette": false,
|
||||
"bases:Create new base": false
|
||||
}
|
||||
},
|
||||
"active": "071e92b44b13465b",
|
||||
"lastOpenFiles": [
|
||||
"raw/FINDINGS_AND_REQUIREMENTS.md",
|
||||
"raw",
|
||||
"Welcome.md"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
# Wiki Schema — Charging Station Knowledge Base
|
||||
|
||||
This directory is an LLM-maintained wiki about the **Anfu home EV charger OCPP integration project**: running a private, self-hosted OCPP 1.6J backend (CSMS) for a home charger, with RFID / vehicle / web-app authorization. The human curates sources and asks questions; the LLM (you) writes and maintains every wiki page.
|
||||
|
||||
The human browses this vault in Obsidian while you edit it. Related code lives in `../discovering/` (connection-test scripts — read-only context, not part of the wiki).
|
||||
|
||||
## Layout
|
||||
|
||||
```
|
||||
wiki/
|
||||
CLAUDE.md ← this schema (co-evolved with the human)
|
||||
index.md ← catalog of every page, by category; update on every ingest
|
||||
log.md ← append-only chronological record of ingests/queries/lints
|
||||
overview.md ← the living synthesis: current state, what works, what's next
|
||||
raw/ ← IMMUTABLE source documents. Never edit anything in here.
|
||||
sources/ ← one summary page per raw source
|
||||
entities/ ← pages for concrete things (devices, software, services)
|
||||
concepts/ ← pages for ideas, protocols, procedures, recurring themes
|
||||
notes/ ← filed answers to questions, analyses, decisions
|
||||
```
|
||||
|
||||
## Conventions
|
||||
|
||||
- **Filenames**: lowercase kebab-case (`jc-6620.md`). Source pages are prefixed with ingest date: `2026-07-09-findings-and-requirements.md`.
|
||||
- **Links**: Obsidian wikilinks, `[[jc-6620]]` or `[[jc-6620|JC-6620]]` when display text matters. Link liberally — links to not-yet-existing pages are fine; they mark pages worth creating.
|
||||
- **Frontmatter** on every page (Dataview-friendly):
|
||||
```yaml
|
||||
---
|
||||
type: source | entity | concept | note | meta
|
||||
updated: YYYY-MM-DD
|
||||
tags: []
|
||||
---
|
||||
```
|
||||
Source pages also get `raw: raw/<filename>` and `ingested: YYYY-MM-DD`.
|
||||
- **Citations**: wiki pages cite the source *summary* page (e.g. "per [[2026-07-09-findings-and-requirements]]"); the summary page links to its raw file. Raw files are the ground truth.
|
||||
- **Contradictions**: when a new source contradicts an existing claim, don't silently overwrite — note it inline: `> [!warning] Superseded: <old claim> (per [[old-source]]); now <new claim> (per [[new-source]])`. Resolve only when the human confirms.
|
||||
- **Status markers**: this is an active hardware project, so mark claims as ✅ verified, ⚠️ untested / needs physical test, or ❓ open question. `overview.md` keeps the authoritative list of open decisions.
|
||||
|
||||
## Workflows
|
||||
|
||||
### Ingest
|
||||
1. Human drops a file into `raw/` and asks to process it.
|
||||
2. Read the raw source fully. Briefly discuss key takeaways with the human (what's new, what conflicts).
|
||||
3. Write a summary page in `sources/` (frontmatter, TL;DR, key facts, what changed in the wiki because of it).
|
||||
4. Update or create affected `entities/`, `concepts/`, and `overview.md`. Flag contradictions per the convention above.
|
||||
5. Update `index.md`; append a `log.md` entry.
|
||||
|
||||
### Query
|
||||
1. Read `index.md` first to locate relevant pages; drill into them (grep the wiki if the index isn't enough).
|
||||
2. Answer with citations to wiki pages / raw sources.
|
||||
3. If the answer is durable (a comparison, a decision, an analysis), offer to file it under `notes/` so it compounds.
|
||||
|
||||
### Lint (on request, or suggest when the wiki feels stale)
|
||||
Check for: contradictions between pages, claims superseded by newer sources, orphan pages (no inbound links), concepts mentioned ≥2 times without their own page, stale `overview.md`, `index.md` entries out of sync with reality. Report findings; fix with the human's blessing.
|
||||
|
||||
## Log format
|
||||
|
||||
Append-only, newest at the bottom. Each entry starts:
|
||||
|
||||
```
|
||||
## [YYYY-MM-DD] ingest|query|lint|meta | Short title
|
||||
```
|
||||
|
||||
so `grep "^## \[" log.md | tail -5` shows recent activity. Body: 1–4 lines on what was done and which pages were touched.
|
||||
@@ -0,0 +1,28 @@
|
||||
---
|
||||
type: concept
|
||||
updated: 2026-07-09
|
||||
tags: [auth, requirements]
|
||||
---
|
||||
|
||||
# Authorization Methods
|
||||
|
||||
The three planned ways to authorize a charging session. Architecturally they all collapse to one gate: **`decide(id_tag)` in `station.py`** ([[csms-toolkit]]) returns Accepted/Rejected against the allowlist in `station_config.json`. Per [[2026-07-09-findings-and-requirements]]:
|
||||
|
||||
## 1. RFID cards — ✅ mechanism built, enrollment pending
|
||||
|
||||
Use the cards already owned. Flow: enable learn mode → tap each card once → harvest its idTag from `seen_tags.json` → add to `authorized` with a name (`kind: "card"`) → set `learn_mode=false` to enforce.
|
||||
|
||||
## 2. By vehicle / chassis — ⚠️ needs a physical test
|
||||
|
||||
True VIN-based **ISO 15118 Plug & Charge is unlikely** on a basic AC unit. The realistic option is **Autocharge**: some chargers automatically send a per-vehicle idTag when a car plugs in, no card tap needed.
|
||||
|
||||
**The test:** plug the car in *without* tapping a card. If a stable idTag shows up in `seen_tags.json`, whitelist it as `kind: "car"` and "by vehicle" works. If nothing appears, this method is not achievable on the [[anfu-charger|Anfu hardware]] — drop it.
|
||||
|
||||
## 3. Mobile / web app — 📋 to build
|
||||
|
||||
A mobile-friendly web control panel (no app store):
|
||||
|
||||
- Start/Stop via OCPP `RemoteStartTransaction` / `RemoteStopTransaction`
|
||||
- Live charger status
|
||||
- Clickable allowlist management
|
||||
- Bound to `0.0.0.0`, reached only over [[netbird|NetBird]]; optional PIN/token for defense-in-depth (❓ open decision, see [[overview]])
|
||||
@@ -0,0 +1,26 @@
|
||||
---
|
||||
type: concept
|
||||
updated: 2026-07-09
|
||||
tags: [network]
|
||||
---
|
||||
|
||||
# Network Topology
|
||||
|
||||
How the [[anfu-charger|charging pile]]'s internal network sits behind the household network. Per [[2026-07-09-findings-and-requirements]]:
|
||||
|
||||
```
|
||||
10.0.10.0/24 (upstream / WAN — main gateway lives here)
|
||||
│
|
||||
┌──┴────────────────┐
|
||||
│ Four-Faith router │ WAN gets a 10.0.10.x address; NAT boundary
|
||||
└──┬────────────────┘
|
||||
│ LAN = 192.168.2.1 (mask 255.255.255.0)
|
||||
├── 192.168.2.228 JC-6620 OCPP controller ← the OCPP client
|
||||
├── 192.168.2.118 EV charging controller (main board), DHCP
|
||||
└── 192.168.2.114 maintenance PC (LAN side)
|
||||
```
|
||||
|
||||
- Wiring is the manufacturer's **star** topology: the EV controller and the [[jc-6620|JC-6620]]'s fixed-IP (right) port each plug into a router LAN1–4 port.
|
||||
- **Traffic direction matters:** the JC-6620 dials *outbound* to the CSMS, so NAT just works — ✅ no port-forwarding needed on the Four-Faith router. Port-forwarding would only matter for inbound connections, which don't occur.
|
||||
- A CSMS can live either on the charger LAN (`192.168.2.x`) or upstream on the WAN subnet (`10.0.10.x`) — both ✅ verified — **provided** the JC-6620's default gateway is `192.168.2.1` (it shipped pointing at itself; see [[troubleshooting]]).
|
||||
- The CSMS host itself must allow inbound TCP 9000 and keep a stable IP (see [[csms-toolkit]]).
|
||||
@@ -0,0 +1,20 @@
|
||||
---
|
||||
type: concept
|
||||
updated: 2026-07-09
|
||||
tags: [protocol]
|
||||
---
|
||||
|
||||
# OCPP 1.6J
|
||||
|
||||
**Open Charge Point Protocol**, version 1.6, JSON variant ("J") — the protocol between a charge point and its backend (**CSMS**, Charging Station Management System). Messages are JSON frames over a WebSocket that the *charge point* opens toward the CSMS.
|
||||
|
||||
How it maps onto this project:
|
||||
|
||||
- **Charge point / client:** the [[jc-6620|JC-6620]] inside the [[anfu-charger|Anfu pile]]
|
||||
- **CSMS / server:** the [[csms-toolkit]] scripts, listening on `ws://0.0.0.0:9000/<chargePointId>`
|
||||
- **Messages in play so far:**
|
||||
- `BootNotification` — ✅ full exchange verified in both LAN and WAN setups (per [[2026-07-09-findings-and-requirements]])
|
||||
- `Authorize` — carries the idTag that `decide(id_tag)` accepts/rejects; the heart of [[authorization]]
|
||||
- `RemoteStartTransaction` / `RemoteStopTransaction` — the CSMS-initiated calls the future web panel will use
|
||||
|
||||
Because the charge point is always the connecting party, the CSMS needs a reachable, stable address — but the charger network needs no inbound rules (see [[network-topology]]).
|
||||
@@ -0,0 +1,19 @@
|
||||
---
|
||||
type: concept
|
||||
updated: 2026-07-09
|
||||
tags: [troubleshooting, gotchas]
|
||||
---
|
||||
|
||||
# Troubleshooting Checklist
|
||||
|
||||
Hard-won gotchas from getting the first connection working. **If the charger "never connects," check these in order.** Per [[2026-07-09-findings-and-requirements]]:
|
||||
|
||||
1. **CSMS host firewall** — inbound TCP 9000 must be allowed. Windows silently drops otherwise; looks identical to "charger never dials."
|
||||
2. **`Billing Mode` must be `BackgroundBilling`** — until it is, the [[jc-6620|JC-6620]] never dials out *at all* (zero TCP SYNs on the wire). This was the blocker for the very first connection.
|
||||
3. **`Communication Method` must be `Ethernet`** — not 4G/SIM.
|
||||
4. **Power-cycle after changes** — URL / network changes on the [[anfu-charger|touchscreen]] only take effect after power-cycling the pile.
|
||||
5. **JC-6620 default gateway must be `192.168.2.1`** — it shipped as `192.168.2.228` (itself). Symptom: a same-subnet (`192.168.2.x`) CSMS works but an off-subnet (`10.0.10.x`) one silently doesn't.
|
||||
6. **No port-forwarding needed** — the JC-6620 is the client and dials outbound; see [[network-topology]]. Don't waste time on the router's forwarding rules.
|
||||
7. **CSMS host IP must be stable** — the touchscreen URL is hardcoded; a DHCP-shifted host looks like a dead CSMS.
|
||||
|
||||
Diagnostic ladder (from [[csms-toolkit]]): `rawlisten.py` (do *any* bytes arrive?) → `csms.py` (does OCPP handshake complete?) → `station.py` (full controller).
|
||||
@@ -0,0 +1,32 @@
|
||||
---
|
||||
type: entity
|
||||
updated: 2026-07-09
|
||||
tags: [hardware]
|
||||
---
|
||||
|
||||
# Anfu Home Charger (charging pile)
|
||||
|
||||
The physical home EV charger this whole project revolves around. It is not a single device but a small network of three, behind its own Four-Faith router (see [[network-topology]]). Per [[2026-07-09-findings-and-requirements]]:
|
||||
|
||||
- **[[jc-6620|JC-6620]]** (`192.168.2.228`) — OCPP communication controller; the OCPP client that dials the CSMS
|
||||
- **EV charging controller** (`192.168.2.118`, DHCP) — the main control board that actually manages charging; the JC-6620 talks to it on port 2403
|
||||
- **Touchscreen** — where all charger-side configuration happens
|
||||
|
||||
## Touchscreen configuration (working values)
|
||||
|
||||
| Screen | Setting | Value |
|
||||
|---|---|---|
|
||||
| General Settings → Charger INEO | URL | `ws://<CSMS-IP>:9000` |
|
||||
| General Settings → Charger INEO | ChargerID | any |
|
||||
| Back Office → Universal | Billing Mode | **`BackgroundBilling`** (required — see [[troubleshooting]]) |
|
||||
| Back Office → Universal | Communication Method | `Ethernet` (not 4G/SIM) |
|
||||
| Back Office → Universal | JC-6620 IP / Port | `192.168.2.228` / `2403` |
|
||||
|
||||
> [!warning] Power-cycle required
|
||||
> URL or network changes only take effect after power-cycling the pile.
|
||||
|
||||
## Capabilities in question
|
||||
|
||||
- ✅ OCPP 1.6J over WebSocket — verified working
|
||||
- ⚠️ Autocharge (per-vehicle idTag on plug-in) — needs a physical test; see [[authorization]]
|
||||
- ❌ True ISO 15118 Plug & Charge — unlikely on a basic AC unit
|
||||
@@ -0,0 +1,25 @@
|
||||
---
|
||||
type: entity
|
||||
updated: 2026-07-09
|
||||
tags: [software, csms]
|
||||
---
|
||||
|
||||
# CSMS Toolkit (`../discovering/`)
|
||||
|
||||
The Python scripts that play the CSMS (backend) side of the [[ocpp|OCPP]] link. Currently discovery/tester-grade; `station.py` is the seed of the real controller. Per [[2026-07-09-findings-and-requirements]]:
|
||||
|
||||
| File | Purpose |
|
||||
|---|---|
|
||||
| `csms.py` | Minimal OCPP 1.6J server — accepts everything, logs raw frames. Discovery/tester. |
|
||||
| `rawlisten.py` | Dumb TCP listener on `:9000` — shows whether *any* bytes arrive. Fallback diagnostic. |
|
||||
| `station.py` | **The real controller.** Allowlist-based auth + learn mode + hooks for remote start/stop. |
|
||||
| `station_config.json` | `{ "learn_mode": bool, "authorized": { "<idTag>": {name, kind} } }` |
|
||||
| `seen_tags.json` | Auto-recorded log of every idTag observed (discovery / Autocharge testing). |
|
||||
|
||||
- **Runtime:** Python venv with `websockets` 16.0 + `ocpp`; listens on `ws://0.0.0.0:9000/<chargePointId>`.
|
||||
- **The one gate:** every [[authorization]] method funnels through `decide(id_tag)` in `station.py` — Accepted/Rejected against the allowlist.
|
||||
- **Host requirements:** inbound TCP 9000 open (Windows firewall silently drops otherwise — see [[troubleshooting]]) and a stable IP, since the [[anfu-charger|charger touchscreen]] URL is hardcoded.
|
||||
|
||||
## Still to build
|
||||
|
||||
The web control panel (remote start/stop, live status, allowlist management) served behind [[netbird|NetBird]] — see [[overview]] for the plan and open host decision.
|
||||
@@ -0,0 +1,28 @@
|
||||
---
|
||||
type: entity
|
||||
updated: 2026-07-09
|
||||
tags: [hardware, ocpp-client]
|
||||
---
|
||||
|
||||
# JC-6620 — OCPP Communication Controller
|
||||
|
||||
The dedicated OCPP communication controller inside the [[anfu-charger|Anfu charging pile]]. **This is the device that acts as the OCPP client** — it opens the outbound WebSocket to the CSMS. (Per [[2026-07-09-findings-and-requirements]].)
|
||||
|
||||
## Network identity
|
||||
|
||||
- Static IP **`192.168.2.228`**, mask `255.255.255.0`, on the charger's internal LAN (see [[network-topology]])
|
||||
- Default gateway must be **`192.168.2.1`** (the Four-Faith router)
|
||||
- DNS not needed — the CSMS URL is a bare IP
|
||||
- Talks to the EV charging controller (`192.168.2.118`) locally on port **2403**
|
||||
|
||||
## Gotchas specific to this device
|
||||
|
||||
> [!warning] Shipped misconfigured
|
||||
> The JC-6620 arrived with its default gateway set to `192.168.2.228` — **pointing at itself**. That works for a same-subnet CSMS but cannot route to the WAN, which is why a `192.168.2.x` CSMS worked while a `10.0.10.x` CSMS silently didn't, until the gateway was corrected. (Config screen is in Chinese: 静态 IP = static IP, 默认网关 = default gateway.)
|
||||
|
||||
- It only dials out at all once the touchscreen's `Billing Mode = BackgroundBilling` is set — see [[troubleshooting]].
|
||||
- Network/URL changes require a full pile power-cycle to take effect.
|
||||
|
||||
## Verified behavior ✅
|
||||
|
||||
Connected and completed the full BootNotification exchange against both a LAN CSMS (`192.168.2.114:9000`) and a WAN CSMS (`10.0.10.203:9000`). Since it's the *client*, no port-forwarding is needed on the charger router — NAT handles the outbound connection.
|
||||
@@ -0,0 +1,14 @@
|
||||
---
|
||||
type: entity
|
||||
updated: 2026-07-09
|
||||
tags: [software, network, security]
|
||||
---
|
||||
|
||||
# NetBird
|
||||
|
||||
The WireGuard-based private overlay network the household already runs. Its role in this project: **the security boundary for the web control panel** — the panel binds to `0.0.0.0` but is only reachable over the NetBird network, so nothing is exposed to the public internet. (Per [[2026-07-09-findings-and-requirements]].)
|
||||
|
||||
Related open decisions (tracked in [[overview]]):
|
||||
|
||||
- ❓ Rely on NetBird isolation alone, or add a PIN/access token to the web app for defense-in-depth?
|
||||
- ❓ If a dedicated always-on box (e.g. a Pi on the charger LAN) becomes the CSMS host, it would join NetBird to stay reachable.
|
||||
@@ -0,0 +1,35 @@
|
||||
---
|
||||
type: meta
|
||||
updated: 2026-07-09
|
||||
tags: [index]
|
||||
---
|
||||
|
||||
# Index
|
||||
|
||||
Catalog of every wiki page. Updated on every ingest. (Schema/conventions live in `CLAUDE.md`.)
|
||||
|
||||
## Synthesis
|
||||
|
||||
- [[overview]] — current project state, what's next, open decisions ❓ (2026-07-09)
|
||||
|
||||
## Entities
|
||||
|
||||
- [[anfu-charger]] — the charging pile: its three internal devices + working touchscreen config
|
||||
- [[jc-6620]] — the OCPP communication controller / client; its IPs and shipped-gateway gotcha
|
||||
- [[csms-toolkit]] — the Python CSMS scripts in `../discovering/` and what each does
|
||||
- [[netbird]] — the private overlay network; security boundary for the future web panel
|
||||
|
||||
## Concepts
|
||||
|
||||
- [[network-topology]] — charger LAN behind the Four-Faith router, NAT direction, what's verified
|
||||
- [[authorization]] — the three auth methods (RFID ✅ / Autocharge ⚠️ / web app 📋) and the `decide()` gate
|
||||
- [[troubleshooting]] — ordered "charger won't connect" checklist of hard-won gotchas
|
||||
- [[ocpp]] — OCPP 1.6J basics and how the roles/messages map to this project
|
||||
|
||||
## Notes
|
||||
|
||||
*(none yet — filed answers to questions go here)*
|
||||
|
||||
## Sources
|
||||
|
||||
- [[2026-07-09-findings-and-requirements]] — founding findings/requirements doc (ingested 2026-07-09, 1 raw file)
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
---
|
||||
type: meta
|
||||
updated: 2026-07-09
|
||||
tags: [log]
|
||||
---
|
||||
|
||||
# Log
|
||||
|
||||
Append-only, newest at the bottom. Entry format: `## [YYYY-MM-DD] ingest|query|lint|meta | Title` — so `grep "^## \[" log.md | tail -5` shows recent activity.
|
||||
|
||||
## [2026-07-09] meta | Wiki bootstrapped
|
||||
|
||||
Instantiated the LLM-wiki pattern for the charging-station project: schema (`CLAUDE.md`), `index.md`, `log.md`, and directory layout (`sources/`, `entities/`, `concepts/`, `notes/`).
|
||||
|
||||
## [2026-07-09] ingest | Findings & Requirements (founding source)
|
||||
|
||||
Ingested `raw/FINDINGS_AND_REQUIREMENTS.md` → [[2026-07-09-findings-and-requirements]]. Seeded [[overview]] plus entities ([[anfu-charger]], [[jc-6620]], [[csms-toolkit]], [[netbird]]) and concepts ([[network-topology]], [[authorization]], [[troubleshooting]], [[ocpp]]). Open decisions tracked in [[overview]].
|
||||
@@ -0,0 +1,36 @@
|
||||
---
|
||||
type: meta
|
||||
updated: 2026-07-09
|
||||
tags: [synthesis]
|
||||
---
|
||||
|
||||
# Overview — Anfu Home Charger OCPP Project
|
||||
|
||||
**Goal:** a private, self-hosted [[ocpp|OCPP 1.6J]] backend (CSMS) for a home EV charger. No billing, no public charging. Three ways to authorize a charge: existing RFID cards, by vehicle (if the hardware allows — ⚠️ untested), and a mobile-friendly web app reached over [[netbird|NetBird]].
|
||||
|
||||
## Current state (2026-07-09)
|
||||
|
||||
**Connectivity: ✅ solved.** The [[jc-6620|JC-6620]] controller inside the [[anfu-charger|charging pile]] reliably dials out to the CSMS — verified both on the charger's own LAN (`192.168.2.114:9000`) and across the NAT boundary on the WAN subnet (`10.0.10.203:9000`). Getting here required the fixes catalogued in [[troubleshooting]]; the network layout is in [[network-topology]].
|
||||
|
||||
**Software: discovery-grade.** The [[csms-toolkit]] (`../discovering/`) can accept connections, log frames, and enforce an allowlist with learn mode. It is a tester/foundation, not yet the always-on production service.
|
||||
|
||||
**Authorization: designed, partially built.** All three methods funnel through one gate — `decide(id_tag)` in `station.py`. See [[authorization]] for the plan per method.
|
||||
|
||||
## What's next
|
||||
|
||||
1. **RFID enrollment** — tap each card in learn mode, harvest idTags from `seen_tags.json`, add to the allowlist, then flip `learn_mode=false`. (Mechanism already implemented.)
|
||||
2. **Autocharge test** — ⚠️ plug the car in *without* tapping a card; if a stable idTag appears, "by vehicle" works. If not, it's off the table for this hardware. See [[authorization]].
|
||||
3. **Web control panel** — Start/Stop via OCPP `RemoteStartTransaction`/`RemoteStopTransaction`, live status, allowlist management. Served behind NetBird.
|
||||
|
||||
## Open decisions ❓
|
||||
|
||||
| Decision | Options | Status |
|
||||
|---|---|---|
|
||||
| Always-on host for CSMS + app | LAN PC · the `10.0.10.203` machine · dedicated box (e.g. Pi on charger LAN, joined to NetBird) | open |
|
||||
| Web app auth | NetBird isolation only · also PIN/token | open |
|
||||
| Autocharge | run the plug-in test or skip "by chassis" | open — needs physical test |
|
||||
| Host IP stability | static IP · DHCP reservation | open (required either way — touchscreen URL is hardcoded) |
|
||||
|
||||
## Sources
|
||||
|
||||
- [[2026-07-09-findings-and-requirements]] — the founding findings/requirements doc
|
||||
@@ -0,0 +1,106 @@
|
||||
# Anfu Home Charger — OCPP Integration: Findings & Requirements
|
||||
|
||||
_Last updated: 2026-07-09_
|
||||
|
||||
## 1. Goal
|
||||
|
||||
Run a **private, self-hosted OCPP 1.6J backend (CSMS)** for a home EV charger.
|
||||
No billing, no public charging. Authorization should be possible via:
|
||||
|
||||
1. **RFID cards** already owned (tap to charge).
|
||||
2. **By vehicle / chassis**, if the hardware supports it (see §7 — has a caveat).
|
||||
3. A **mobile / web app** (start/stop charging), hosted securely behind an existing
|
||||
**NetBird** private network.
|
||||
|
||||
## 2. Hardware & Topology
|
||||
|
||||
The charging pile contains three networked devices behind its own router:
|
||||
|
||||
```
|
||||
10.0.10.0/24 (upstream / WAN — main gateway lives here)
|
||||
│
|
||||
┌──┴───────────────┐
|
||||
│ Four-Faith router │ WAN gets a 10.0.10.x address; NAT boundary
|
||||
└──┬───────────────┘
|
||||
│ LAN = 192.168.2.1 (mask 255.255.255.0)
|
||||
├── 192.168.2.228 JC-6620 OCPP communication controller ← the OCPP client
|
||||
├── 192.168.2.118 EV charging controller (main control board), DHCP
|
||||
└── 192.168.2.114 maintenance PC (LAN side)
|
||||
```
|
||||
|
||||
- Wiring is the manufacturer's **star** topology: the EV charging controller **and** the
|
||||
JC-6620's fixed-IP (right) port each connect to a router LAN1–4 port.
|
||||
- **The JC-6620 (192.168.2.228) is the device that opens the outbound OCPP WebSocket**
|
||||
to the CSMS. It talks to the EV controller locally on port **2403**.
|
||||
|
||||
## 3. CSMS software (this repo)
|
||||
|
||||
| File | Purpose |
|
||||
|------|---------|
|
||||
| `csms.py` | Minimal OCPP 1.6J server — accepts everything, logs raw frames. Discovery/tester. |
|
||||
| `rawlisten.py` | Dumb TCP listener on :9000 — shows whether *any* bytes arrive. Fallback diagnostic. |
|
||||
| `station.py` | **The real controller.** Allowlist-based auth + "learn mode" + hooks for remote start/stop. |
|
||||
| `station_config.json` | `{ "learn_mode": bool, "authorized": { "<idTag>": {name, kind} } }` |
|
||||
| `seen_tags.json` | Auto-recorded log of every idTag observed (for discovery). |
|
||||
|
||||
Runtime: Python venv with `websockets` (16.0) + `ocpp`. Server listens on
|
||||
`ws://0.0.0.0:9000/<chargePointId>`.
|
||||
|
||||
## 4. Charger-side configuration (touchscreen)
|
||||
|
||||
- **General Settings → Charger INEO:** `URL = ws://<CSMS-IP>:9000`, `ChargerID = <any>`
|
||||
- **Back Office → Universal:** `Billing Mode = BackgroundBilling`,
|
||||
`Communication Method = Ethernet`, `JC-6620 IP = 192.168.2.228`, `Port = 2403`
|
||||
- **JC-6620 network config (静态 IP):** IP `192.168.2.228`, mask `255.255.255.0`,
|
||||
**default gateway (默认网关) `192.168.2.1`** (DNS not needed — CSMS is a bare IP).
|
||||
|
||||
## 5. Findings / gotchas (hard-won — check these first if it breaks)
|
||||
|
||||
1. **CSMS host firewall** must allow inbound **TCP 9000**. Windows silently drops
|
||||
otherwise → looks like "charger never connects."
|
||||
2. **`Billing Mode` must be `BackgroundBilling`.** Until it is, the OCPP client never
|
||||
dials out *at all* (zero TCP SYNs). This was the blocker for the first connection.
|
||||
3. **`Communication Method` must be `Ethernet`** (not 4G/SIM).
|
||||
4. **URL / network changes require a pile power-cycle** to take effect.
|
||||
5. **JC-6620 default gateway must be `192.168.2.1`.** It shipped as `192.168.2.228`
|
||||
(pointing at itself) — which reaches a *same-subnet* CSMS but **cannot route to the
|
||||
WAN**. This is why a `192.168.2.x` CSMS worked but a `10.0.10.x` CSMS did not, until
|
||||
the gateway was fixed.
|
||||
6. **No port-forwarding needed on the charger router.** The JC-6620 is the *client* and
|
||||
dials outbound; NAT handles LAN→WAN. Port-forwarding would only matter for inbound.
|
||||
7. **The CSMS host needs a stable IP.** The touchscreen URL is hardcoded, so the host
|
||||
must not change address (static IP or a DHCP reservation).
|
||||
|
||||
## 6. Verified working
|
||||
|
||||
- ✅ **Local CSMS** at `192.168.2.114:9000` — JC-6620 connected, full BootNotification
|
||||
exchange.
|
||||
- ✅ **Remote / WAN CSMS** at `10.0.10.203:9000` (on the router's WAN subnet) — connected
|
||||
after fixing the JC-6620 default gateway. Confirms the CSMS can live upstream / off-subnet.
|
||||
|
||||
## 7. Requirements to build next
|
||||
|
||||
All three authorization methods funnel through one gate in `station.py` —
|
||||
`decide(id_tag)` → Accepted/Rejected against the allowlist. So the build is:
|
||||
|
||||
- **Allowlist enforcement** — already implemented. Learn mode captures ids; flip
|
||||
`learn_mode=false` to enforce.
|
||||
- **RFID cards** — tap each card once in learn mode, harvest its idTag from
|
||||
`seen_tags.json`, add to `authorized` with a name. Works with existing cards.
|
||||
- **By vehicle / chassis** — ⚠️ **needs a physical test.** True VIN / Plug & Charge
|
||||
(ISO 15118) is unlikely on a basic AC unit. The lighter option is **Autocharge**: some
|
||||
chargers auto-send a per-vehicle idTag on plug-in (no card). Test = plug car in without
|
||||
tapping; if a stable idTag appears in `seen_tags.json`, whitelist it as `kind:"car"`.
|
||||
If nothing appears, "by chassis" is not achievable on this hardware.
|
||||
- **Mobile / web app** — a web control panel (mobile-friendly, no app store) exposing
|
||||
Start/Stop via OCPP `RemoteStartTransaction` / `RemoteStopTransaction`, plus live status
|
||||
and clickable allowlist management. Bind to `0.0.0.0`, reach it over **NetBird**.
|
||||
Optional access token/PIN for defense-in-depth.
|
||||
|
||||
## 8. Open decisions (for you)
|
||||
|
||||
- **Final host** for the always-on CSMS + app: the LAN PC, the `10.0.10.203` machine, or
|
||||
a dedicated always-on box (e.g. a Pi on the charger LAN joined to NetBird)?
|
||||
- **Web app auth:** rely on NetBird network isolation only, or also require a PIN/token?
|
||||
- **Autocharge:** do we run the plug-in test to see if "by chassis" is even possible?
|
||||
- **IP stability:** static IP vs DHCP reservation for the chosen host.
|
||||
@@ -0,0 +1,30 @@
|
||||
---
|
||||
type: source
|
||||
updated: 2026-07-09
|
||||
ingested: 2026-07-09
|
||||
raw: raw/FINDINGS_AND_REQUIREMENTS.md
|
||||
tags: [ocpp, hardware, requirements]
|
||||
---
|
||||
|
||||
# Findings & Requirements — Anfu Home Charger OCPP Integration
|
||||
|
||||
**Raw source:** [FINDINGS_AND_REQUIREMENTS.md](../raw/FINDINGS_AND_REQUIREMENTS.md) (project findings doc, last updated 2026-07-09)
|
||||
|
||||
## TL;DR
|
||||
|
||||
The goal is a private, self-hosted **OCPP 1.6J CSMS** for a home EV charger — no billing, no public charging. Authorization via existing RFID cards, possibly by vehicle (Autocharge, ⚠️ untested), and a web app reached over [[netbird|NetBird]]. Connectivity is **✅ solved**: the [[jc-6620|JC-6620]] controller inside the [[anfu-charger|charging pile]] successfully dials out to a CSMS both on the local LAN and across the NAT boundary on the WAN subnet, after several hard-won configuration fixes.
|
||||
|
||||
## Key facts
|
||||
|
||||
- **Hardware topology** — three devices behind a Four-Faith router (LAN `192.168.2.0/24`, WAN on `10.0.10.0/24`): the JC-6620 OCPP controller (`.228`), the EV charging controller (`.118`), and a maintenance PC (`.114`). Details in [[network-topology]].
|
||||
- **The JC-6620 is the OCPP client.** It opens the outbound WebSocket to the CSMS and talks to the EV controller locally on port 2403.
|
||||
- **CSMS software** is the scripts in `../discovering/` — see [[csms-toolkit]]. `station.py` is the real controller with allowlist auth + learn mode.
|
||||
- **Charger-side config** happens on the pile's touchscreen: CSMS URL, ChargerID, `Billing Mode = BackgroundBilling`, `Communication Method = Ethernet`, JC-6620 static IP with gateway `192.168.2.1`.
|
||||
- **Gotchas** (each cost real debugging time) are catalogued in [[troubleshooting]] — notably: no `BackgroundBilling` = zero TCP SYNs, and the JC-6620 shipped with its gateway pointing at itself.
|
||||
- **Verified working:** ✅ local CSMS at `192.168.2.114:9000`; ✅ WAN CSMS at `10.0.10.203:9000` after the gateway fix.
|
||||
- **Next build:** the three [[authorization]] methods, all funneling through `decide(id_tag)` in `station.py`.
|
||||
- **Open decisions** (host choice, web-app auth, Autocharge test, IP stability) tracked in [[overview]].
|
||||
|
||||
## Wiki changes from this ingest
|
||||
|
||||
First source — seeded the entire wiki: [[overview]], [[jc-6620]], [[anfu-charger]], [[csms-toolkit]], [[network-topology]], [[authorization]], [[troubleshooting]], [[ocpp]], [[netbird]].
|
||||
Reference in New Issue
Block a user