How lilicqyu-ship-it/esp32c6_car works
c6_car is ESP32-C6 network-coprocessor firmware for SmartDrive: it provides a softAP control surface and relays commands, telemetry, and TC275 firmware updates over SPI. The main workflow is client → HTTP/WebSocket and pairing → bridge → LINK/SF transport → TC275; self-firmware OTA is a separate web-triggered path. The README documents the main subsystem boundaries and optional BLE/TCP features; source excerpts and index references support several internal calls. HTTP routing and some subsystem wiring are unsampled, so uncertain links are omitted.
Main entry points: http_server.c HTTP and WS · link.c SPI LINK · app_main.c Startup and State · bridge.c Command and OTA Bridge
Components 22
Client Surface
- Control UI
assets_src/app.js - HTTP and WS
components/c6_http/http_server.c - Assets Service
components/c6_http/assets_store.c - WS Sessions
components/c6_http/ws_sessions.c
Sessions and Control
- Pairing and Tokens
components/c6_pair/pair.c - Command and OTA Bridge
components/c6_bridge/bridge.c
Board Transport
- Protocol v2 Codec
components/c6_proto/proto_frames.c - SPI LINK
components/c6_link/link.c - SF Frame Codec
components/c6_sf/sf_frame.c - Legacy TCP Bridge
components/c6_legacy/legacy_tcp.c
Device Services
- SoftAP and Discovery
components/c6_net/net.c - Factory NVS
components/c6_factory/factory.c - Startup and State
main/app_main.c - Diagnostics
main/app_state.c - ADXL345 Sensor
components/c6_adxl345/adxl345.c - Maintenance BLE
components/c6_maint/maint_ble.c
Firmware Updates
- C6 A/B OTA
components/c6_ota/ota_self.c - Bundle Parser
components/c6_ota/bundle.c - Ed25519 Verification
components/c6_ota/ed25519v.c
Other components
- Phone Browser
- S3 Remote
- TC275 Controller
Connections 29
- Phone Browser → Control UI: uses
README.md - S3 Remote → HTTP and WS: connects
README.md - Control UI → HTTP and WS: sends control
README.md - HTTP and WS → Assets Service: serves assets
- HTTP and WS → WS Sessions: tracks sessions
- HTTP and WS → Pairing and Tokens: requests pairing
- HTTP and WS → C6 A/B OTA: routes OTA
- Pairing and Tokens → Factory NVS: persists grace
components/c6_pair/pair.c - Pairing and Tokens → Protocol v2 Codec: frames requests
components/c6_pair/pair.c - Command and OTA Bridge → SPI LINK: sends and receives
components/c6_bridge/bridge.c - Command and OTA Bridge → Pairing and Tokens: routes pair frames
components/c6_bridge/bridge.c - Command and OTA Bridge → HTTP and WS: broadcasts frames
components/c6_bridge/bridge.c - SPI LINK → SF Frame Codec: encodes segments
components/c6_link/link.c - SPI LINK → Protocol v2 Codec: maps frames
components/c6_link/link.c - TC275 Controller → SPI LINK: exchanges SPI
README.md - Startup and State → SoftAP and Discovery: starts
README.md - Startup and State → Factory NVS: initializes
README.md - Startup and State → SPI LINK: initializes
README.md - Startup and State → Command and OTA Bridge: starts
README.md - Startup and State → HTTP and WS: starts
README.md - Startup and State → Pairing and Tokens: initializes
README.md - Startup and State → ADXL345 Sensor: starts
main/app_main.c - Diagnostics → SPI LINK: reads health
main/app_state.c - Diagnostics → ADXL345 Sensor: renders readings
main/app_state.c - C6 A/B OTA → Bundle Parser: parses bundle
components/c6_ota/ota_self.c - Bundle Parser → Ed25519 Verification: verifies signature
- Command and OTA Bridge → TC275 Controller: relays firmware
README.md - Maintenance BLE → SPI LINK: uses LINK
components/c6_maint/maint_ble.c - Legacy TCP Bridge → SPI LINK: forwards traffic
components/c6_legacy/legacy_tcp.c