How richard297779/uestc-mooncheck works
MoonCheck is an ESP32-based nightly check-in appliance. A phone provisions Wi-Fi, credentials, browser fingerprint, location, and schedule over BLE; the firmware connects, synchronizes time, logs into CAS, warms the portal session, enters the check-in app, submits and verifies a check-in, and persists the result. The graph also preserves multi-account operation, diagnostics, notifications, and the documented PC verification path. Unsampled implementations are included where the tree and README establish capabilities; edges are limited to explicit documentation or shown wiring.
Main entry points: main.cpp Firmware startup and loop · command_router.cpp Command routing · checkin_service.cpp Session, probe, and check-in · http_client.cpp HTTP and TLS client
Components 25
Provisioning and state
- BLE provisioning
firmware/src/ble_service.cpp - Command routing
firmware/src/command_router.cpp - Persistent configuration
firmware/src/app_config.cpp - Account profiles
firmware/src/account_store.cpp
Connectivity and platform access
- Wi-Fi management
firmware/src/wifi_manager.cpp - Time service
firmware/src/time_service.cpp - CAS authentication
firmware/src/cas_auth.cpp - HTTP and TLS client
firmware/src/http_client.cpp - Cookie session jar
firmware/src/cookie_jar.cpp - Credential encryption
firmware/src/crypto_util.cpp
Check-in workflow
- Portal and check-in API
firmware/src/checkin_api.cpp - Session, probe, and check-in
firmware/src/checkin_service.cpp - Multi-account runs
firmware/src/multi_checkin.cpp
Scheduling and operations
- Nightly scheduler
firmware/src/task_scheduler.cpp - Firmware startup and loop
firmware/src/main.cpp - Phone notifications
firmware/src/notify_service.cpp - Status LED
firmware/src/status_led.cpp - Logs and diagnostics
firmware/src/logger.cpp
PC verification
- PC chain verification
tools/pc_reference/verify.py - PC CAS client
tools/pc_reference/wsc_cas.py - PC check-in client
tools/pc_reference/wsc_checkin.py - PC HTTP and cookies
tools/pc_reference/wsc_http.py
Other components
- Phone or PC operator
- School CAS and check-in platform
- NTP and notification endpoints
Connections 41
- Phone or PC operator → BLE provisioning: provisions over BLE
- BLE provisioning → Command routing: delivers commands
- Command routing → Persistent configuration: updates settings
- Command routing → Wi-Fi management: requests connection
- Command routing → Session, probe, and check-in: runs diagnostics
- Firmware startup and loop → BLE provisioning: starts
firmware/src/main.cpp - Firmware startup and loop → Wi-Fi management: initializes
firmware/src/main.cpp - Firmware startup and loop → CAS authentication: initializes
firmware/src/main.cpp - Firmware startup and loop → Portal and check-in API: initializes
firmware/src/main.cpp - Firmware startup and loop → Session, probe, and check-in: initializes
firmware/src/main.cpp - Firmware startup and loop → Account profiles: loads accounts
firmware/src/main.cpp - Firmware startup and loop → Multi-account runs: initializes
firmware/src/main.cpp - Firmware startup and loop → Phone notifications: initializes
firmware/src/main.cpp - Firmware startup and loop → Nightly scheduler: registers triggers
firmware/src/main.cpp - Firmware startup and loop → Command routing: initializes
firmware/src/main.cpp - Firmware startup and loop → Time service: initializes
- Firmware startup and loop → HTTP and TLS client: initializes
- Firmware startup and loop → Cookie session jar: attaches
firmware/src/main.cpp - Wi-Fi management → NTP and notification endpoints: connects for NTP
- Time service → NTP and notification endpoints: synchronizes time
- Nightly scheduler → Firmware startup and loop: emits triggers
firmware/src/main.cpp - Firmware startup and loop → Command routing: queues scheduled work
firmware/src/main.cpp - Session, probe, and check-in → CAS authentication: ensures session
- CAS authentication → HTTP and TLS client: sends login requests
- HTTP and TLS client → Cookie session jar: reads and updates
- CAS authentication → Credential encryption: encrypts credentials
- Session, probe, and check-in → Portal and check-in API: probes and submits
- Portal and check-in API → HTTP and TLS client: calls platform APIs
- Portal and check-in API → School CAS and check-in platform: uses portal and check-in APIs
- Multi-account runs → Session, probe, and check-in: runs per account
- Multi-account runs → Account profiles: loads profiles
- Session, probe, and check-in → Persistent configuration: persists result
- Command routing → Phone notifications: requests notification
- Phone notifications → HTTP and TLS client: sends HTTP requests
firmware/src/notify_service.cpp - Phone notifications → NTP and notification endpoints: pushes notifications
- Phone or PC operator → PC chain verification: runs verification
- PC chain verification → PC CAS client: uses
tools/pc_reference/verify.py - PC chain verification → PC check-in client: uses
tools/pc_reference/verify.py - PC chain verification → PC HTTP and cookies: uses
tools/pc_reference/verify.py - PC CAS client → PC HTTP and cookies: sends requests
- PC check-in client → PC HTTP and cookies: sends requests