Add ThermoPro BLE support and dashboard display
- Implement ThermoproBLE class for handling BLE communication with ThermoPro BBQ thermometer. - Create ThermoproReading structure to hold thermometer data. - Develop Dashboard class for displaying thermometer readings and WiFi status on a TFT display. - Configure display settings and touch input handling. - Introduce SettingsManager for managing user settings stored in NVS. - Implement WiFiManager for handling WiFi connections and captive portal setup. - Add HTML interface for user to input WiFi credentials and ThermoPro MAC address. - Ensure proper state management for WiFi and BLE connections in the main application loop.
This commit is contained in:
@@ -0,0 +1,110 @@
|
||||
# CYD ThermoPro Bridge
|
||||
|
||||
Firmware for an ESP32 "Cheap Yellow Display" (ESP32-2432S028R) that reads temperature data from a ThermoPro BLE BBQ thermometer and exposes it through a local HTTP API.
|
||||
|
||||
## Hardware
|
||||
|
||||
- **Board:** ESP32-2432S028R
|
||||
- 320×240 TFT (ILI9341 driver)
|
||||
- Resistive touch panel (XPT2046)
|
||||
- ESP32-WROOM-32 with 4 MB flash
|
||||
- **Thermometer:** ThermoPro TP25 / TP25W / TP920 / TP930 / TP960
|
||||
|
||||
## Firmware architecture
|
||||
|
||||
```
|
||||
┌─────────────────────────────────────────┐
|
||||
│ CYD (ESP32-2432S028R) │
|
||||
│ │
|
||||
│ ┌─────────────┐ ┌──────────────┐ │
|
||||
│ │ ThermoPro │ │ HTTP API │ │
|
||||
│ │ BLE client │─────▶│ Web server │ │
|
||||
│ └─────────────┘ └──────────────┘ │
|
||||
│ │ │ │
|
||||
│ ▼ ▼ │
|
||||
│ ┌──────────────────────────────────┐ │
|
||||
│ │ SettingsManager (NVS/Preferences)│ │
|
||||
│ └──────────────────────────────────┘ │
|
||||
│ │
|
||||
│ ┌──────────────────────────────────┐ │
|
||||
│ │ Touch UI: status + setup screens │ │
|
||||
│ └──────────────────────────────────┘ │
|
||||
└─────────────────────────────────────────┘
|
||||
```
|
||||
|
||||
## API endpoints
|
||||
|
||||
- `GET /api/health` — device health and connectivity status.
|
||||
- `GET /api/latest` — latest ThermoPro reading.
|
||||
- `GET /api/settings` — current settings (excluding WiFi password).
|
||||
- `POST /api/settings` — update settings (JSON body).
|
||||
- `GET /` — setup page when in AP mode; status page when in STA mode.
|
||||
|
||||
## Endpoints response examples
|
||||
|
||||
### `GET /api/latest`
|
||||
|
||||
```json
|
||||
{
|
||||
"ok": true,
|
||||
"deviceId": "cyd-smoker",
|
||||
"device": "ThermoPro TP930",
|
||||
"mac": "C9:48:1D:B1:E1:E7",
|
||||
"connected": true,
|
||||
"battery": 90,
|
||||
"unit": "F",
|
||||
"probeCount": 4,
|
||||
"probes": [
|
||||
{ "id": 1, "name": "Brisket", "temperature": 266.2, "connected": true },
|
||||
{ "id": 2, "name": "Ambient", "temperature": 235.5, "connected": true },
|
||||
{ "id": 3, "name": "Probe 3", "temperature": null, "connected": false },
|
||||
{ "id": 4, "name": "Probe 4", "temperature": null, "connected": false }
|
||||
],
|
||||
"readingTime": "2026-07-19T12:00:00+00:00",
|
||||
"bridgeTime": "2026-07-19T12:00:01+00:00"
|
||||
}
|
||||
```
|
||||
|
||||
## Setup workflow
|
||||
|
||||
1. **First boot:** the CYD starts a captive portal AP named `CYD-ThermoPro-Setup`.
|
||||
2. Connect to the AP with a phone or laptop and open `http://192.168.4.1`.
|
||||
3. Enter your home WiFi SSID and password, plus the ThermoPro MAC address.
|
||||
4. The device connects to WiFi, stores the credentials, and reboots into normal mode.
|
||||
|
||||
Runtime settings (endpoint, token, probe names, units, polling interval) can be changed through the same web UI at the device's local IP or via the JSON API.
|
||||
|
||||
## Building and flashing
|
||||
|
||||
Requires [PlatformIO](https://platformio.org/) installed locally (not available in this cloud environment).
|
||||
|
||||
```bash
|
||||
cd cyd-bridge
|
||||
# Compile only
|
||||
pio run
|
||||
# Compile and upload to the CYD
|
||||
pio run -t upload
|
||||
# View serial output
|
||||
pio device monitor
|
||||
```
|
||||
|
||||
If you have not installed PlatformIO yet:
|
||||
|
||||
```bash
|
||||
pip install platformio
|
||||
```
|
||||
|
||||
## First-time hardware check
|
||||
|
||||
Before relying on the dashboard, verify the pinout matches your exact board revision:
|
||||
|
||||
1. Open `src/display/DisplayConfig.hpp`.
|
||||
2. Confirm `TFT_CS`, `TFT_DC`, `TFT_RST`, `TFT_BL`, `TOUCH_CS`, and the SPI pins match the silkscreen or schematic of your ESP32-2432S028R.
|
||||
3. If the screen stays white or touch is inverted, adjust `cfg.offset_rotation` in `DisplayConfig.hpp` or `setRotation()` in `Dashboard::begin()`.
|
||||
|
||||
## Development notes
|
||||
|
||||
- LovyanGFX driver/pin configuration lives in `src/display/DisplayConfig.hpp` and is tuned for the ESP32-2432S028R variant.
|
||||
- BLE uses `NimBLE-Arduino` to leave enough RAM for the web server and UI.
|
||||
- All user settings are stored in ESP32 NVS via `Preferences`.
|
||||
- The firmware has not yet been compiled in this environment due to missing PlatformIO tooling; it should be built locally on your development machine before flashing.
|
||||
Reference in New Issue
Block a user