Public Access
Structure (src/esp32/): - logic/: DisplayController, schedule, power timer, LED pattern; pure C++ - display/: FlipdotFrames and bitmaps - nano_link/: NanoLink (relay, serial, READY, bootloader) and flash bridge - net/: WiFi/OTA/panic window, Home Assistant - config.h with all settings; libs.h (globals in a header) removed Bug fixes: - Home Assistant switches now report their state back and start as ON - loop() no longer blocks: WiFi.waitForConnectResult() (up to 60 s without WiFi) and getLocalTime() (5 s before NTP sync) were called every iteration - Power switch off now powers off after 1 s even when a 30 s countdown is already running - millis() overflow safe power-off timer; no frame catch-up bursts - No garbage time string before NTP sync; 'Connecting...' stays instead - Frames are only sent when the screen changes instead of every second - Reset reasons are logged once instead of every 100 ms - Removed dead code (unused fonts, WiFiMulti, rotated bitmap, ...) Tests: new test_esp32 environment (26 tests); native renamed to test_nano Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
102 lines
3.5 KiB
INI
102 lines
3.5 KiB
INI
; Flipdot display - one PlatformIO project, two firmware targets.
|
|
;
|
|
; nano Arduino Nano that drives the Brose flipdot panels directly (USB upload)
|
|
; nano_ota Same Nano firmware, flashed over WiFi through the ESP32
|
|
; esp32 ESP32 "brain" (WiFi, NTP clock, Home Assistant) - OTA upload
|
|
; esp32_usb Same ESP32 firmware, flashed over USB (first flash / recovery)
|
|
; test_nano Unit tests for the Nano firmware, run on the PC (needs gcc on PATH)
|
|
; test_esp32 Unit tests for the ESP32 logic, run on the PC
|
|
;
|
|
; Build all: pio run
|
|
; Build one: pio run -e nano
|
|
; Upload one: pio run -e nano -t upload
|
|
; Serial monitor: pio device monitor -e nano
|
|
; Run tests: pio test -e test_nano -e test_esp32
|
|
;
|
|
; https://docs.platformio.org/page/projectconf.html
|
|
|
|
[platformio]
|
|
default_envs = nano, esp32
|
|
|
|
[env]
|
|
framework = arduino
|
|
monitor_speed = 115200
|
|
lib_deps =
|
|
adafruit/Adafruit GFX Library@^1.10.12
|
|
; Tests only run in the test_* environments on the PC, never on the boards
|
|
test_ignore = *
|
|
|
|
; ---------------------------------------------------------------------------
|
|
; Arduino Nano - display driver
|
|
; ---------------------------------------------------------------------------
|
|
[env:nano]
|
|
platform = atmelavr
|
|
board = nanoatmega328
|
|
board_build.mcu = atmega328p
|
|
board_build.f_cpu = 16000000L
|
|
build_src_filter = +<nano/>
|
|
; Uncomment when using the PLCC adapter board (different pinout, see lib/BROSE9323/BROSE9323.h)
|
|
; build_flags = -D FLIPDOT_PLCC_ADAPTER
|
|
upload_port = COM10
|
|
monitor_port = COM10
|
|
|
|
; Same Nano firmware, flashed over WiFi through the ESP32 (see README.md).
|
|
; Needs the Nano TX -> ESP32 GPIO 16 wire. upload_port = ESP32 IP[:port], default port 2323.
|
|
; --baud: bootloader baud rate. auto tries 57600 (old bootloader), then 115200 (Optiboot).
|
|
[env:nano_ota]
|
|
extends = env:nano
|
|
upload_protocol = custom
|
|
upload_port = 10.1.1.198
|
|
upload_flags = --baud=auto
|
|
upload_command = "$PYTHONEXE" "$PROJECT_DIR/tools/nano_net_upload.py" "$SOURCE" $UPLOAD_PORT $UPLOAD_FLAGS
|
|
|
|
; ---------------------------------------------------------------------------
|
|
; ESP32 - controller, talks to the Nano over serial
|
|
; ---------------------------------------------------------------------------
|
|
[env:esp32]
|
|
platform = espressif32
|
|
board = esp32doit-devkit-v1
|
|
build_src_filter = +<esp32/>
|
|
; ESPSERIAL turns the BROSE9323 driver into a serial client: every draw call is
|
|
; sent to the Nano as a text command instead of toggling GPIO pins.
|
|
build_flags = -D ESPSERIAL -I src/esp32
|
|
lib_deps =
|
|
${env.lib_deps}
|
|
https://github.com/robjen/GFX_fonts.git
|
|
dawidchyrzynski/home-assistant-integration@^2.1.0
|
|
knolleary/PubSubClient@^2.8.0
|
|
upload_protocol = espota
|
|
upload_port = 10.1.1.198
|
|
monitor_port = COM11
|
|
|
|
[env:esp32_usb]
|
|
extends = env:esp32
|
|
upload_protocol = esptool
|
|
upload_port = COM11
|
|
|
|
; ---------------------------------------------------------------------------
|
|
; Unit tests on the PC (pio test -e test_nano -e test_esp32)
|
|
; ---------------------------------------------------------------------------
|
|
[native]
|
|
platform = native
|
|
framework =
|
|
lib_deps =
|
|
lib_ignore = BROSE9323
|
|
test_ignore =
|
|
test_build_src = yes
|
|
|
|
; Nano firmware (test/test_nano). The Arduino core, EEPROM and the display driver are
|
|
; replaced by test/mocks.
|
|
[env:test_nano]
|
|
extends = native
|
|
test_filter = test_nano
|
|
build_src_filter = +<nano/>
|
|
build_flags = -std=gnu++17 -I test/mocks
|
|
|
|
; ESP32 logic (test/test_esp32): only the modules without Arduino dependencies
|
|
[env:test_esp32]
|
|
extends = native
|
|
test_filter = test_esp32
|
|
build_src_filter = +<esp32/logic/>
|
|
build_flags = -std=gnu++17 -I src/esp32
|