consolidate sketches
This commit is contained in:
91
README.md
Normal file
91
README.md
Normal file
@@ -0,0 +1,91 @@
|
||||
# Klubhaus Doorbell
|
||||
|
||||
Multi-target doorbell alert system powered by [ntfy.sh](https://ntfy.sh).
|
||||
|
||||
## Targets
|
||||
|
||||
| Board | Display | Library | Build Task |
|
||||
|---|---|---|---|
|
||||
| ESP32-32E | SPI TFT (ILI9341 etc.) | TFT_eSPI | `mise run compile-32e` |
|
||||
| ESP32-S3-Touch-LCD-4.3 | 800x480 RGB parallel | Arduino_GFX | `mise run compile-s3-43` |
|
||||
|
||||
## Quick Start
|
||||
|
||||
1. Install prerequisites: arduino-cli (with esp32:esp32 platform) and mise.
|
||||
|
||||
2. Edit WiFi credentials:
|
||||
|
||||
cp boards/esp32-32e/secrets.h.example boards/esp32-32e/secrets.h
|
||||
cp boards/esp32-s3-lcd-43/secrets.h.example boards/esp32-s3-lcd-43/secrets.h
|
||||
|
||||
Then edit both secrets.h files with your WiFi SSIDs and passwords.
|
||||
|
||||
3. Build and upload:
|
||||
|
||||
mise run compile-s3-43
|
||||
mise run upload-s3-43
|
||||
|
||||
mise run compile-32e
|
||||
mise run upload-32e
|
||||
|
||||
## Project Structure
|
||||
|
||||
.
|
||||
├── libraries/
|
||||
│ └── KlubhausCore/ Shared Arduino library
|
||||
│ └── src/
|
||||
│ ├── KlubhausCore.h Umbrella include
|
||||
│ ├── Config.h Shared constants
|
||||
│ ├── ScreenState.h State enums / structs
|
||||
│ ├── IDisplayDriver.h Abstract display interface
|
||||
│ ├── DisplayManager.h Thin delegation wrapper
|
||||
│ ├── NetManager.* WiFi, NTP, HTTP
|
||||
│ └── DoorbellLogic.* State machine, ntfy polling
|
||||
├── boards/
|
||||
│ ├── esp32-32e/ ESP32-32E sketch
|
||||
│ │ ├── esp32-32e.ino
|
||||
│ │ ├── board_config.h
|
||||
│ │ ├── secrets.h (gitignored)
|
||||
│ │ ├── tft_user_setup.h
|
||||
│ │ └── DisplayDriverTFT.*
|
||||
│ └── esp32-s3-lcd-43/ ESP32-S3-LCD-4.3 sketch
|
||||
│ ├── esp32-s3-lcd-43.ino
|
||||
│ ├── board_config.h
|
||||
│ ├── secrets.h (gitignored)
|
||||
│ └── DisplayDriverGFX.*
|
||||
├── vendor/ Per-board vendored display libs
|
||||
│ ├── esp32-32e/TFT_eSPI/
|
||||
│ └── esp32-s3-lcd-43/GFX_Library_for_Arduino/
|
||||
└── mise.toml Build harness
|
||||
|
||||
## Serial Commands
|
||||
|
||||
Type into the serial monitor at 115200 baud:
|
||||
|
||||
| Command | Action |
|
||||
|---|---|
|
||||
| alert | Trigger a test alert |
|
||||
| silence | Silence current alert |
|
||||
| dashboard | Show dashboard screen |
|
||||
| off | Turn off display |
|
||||
| status | Print state + memory info |
|
||||
| reboot | Restart device |
|
||||
|
||||
## Architecture
|
||||
|
||||
Each board target gets its own sketch directory with a concrete IDisplayDriver
|
||||
implementation. The shared KlubhausCore library contains all business logic,
|
||||
networking, and the abstract interface. Arduino CLI's --libraries flag ensures
|
||||
each board only links its own vendored display library -- no preprocessor conflicts.
|
||||
|
||||
Board sketch (.ino)
|
||||
|
|
||||
+-- #include <KlubhausCore.h> (shared library)
|
||||
| +-- DoorbellLogic (state machine + ntfy polling)
|
||||
| +-- NetManager (WiFi, HTTP, NTP)
|
||||
| +-- DisplayManager (delegates to IDisplayDriver)
|
||||
| +-- IDisplayDriver (pure virtual interface)
|
||||
|
|
||||
+-- DisplayDriverXxx (board-specific, concrete driver)
|
||||
+-- links against vendored display lib
|
||||
(TFT_eSPI or Arduino_GFX, never both)
|
||||
Reference in New Issue
Block a user