Add Serial Terminal App & WebUi Theme

This commit is contained in:
dark98
2026-09-24 22:34:33 +01:00
parent dc3b72bdbd
commit 4bf31f908a
17 changed files with 1040 additions and 234 deletions
+20 -2
View File
@@ -9,6 +9,7 @@ A modular embedded micro-OS for the ABrobot ESP32-C3 board with a 0.42" monochro
- OLED-based app launcher and system UI
- Single-button input handling with click, double-click, hold, and home gestures
- USB serial/JTAG CLI for runtime system control
- Hardware UART Serial Console bridge (TX: GPIO 21, RX: GPIO 20) with Web Terminal UI at `/serial`
- Wi‑Fi station mode with automatic fallback to SoftAP provisioning
- Wi‑Fi network scanning from the setup page
- Persistent NVS Wi‑Fi credentials
@@ -24,7 +25,7 @@ d:/Projects/ESP32C3/OS/
├── components/
│ ├── sys_app/ # App lifecycle and app registry
│ ├── sys_cli/ # USB serial / JTAG shell commands
│ ├── sys_core/ # Global status and event plumbing
│ ├── sys_core/ # Global status, event plumbing & sys_uart driver
│ ├── sys_gfx/ # OLED display, fonts, UI compositor, widgets
│ ├── sys_input/ # Button input handling and gestures
│ ├── sys_wifi/ # Wi‑Fi initialization, station/AP logic, NVS credentials
@@ -34,7 +35,8 @@ d:/Projects/ESP32C3/OS/
│ │ └── web_server_pages.h
│ ├── pages/
│ │ ├── wifi.c # Root configuration and /scan /configure handlers
│ │ └── ota.c # /ota firmware upload page and OTA logic
│ │ ├── ota.c # /ota firmware upload page and OTA logic
│ │ └── serial.c # /serial Web Serial Terminal and /serial/data REST API
│ └── web_server.c # Starts the HTTP server and registers pages
├── main/
│ ├── apps/
@@ -42,6 +44,7 @@ d:/Projects/ESP32C3/OS/
│ │ ├── app_game.c
│ │ ├── app_settings.c
│ │ ├── app_sysmon.c
│ │ ├── app_serial.c
│ │ └── apps.h
│ ├── CMakeLists.txt
│ ├── font_5x7.h
@@ -98,6 +101,20 @@ The web server is also started while the board is connected to Wi‑Fi so the sa
- `/scan` — JSON network scan results
- `/configure` — save station credentials and connect
- `/ota` — OTA upload page and firmware update endpoint
- `/serial` — Web Serial Terminal interface
- `/serial/data` — Real-time streaming JSON endpoint for RX/TX delta bytes
- `/serial/tx` — POST endpoint to transmit text or bytes over UART TX (GPIO 21)
- `/serial/baud` — POST endpoint to dynamically change UART baud rate
- `/serial/clear` — POST endpoint to clear the RX ring buffer
---
## Web Serial Terminal
Connect over Wi-Fi and open `http://192.168.4.1/serial` (in SoftAP mode) or `http://<board-ip>/serial` (in station mode) to access the interactive web-based serial console:
- **Pins**: TX on `GPIO 21`, RX on `GPIO 20`
- **Features**: Live streaming terminal, color-coded RX/TX logs, auto-scroll toggle, command history (Up/Down arrow navigation), dynamic baud rate switching (9600 to 921600), macro shortcuts (`PING`, `AT`, `HELP`, etc.), and log file exporting.
---
@@ -169,6 +186,7 @@ esp32c3-os> help
free Display system heap and RAM status
app App management (list, launch <id>, home)
input Simulate button input (click, double, long, home)
uart Hardware UART control (send, baud, stats, clear)
contrast Set OLED contrast (0-255)
reboot Reboot the MCU
```