ESP32-C6 support with ST7789 (Waveshare 1.47") + ESP-NOW v5 compat, optional FTP stub, and docs #21
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds first-class support for the Waveshare ESP32-C6-LCD-1.47" (ST7789 TFT, 172×320) and updates Netgotchi for ESP-IDF v5 / Arduino core v3 ESP-NOW changes—while keeping existing ESP8266/ESP32 OLED users unaffected by default.
Highlights
Motivation
This PR introduces opt-in support for those environments without disrupting existing users.
What’s in this PR
1) Display: ST7789 compatibility layer
compat/CompatST7789.himplementing the subset of Adafruit-GFX APIs Netgotchi uses:drawLine,drawCircle,drawPixel, basic text opssetTextColor(fg, bg)supported, mapping legacy0/1to BLACK/WHITE for backward compatibilityUSE_ST7789macro. If not defined, the original OLED path remains unchanged.Default Waveshare pins (1.47", 172×320):
2) Unified includes for pins / ESP-NOW / Ping
globals.hacts as the single include for files that need buttons/ESP-NOW/ping:pins_local.h(definesBTN_A/B/LEFT/RIGHT,BUZZER_PIN,EXT_PIN_16if missing)espnow.h(IDF v5 wrapper with legacy callback adapter)ESPping.h(points to ESP32Ping / ESP8266Ping)Add at the very top of each relevant
.ino:3) ESP-NOW v5 API compatibility
esp_now_set_self_role(ESP_NOW_ROLE_COMBO)is now a no-op (no longer required).void(uint8_t* mac, uint8_t* data, uint8_t len)) are adapted to the new signature internally.4) FTP: optional stub to avoid SD_MMC dependency
SD_MMC, which breaks on ESP32-C6.begin/init/handleFTP/isConnected()plusisClientConnected()alias to preserve existing code paths.USE_FTP 1and choose a backend compatible with SPIFFS/LittleFS.5) Deauther module (ESP8266-only) safely excluded on ESP32/ESP32-C6
loader.inocalls todeauthergotchi_*()do not break ESP32-C6 builds.6) Screens & Web UI “matrix”
displayInit()inscreens.ino(centralises ST7789 init in the main file).getPixelAt()returns black on ST7789 (no 1-bit framebuffer); the web “matrix” stays stable (just not populated from TFT by design).7) Minor robustness fixes
network.inoaddsextern String status;to match the global defined in the main file.isClientConnected()→ alias ofisConnected().Backward compatibility
USE_ST7789.How to build (ESP32-C6)
ESP32C6 Dev Module(ESP32 Arduino core v3.x).USE_ST7789 1and keep the Waveshare pin map (see above)..inobegins with:deauthergotchi.inoexists, guard it:USE_FTP 1and selecting a non-SD_MMC backend.Testing
Known limitations / Next steps
Documentation
License
All changes follow the project’s existing GPLv3 license.
Checklist
USE_ST7789is definedThanks for reviewing!
Happy to split this into smaller PRs (display vs ESP-NOW vs FTP) if you prefer.