104 lines
4.1 KiB
Markdown
104 lines
4.1 KiB
Markdown
# Klubhaus Doorbell
|
|
|
|
Multi-target doorbell alert system powered by [ntfy.sh](https://ntfy.sh).
|
|
|
|
## Targets
|
|
|
|
| Board | Display | Library | Build Command |
|
|
|---|---|---|---|
|
|
| ESP32-32E | SPI TFT (ILI9341 etc.) | TFT_eSPI | `BOARD=esp32-32e mise run compile` |
|
|
| ESP32-32E-4" | SPI TFT 320x480 (ST7796) | TFT_eSPI | `BOARD=esp32-32e-4 mise run compile` |
|
|
| ESP32-S3-Touch-LCD-4.3 | 800x480 RGB parallel | LovyanGFX | `BOARD=esp32-s3-lcd-43 mise run compile` |
|
|
|
|
## 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:
|
|
|
|
BOARD=esp32-s3-lcd-43 mise run compile
|
|
BOARD=esp32-s3-lcd-43 mise run upload
|
|
|
|
BOARD=esp32-32e-4 mise run compile
|
|
BOARD=esp32-32e-4 mise run upload
|
|
|
|
BOARD=esp32-32e mise run compile
|
|
BOARD=esp32-32e mise run upload
|
|
|
|
## 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, copy from .example)
|
|
│ │ ├── tft_user_setup.h
|
|
│ │ └── DisplayDriverTFT.*
|
|
│ ├── esp32-32e-4/ ESP32-32E-4" sketch
|
|
│ │ ├── esp32-32e-4.ino
|
|
│ │ ├── board_config.h
|
|
│ │ ├── secrets.h (gitignored, copy from .example)
|
|
│ │ ├── 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, copy from .example)
|
|
│ ├── LovyanPins.h
|
|
│ └── DisplayDriverGFX.*
|
|
├── vendor/ Per-board vendored display libs
|
|
│ ├── esp32-32e/TFT_eSPI/
|
|
│ ├── esp32-32e-4/TFT_eSPI/
|
|
│ └── esp32-s3-lcd-43/LovyanGFX/
|
|
└── 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)
|