Move the Nano link to Serial2, update READMEs

- ESP32 talks to the Nano on UART2 (GPIO 17 TX / GPIO 16 RX); Serial (USB)
  is now free for debug output and boot messages no longer reach the Nano
- README: wiring table, actual schedule (clock from 08:00), TODO section
  for the rewiring

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
mangavalkandClaude Opus 5.5 committed 2026-10-13 00:16:24 +02:00
1 parent c67a90ba09
commit 75f677a2eb
6 files changed
+58 -29

No files matched your search

+33 -8
View File
@@ -68,21 +68,34 @@ pio device monitor -e nano # serial monitor
In VS Code you can also pick the environment in the PlatformIO status bar.
> **Tip:** The Nano and the ESP32 share a serial line. Disconnect the ESP32 TX → Nano RX
> wire before you flash the Nano over USB, or the upload may fail.
> **Tip:** The ESP32 → Nano wire goes to the Nano's RX pin, which the Nano's USB chip
> also uses. Disconnect that wire before you flash the Nano over USB, or the upload may
> fail.
## Wiring between ESP32 and Nano
The ESP32 talks to the Nano on **UART2** (`Serial2`, 115200 baud). The ESP32's own
`Serial` (UART0, USB) is free for debug output.
| ESP32 | Nano | Notes |
|-------|------|-------|
| GPIO 17 (TX2) | D0 (RX) | Display commands |
| GPIO 16 (RX2) | D1 (TX) | `READY` and `ERR` replies. Use a 5 V → 3.3 V voltage divider (e.g. 1 kΩ / 2 kΩ), because the ESP32 is not 5 V tolerant. Optional: without it, the ESP waits a fixed 3 s after power-on. |
| GND | GND | Common ground |
| GPIO 13 | Relay input | Relay powers the panels and the Nano (`LOW` = on) |
## How it works
1. **ESP32 boot.** The ESP32 connects to WiFi and starts ArduinoOTA. After a crash or
unexpected reset it stays in an *OTA panic window* for 15 seconds, so you can flash a
fix before the main code runs again. It then switches the display relay on, starts NTP
and connects to MQTT.
fix before the main code runs again. It then switches the display relay on, waits for
the Nano's `READY` message (at most 3 s), starts NTP and connects to MQTT.
2. **Clock loop (every second).**
- **07:00–22:00:** Pikachu with a thought bubble showing `HH:MM`. A yawning Pikachu is
- **08:00–22:00:** Pikachu with a thought bubble showing `HH:MM`. A yawning Pikachu is
shown from 17:00.
- **22:00–23:30:** the clock is only drawn on the quarter hour. In between, the relay
turns the display off.
- **Night:** the screen is cleared and power is cut after 30 seconds.
- **22:00–23:30:** the clock is only shown during the minutes :00, :15, :30 and :45.
30 seconds after each of those minutes, the relay turns the display off.
- **23:31–08:00:** the screen is cleared and power is cut after 30 seconds.
3. **Home Assistant switches** (MQTT discovery):
- `FlipDot Display Clock`: off shows a Nintendo logo instead of the clock.
- `FlipDot Display Power`: off clears the display and cuts power through the relay.
@@ -91,3 +104,15 @@ In VS Code you can also pick the environment in the PlatformIO status bar.
to fix dots that did not flip.
The serial protocol is described in [src/nano/README.md](src/nano/README.md).
## TODO
- [ ] **Rewire the Nano link to UART2.** The firmware now uses `Serial2` (GPIO 16/17)
instead of `Serial` (GPIO 1/3). Move the ESP32 TX wire from GPIO 1 to **GPIO 17** before
you flash this firmware, or the display gets no data. See
[Wiring between ESP32 and Nano](#wiring-between-esp32-and-nano).
- [ ] **Add the reply wire:** Nano D1 (TX) → voltage divider → ESP32 GPIO 16 (RX2). With it,
the ESP sends the first frame as soon as the Nano is ready, instead of after 3 s.
- [ ] **Check the boot timing.** Build the Nano with `MEASURE_REFRESH` to see how long a
full redraw takes. If the reply wire isn't fitted, check that 3 s
(`NANO_BOOT_TIMEOUT`) is enough for the Nano to boot.