SquaredCoso è un firmware per ESP32-S3 progettato per il pannello RGB 480×480 ST7701 (Panel-4848S040). Trasforma il display in una bacheca informativa autonoma, con pagine modulari che si alternano automaticamente e che sono completamente configurabili tramite interfaccia web.
Il dispositivo può mostrare:
- Meteo e previsioni
- Qualità dell'aria
- Orologio digitale
- Orologio binario
- Visualizzazioni temporali avanzate (Chronos)
- Calendario ICS
- Grafico temperatura 7 giorni
- Ore di luce, twilight, UV e fase lunare
- Bitcoin e variazione giornaliera
- Cambi valutari
- Countdown multipli
- Note veloci in stile post-it
- News RSS
- Frase del giorno (OpenAI o ZenQuotes)
- Stato Home Assistant
- Vista sistema solare
- Informazioni di sistema
Ogni pagina è indipendente, ottimizzata per memoria e velocità, e può essere attivata o disattivata tramite WebUI o direttamente dal touch screen.
Il firmware è progettato per il pannello ESP32-S3 Panel-4848S040:
- Display IPS 480×480
- Controller ST7701 (RGB parallelo)
- Touch GT911
- microSD via bus FSPI
Repository hardware collegato: https://github.com/davidegat/ESP32-4848S040-Fun
| Funzione | Pin |
|---|---|
| Touch I²C | SDA 19 — SCL 45 |
| Backlight PWM | 38 |
| ST7701 (SWSPI init) | CS 39 — SCK 48 — MOSI 47 |
| RGB Timing | DE 18 — VSYNC 17 — HSYNC 16 — PCLK 21 |
| R | 11, 12, 13, 14, 0 |
| G | 8, 20, 3, 46, 9, 10 |
| B | 4, 5, 6, 7, 15 |
| SD FSPI | CS 42 — MOSI 47 — MISO 41 — SCK 48 |
- ESP32 package 2.0.16 / 2.0.17
- PSRAM abilitata (OPI)
- Partition scheme: Huge APP (3MB No OTA)
- Librerie richieste: Arduino_GFX_Library ≥1.6.0, TAMC_GT911, WiFi, WebServer, DNSServer, HTTPClient, Preferences
Alla prima accensione, il dispositivo attiva una rete Wi-Fi personale (modalità AP). Chi si collega viene reindirizzato al captive portal, utile esclusivamente per configurare la rete Wi-Fi domestica.
Dopo la configurazione, il dispositivo passa in modalità STA e diventa raggiungibile tramite il proprio indirizzo IP. Da qui è disponibile la WebUI completa, che permette di impostare:
- Città e lingua
- Coordinate o geocoding automatico
- Intervallo di rotazione delle pagine
- Feed ICS
- Feed RSS
- Countdown
- Impostazioni FX e BTC
- Chiave OpenAI e argomento frase del giorno
- Testo e colore per i post-it
- IP/token Home Assistant
- Pagine da visualizzare e parametri grafici
Le impostazioni vengono salvate in NVS e persistono ai riavvii.
Il firmware gestisce in autonomia:
- sincronizzazione NTP
- recupero dati dalle API con sanitizzazione testuale e helper JSON condivisi
- aggiornamento contenuti con controllo di stato e splash di versione all'avvio
- riconnessioni Wi-Fi
- transizioni grafiche e backlight PWM
Il dispositivo integra un menu touch che permette di gestire le pagine attive direttamente dallo schermo, senza dover accedere alla WebUI.
Tocca un punto qualsiasi dello schermo durante la visualizzazione normale. Si aprirà un overlay a tutto schermo con tema scuro.
- Header: mostra il titolo "Gestione Pagine", il contatore delle pagine attive (es. "12/17 attive") e l'indicatore di pagina corrente del menu (es. "1/3").
- Griglia pulsanti: ogni pagina del firmware è rappresentata da un pulsante. Un indicatore circolare mostra lo stato: pieno e colorato se la pagina è attiva, vuoto se disattivata.
- Paginazione: se le pagine sono più di 8, il menu si divide in più schermate. Le frecce laterali in basso permettono di navigare tra le pagine del menu.
- Pulsanti azione: in basso al centro ci sono due pulsanti:
- ANNULLA — chiude il menu senza salvare
- OK — salva le modifiche in NVS e riavvia il dispositivo
Tocca un pulsante per attivare o disattivare la relativa pagina. Il contatore nell'header si aggiorna in tempo reale. Le etichette dei pulsanti cambiano automaticamente in base alla lingua configurata (italiano o inglese).
Il touch screen utilizza il controller GT911 su bus I²C (SDA 19, SCL 45). Il debounce è impostato a 200 ms per evitare tocchi multipli accidentali. Le coordinate vengono rimappate internamente per compensare l'orientamento del pannello.
Dati da openmeteo, descrizioni locali, previsioni e icone RLE con particelle animate.
Valori PM2.5 / PM10 / O₃ / NO₂ con colore indicativo.
Ora in grande formato con data.
Visualizzazione binaria di ore, minuti e secondi.
Conteggio del tempo rimanente di giorno, mese, anno e altre scadenze temporali.
Mostra gli eventi della giornata dal feed ICS.
Ricostruzione settimanale tramite dati giornalieri Open-Meteo.
Alba, tramonto, twilight, mezzogiorno solare, durata giorno, UV e fase lunare.
Prezzo attuale, variazione e valore del portafoglio.
Tabella valute rispetto alla valuta base.
Fino a otto eventi con nome e data.
Nota singola con titolo, testo e scelta del colore per annotazioni veloci gestite dalla WebUI.
Prime notizie dal feed RSS.
OpenAI (se configurato) o fallback ZenQuotes.
Mostra entità rilevanti (sensori, luci, prese, batterie, temperatura, movimento).
Orbita terrestre vista dall'alto con stagioni e inclinazione.
Uptime, rete, memoria, CPU, pagine attive.
SquaredCoso.ino— logica principale (display, Wi-Fi, NTP, rotazione, fetch)SquaredWeb.ino— captive portal e WebUIhandlers/— moduli di supportotouch_menu.h— gestione touch GT911 e menu pagine
pages/— pagine del sistemaimages/— asset grafici RLEtools/— script di utilità
- Controlla di usare ESP32 core 2.0.16 o 2.0.17.
- Assicurati che la GFX Library for Arduino sia versione 1.6.0.
- Verifica che tutte le altre librerie richieste siano installate e senza duplicati.
- Se ottieni errori insoliti, cancella la cartella delle build temporanee di Arduino IDE e ricompila.
- Verifica di aver selezionato la scheda ESP32S3 Dev Module.
- Controlla di aver selezionato la porta USB corretta.
- Se non compare alcuna porta, entra manualmente in bootloader premendo BOOT mentre colleghi il cavo (solo una volta).
- Se l'upload fallisce ancora, riduci la velocità da 921600 a 460800.
- Controlla che lo schema partizioni sia Huge APP (3MB No OTA).
- Assicurati che la PSRAM sia su Enabled oppure OPI PSRAM.
- Conferma di usare core ESP32 2.0.16/2.0.17.
- Verifica che la GFX Library sia esattamente la 1.6.0.
- Verifica che Erase All Before Sketch Upload sia disattivato.
- Assicurati che il tuo Arduino IDE non stia forzando una cancellazione completa della flash.
- Prova un cavo USB migliore: molti cavi economici trasmettono solo alimentazione.
- Cambia porta USB del PC.
- Riduci ulteriormente l'upload speed.
- Assicurati di premere BOOT prima di fornire alimentazione alla scheda (solo una volta).
Non vedi retroilluminazione, il PC non rileva nessuna nuova porta seriale.
- Se usi un alimentatore USB, assicurati che sia almeno 5V / 1A (meglio 5V / 2A).
- Evita di usare hub USB non alimentati.
- Prova su un altro PC o sistema operativo per escludere driver/USB buggati.
Vedi la retroilluminazione o il logo per un momento, poi tutto si spegne e riparte. Il monitor seriale mostra riavvii frequenti o errori casuali.
- Cambia alimentazione con un alimentatore 5V / 2A affidabile (tipo alimentatore da smartphone decente, non vecchi caricabatterie da 500 mA).
- Evita le porte USB di monitor/TV, evita di usare hub USB non alimentati.: spesso non reggono il picco di corrente del WiFi + backlight.
- Se il cavo USBè lungo o di qualità scarsa, la caduta di tensione può causare reset. Prova un cavo corto e robusto.
- Controlla che non ci siano contatti in caso tu abbia fatto modifiche sulla board (es. Aggiunta porta USB-C, Mod per l'audio, aggiunta di uno speaker...)
L'ESP32-S3 appare come porta seriale, l'upload funziona, ma il pannello resta sempre completamente buio. Il dispositivo si riavvia quando il Wi-Fi si collega o durante il cambio pagina.
- Anche se l'ESP parte, un alimentatore debole può impedire al backlight di accendersi. Prova con un 5V / 1–2A dedicato.
- Alcuni computer limitano la corrente su certe porte. Prova un'altra porta, una porta alimentata o un alimentatore USB esterno.
- Evita di usare hub USB non alimentati.
- Verifica che la libreria TAMC_GT911 sia installata correttamente.
- Controlla i pin I²C (SDA 19, SCL 45) per eventuali conflitti o saldature fredde.
- Se il menu si apre ma non registra i tocchi, potrebbe essere un problema di calibrazione o di orientamento: i valori vengono rimappati internamente.
-
Inserisci una chiave API OpenAI valida.
-
Come ottenere una chiave:
- Accedi al tuo account OpenAI
- Vai in API Keys
- Crea una nuova chiave
-
Assicurati di aver inserito anche un topic per la frase del giorno.
- Inserisci l'IP corretto della tua istanza HA.
- Genera un token: Profilo → Token a lungo termine → Crea token.
- Assicurati che la rete locale permetta la comunicazione tra dispositivi.
- Controlla VLAN, firewall o router che potrebbero isolare i device.
- Verifica che l'URL del feed RSS sia valido e raggiungibile.
- Evita feed che richiedono login o HTTPS particolari.
- Controlla che l'URL ICS sia corretto e pubblico.
- La funzione ICS è ancora in sviluppo: alcuni calendari potrebbero dare problemi.
- Se il Wi-Fi non si connette, ricontrolla SSID/password o riapri l'AP interno.
- Se il pannello è lento, riavvia e verifica che la PSRAM funzioni.
- Se la WebUI non si apre, verifica che l'IP mostrato nella pagina INFO sia raggiungibile dalla tua rete.
Creative Commons Attribution–NonCommercial 4.0 International.
Attribuzione richiesta: citare l'autore Davide "gat" Nasato e il repository originale: https://github.com/davidegat/SquaredCoso
SquaredCoso is an ESP32-S3 firmware designed for the 480×480 ST7701 RGB panel (Panel-4848S040). It turns the display into a stand‑alone information dashboard, with modular pages rotating automatically and fully configurable through the WebUI.
The device can display:
- Weather and forecasts
- Air quality
- Digital clock
- Binary clock
- Chronos advanced time views
- ICS calendar
- 7 days temperature graph
- Daylight, twilight, UV, moon phase
- Bitcoin and daily change
- FX rates
- Multiple countdowns
- Sticky notes
- RSS news
- Quote of the day (OpenAI or ZenQuotes)
- Home Assistant entity status
- Solar system view
- System info
Each page is independent, optimized for memory and speed, and can be enabled or disabled from the WebUI or directly from the touch screen.
Designed for the ESP32-S3 Panel-4848S040, featuring:
- 480×480 IPS RGB display
- ST7701 controller (parallel RGB)
- GT911 touch
- microSD (FSPI)
Hardware reference: https://github.com/davidegat/ESP32-4848S040-Fun
(Identical to Italian section.)
- ESP32 package 2.0.16 / 2.0.17
- PSRAM enabled (OPI)
- Partition scheme: Huge APP (3MB No OTA)
- Required libraries: Arduino_GFX_Library ≥1.6.0, TAMC_GT911, WiFi, WebServer, DNSServer, HTTPClient, Preferences
On first boot, the device creates its own Wi‑Fi network in AP mode, exposing a captive portal used only to configure the home Wi‑Fi.
After configuration, it switches to STA mode, becomes reachable through its IP address and exposes the full WebUI, where you can configure:
- City and language
- Coordinates or automatic geocoding
- Page rotation interval
- ICS feed
- RSS feed
- Countdown timers
- FX/BTC settings
- OpenAI key and topic
- Post-it content and color
- Home Assistant IP/token
- Enabled pages and visual parameters
Settings are saved to NVS and persist across reboots.
The firmware autonomously manages:
- NTP synchronization
- Data fetching with shared JSON helpers and text sanitization
- Page rotation with status checks and version splash at boot
- Wi‑Fi reconnection
- Graphic transitions and PWM backlight
The device includes a touch menu that allows you to manage active pages directly from the screen, without accessing the WebUI.
Tap anywhere on the screen during normal display. A full-screen overlay with a dark theme will appear.
- Header: shows the title "Gestione Pagine" (Page Manager), the active page counter (e.g. "12/17 attive") and the current menu page indicator (e.g. "1/3").
- Button grid: each firmware page is represented by a button. A circular indicator shows the status: filled and colored if the page is active, empty if disabled.
- Pagination: if there are more than 8 pages, the menu splits across multiple screens. The arrow buttons at the bottom allow navigation between menu pages.
- Action buttons: at the bottom center there are two buttons:
- ANNULLA (Cancel) — closes the menu without saving
- OK — saves changes to NVS and reboots the device
Tap a button to enable or disable the corresponding page. The counter in the header updates in real time. Button labels change automatically based on the configured language (Italian or English).
The touch screen uses the GT911 controller on I²C bus (SDA 19, SCL 45). Debounce is set to 200 ms to prevent accidental multiple taps. Coordinates are internally remapped to compensate for panel orientation.
Live conditions, forecasts, localized descriptions and RLE icons, with animated particles.
PM2.5 / PM10 / O₃ / NO₂ with visual severity indication.
Large digital time and date.
Binary view of hours, minutes and seconds.
Counters for the remaining time in the day, month, year and other deadlines.
Shows today's events from the configured ICS feed.
Reconstructed weekly graph using Open‑Meteo daily data.
Sunrise, sunset, twilight, solar noon, day length, UV, moon phase.
Current price, delta and portfolio value.
Currency table relative to base currency.
Up to 8 programmable events.
Single note with title, body and color controls for quick reminders managed through the WebUI.
First headlines from RSS feed.
OpenAI‑generated or ZenQuotes fallback.
Displays selected entities (sensors, lights, plugs, battery, temperature, motion).
Top‑down view of Earth orbit with seasonal position and axial tilt.
Uptime, network details, memory, CPU, active pages.
SquaredCoso.ino— main logic (display, Wi-Fi, NTP, rotazione, fetch)SquaredWeb.ino— captive portal and WebUIhandlers/— support modulestouch_menu.h— GT911 touch handler and page menu
pages/— SquaredCoso pages filesimages/— RLE assetstools/— utilities
- Make sure you are using ESP32 core 2.0.16 or 2.0.17.
- Ensure that the GFX Library for Arduino is version 1.6.0.
- Check that all the other required libraries are installed and that there are no duplicates.
- If you get unusual errors, delete Arduino IDE's temporary build folder and recompile.
- Verify that the selected board is ESP32S3 Dev Module.
- Check that you have selected the correct USB port.
- If no port appears, manually enter bootloader mode by pressing BOOT while you plug in the cable (only once).
- If the upload still fails, lower the speed from 921600 to 460800.
- Check that the partition scheme is Huge APP (3MB No OTA).
- Make sure PSRAM is set to Enabled or OPI PSRAM.
- Confirm you are using ESP32 core 2.0.16/2.0.17.
- Verify that the GFX Library is exactly 1.6.0.
- Make sure Erase All Before Sketch Upload is disabled.
- Ensure your Arduino IDE is not forcing a full flash erase.
- Try a better USB cable; many cheap cables only provide power.
- Change the USB port on your PC.
- Lower the upload speed further.
- Make sure you press BOOT before powering the board (only once).
You do not see any backlight, and the PC does not detect a new serial port.
- If you use a USB power adapter, make sure it is at least 5V / 1A (preferably 5V / 2A).
- Avoid using unpowered USB hubs.
- Try on another PC or operating system to rule out buggy USB/drivers.
You see the backlight or logo for a moment, then everything turns off and restarts. The serial monitor shows frequent reboots or random errors.
- Change the power source to a reliable 5V / 2A adapter (for example a decent smartphone charger, not an old 500 mA one).
- Avoid monitor/TV USB ports and unpowered USB hubs; they often cannot handle the current spike from Wi‑Fi + backlight.
- If the USB cable is long or poor quality, voltage drop may cause resets. Try a short, good-quality cable.
- If you modified the board (e.g. added a USB‑C port, audio mod, speaker), check there are no shorts or bad contacts.
The ESP32‑S3 appears as a serial port, upload works, but the panel stays completely dark. The device reboots when Wi‑Fi connects or when pages change.
- Even if the ESP starts, a weak power supply can prevent the backlight from turning on. Try a dedicated 5V / 1–2A adapter.
- Some computers limit current on specific ports. Try another port, a powered USB port, or an external USB power adapter.
- Avoid using unpowered USB hubs.
- Verify that the TAMC_GT911 library is installed correctly.
- Check the I²C pins (SDA 19, SCL 45) for conflicts or cold solder joints.
- If the menu opens but does not register taps, it might be a calibration or orientation issue: values are internally remapped.
-
You must enter a valid OpenAI API key.
-
How to get one:
- Log into your OpenAI account
- Go to API Keys
- Generate a new key
-
Do not forget to enter a topic for the quote of the day.
- Enter the correct IP address of your HA instance.
- Generate a token: Profile → Long-lived access tokens → Create token.
- Make sure your network allows communication between devices.
- Check VLANs, firewalls, or routers that may isolate devices.
- Make sure the RSS feed URL is valid and reachable.
- Avoid feeds requiring authentication or unusual HTTPS setups.
- Check that the ICS URL is correct and publicly accessible.
- ICS support is still evolving; certain calendars may behave inconsistently.
- If Wi-Fi won't connect, recheck SSID/password or reopen the access point.
- If the display seems slow, reboot and check PSRAM health.
- If the WebUI does not open, verify the INFO page IP is reachable on your network.
Creative Commons Attribution–NonCommercial 4.0 International.
Attribution required: cite Davide "gat" Nasato and the original repository: https://github.com/davidegat/SquaredCoso