Update README: uploadfs, factory reset table, HTTP API, logo, reset button
This commit is contained in:
@@ -26,33 +26,67 @@ If your dial's contact is normally closed instead, change the interrupt trigger
|
|||||||
## Building and flashing
|
## Building and flashing
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Build (S3 DevKit)
|
# Build
|
||||||
pio run -e esp32-s3-devkitc-1
|
pio run -e esp32dev
|
||||||
|
|
||||||
# Flash
|
# Flash firmware
|
||||||
pio run -e esp32-s3-devkitc-1 --target upload
|
pio run -e esp32dev --target upload
|
||||||
|
|
||||||
|
# Upload filesystem image (logo, etc.) — only needed when data/ changes
|
||||||
|
pio run -e esp32dev --target uploadfs
|
||||||
|
|
||||||
# Serial monitor (115 200 baud)
|
# Serial monitor (115 200 baud)
|
||||||
pio device monitor
|
pio device monitor
|
||||||
```
|
```
|
||||||
|
|
||||||
|
> **Note:** close the serial monitor before uploading — it holds the serial port exclusively.
|
||||||
|
|
||||||
|
Board targets: `esp32dev`, `esp32-s3-devkitc-1`
|
||||||
|
|
||||||
## First-time Wi-Fi setup
|
## First-time Wi-Fi setup
|
||||||
|
|
||||||
On first boot the device opens an access point named **Rotary-Dial**. Connect with any phone or laptop; a captive portal will appear.
|
On first boot the device opens an access point named **Rotary-Dial**. Connect with any phone or laptop; a captive portal will appear.
|
||||||
|
|
||||||
1. Enter your Wi-Fi credentials.
|
1. Enter your Wi-Fi credentials.
|
||||||
2. Optionally set the **Device hostname** (default: `rotary-dial`).
|
2. Optionally set the **Device hostname** (default: `rotary-dial`, max 63 characters).
|
||||||
3. Save. The device joins your network and restarts.
|
3. Save. The device joins your network and restarts.
|
||||||
|
|
||||||
Reachable at `http://rotary-dial.local` or the IP shown in the serial monitor.
|
Reachable at `http://rotary-dial.local` or the IP shown in the serial monitor.
|
||||||
|
|
||||||
### Factory reset
|
### Factory reset
|
||||||
|
|
||||||
Power-cycle or press EN **5 times in quick succession** (before boot completes). All settings are cleared and the device restarts into the Wi-Fi portal.
|
Power-cycle (or press EN) rapidly before the 3-second boot window expires. The reset counter accumulates across rapid reboots:
|
||||||
|
|
||||||
|
| Cycles | Effect |
|
||||||
|
|--------|--------|
|
||||||
|
| 5 – 9 | Clears hostname, auth, and MQTT config; restarts into normal Wi-Fi |
|
||||||
|
| 10+ | Clears all of the above **plus** stored Wi-Fi credentials; restarts into captive portal |
|
||||||
|
|
||||||
|
Serial output shows the accumulated count:
|
||||||
|
|
||||||
|
```
|
||||||
|
[BOOT] reset count 3
|
||||||
|
[BOOT] reset count 4
|
||||||
|
...
|
||||||
|
[BOOT] reset count 5, triggering factory reset
|
||||||
|
[BOOT] factory reset triggered (clearWifi=0)!
|
||||||
|
[BOOT] factory reset complete, restarting...
|
||||||
|
```
|
||||||
|
|
||||||
## Web UI
|
## Web UI
|
||||||
|
|
||||||
Browse to the device address to configure hostname, authentication, and MQTT.
|
Browse to the device address to configure hostname, authentication, and MQTT. The logo in the header is served from `data/logo.png` in the filesystem image.
|
||||||
|
|
||||||
|
Click **Save** to persist settings. Changing the hostname automatically restarts the device. Click **Reset Device** to restart immediately.
|
||||||
|
|
||||||
|
## HTTP API
|
||||||
|
|
||||||
|
| Method | Path | Description |
|
||||||
|
|--------|------|-------------|
|
||||||
|
| `GET` | `/` | HTML configuration page |
|
||||||
|
| `GET` | `/logo.png` | Logo image served from LittleFS |
|
||||||
|
| `POST` | `/config` | Save configuration; redirects to `/`. Restarts if hostname changed |
|
||||||
|
| `POST` | `/reset` | Restart the device immediately |
|
||||||
|
|
||||||
## MQTT
|
## MQTT
|
||||||
|
|
||||||
@@ -67,7 +101,7 @@ Default prefix: `dial`
|
|||||||
|
|
||||||
### Home Assistant
|
### Home Assistant
|
||||||
|
|
||||||
On MQTT connect the device publishes a discovery payload so HA automatically creates a **sensor** entity (`sensor.<hostname>_dialed_number`) that shows the last dialled number.
|
On MQTT connect the device publishes a discovery payload so HA automatically creates a **sensor** entity that shows the last dialled number.
|
||||||
|
|
||||||
Example automation:
|
Example automation:
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user