Sparky-ESP32

Un piccolo compagno da scrivania su ESP32-S3 con display AMOLED touch rotondo 368×448: viso animato in tempo reale, assistente vocale, push-to-talk, musica, streaming e una web UI servita dal robot stesso, senza dipendenze da un server esterno. A small desktop companion built on ESP32-S3 with a round 368×448 AMOLED touch display: a real-time animated face, voice assistant, push-to-talk, music, streaming and a web UI served by the robot itself, with no external server dependency.

MCU ESP32-S3 N16R8 Display AMOLED 1.8″ Web server locale Licenza MIT

Numeri del progettoProject numbers

Statistiche generate dal repository e aggiornate con un comando. I contatori partono quando l'area entra nel viewport.Repository statistics regenerated with one command. Counters start when the section enters the viewport.

229commitcommits
332file totalitotal files
55.2krighe di codicelines of code
182file sorgente C++C++ source files
43file web JS/CSSweb JS/CSS files
115route HTTP registrateregistered HTTP routes

Il progettoThe project

Sparky-ESP32 non è un pannello di controllo con uno schermo: è un piccolo sistema autonomo con un carattere visuale, una voce e una superficie di controllo web.Sparky-ESP32 is not a control panel with a screen: it is a compact autonomous system with a visual character, a voice, and a web control surface.

Cosa faWhat it does

Sparky-ESP32 riunisce un viso AMOLED touch da 368×448, un assistente vocale, notifiche interattive, riproduzione MP3 dalla scheda SD, streaming MJPEG, scanner BLE e una web UI completa. Il server HTTP viene eseguito direttamente sul microcontrollore: dal browser si aprono app, si leggono statistiche, si caricano file e si modificano impostazioni senza passare per un servizio cloud.Sparky-ESP32 combines a 368×448 AMOLED touch face, a voice assistant, interactive notifications, SD-card MP3 playback, MJPEG streaming, a BLE scanner, and a complete web UI. The HTTP server runs on the microcontroller itself: from a browser you can open apps, read statistics, upload files, and change settings without an intervening cloud service.

Come è costruitoHow it is built

Il firmware separa Brain, Face, Notifier, WebService e Net in moduli con responsabilità distinte. Il Brain decide cosa mostrare e quando; Face disegna espressioni e atti; Notifier mantiene una coda di messaggi; WebService espone route JSON e asset; Net gestisce Wi-Fi e BLE. Le attività lente, come modello linguistico e sintesi vocale, vengono isolate in task dedicati.The firmware separates Brain, Face, Notifier, WebService, and Net into modules with distinct responsibilities. Brain decides what to display and when; Face renders expressions and acts; Notifier maintains a message queue; WebService exposes JSON routes and assets; Net handles Wi-Fi and BLE. Slow work, such as language-model and speech-synthesis calls, is isolated in dedicated tasks.

Il visoThe face

Il display non mostra soltanto icone: definisce l'umore del robot. Sono presenti 56 espressioni e 49 atti, con transizioni calcolate sul grafo delle espressioni e animazioni temporizzate che terminano tornando alla faccia di base. La resa usa il sistema di coordinate del firmware, incluso il font bitmap e la conversione dalle unità faccia ai pixel AMOLED.The display does more than show icons: it defines the robot's mood. The firmware includes 56 expressions and 49 acts, with transitions calculated on the expression graph and timed animations that return to the base face. Rendering keeps the firmware's coordinate system, including its bitmap font and conversion from face units to AMOLED pixels.

La superficie webThe web surface

La web UI è pensata per la rete locale. Si divide in aree Dispositivo, Robot, Media e Sistema; i pannelli di stato si aggiornano periodicamente, mentre le azioni modificano il dispositivo e restituiscono JSON. Il server web viene avviato quando la connessione Wi-Fi è disponibile e non in modalità esclusivamente BLE.The web UI is designed for the local network. It is divided into Device, Robot, Media, and System areas; status panels refresh periodically, while actions change the device and return JSON. The web server starts when Wi-Fi connectivity is available and the robot is not in BLE-only mode.

Una piattaforma, cinque responsabilitàOne platform, five responsibilities

L'architettura è pensata per mantenere separate percezione, decisione, rendering, comunicazione e connettività.The architecture keeps perception, decision-making, rendering, communication, and connectivity separate.

Il Brain osserva l'attività del dispositivo e il tempo trascorso senza interazione. Può entrare in awake, reacting, dozing oppure sleeping; quando il robot è annoiato, solo o lontano dal computer può cambiare espressione, eseguire un atto, mostrare informazioni o entrare in uno stato di attesa. Il passaggio notturno e le condizioni termiche modificano ulteriormente questo comportamento.The Brain observes device activity and the time elapsed without interaction. It can enter awake, reacting, dozing, or sleeping; when the robot is bored, alone, or away from the computer it may change expression, perform an act, show information, or enter a waiting state. Night hours and thermal conditions further influence this behavior.

Il Notifier possiede quattro slot, conserva fino a 512 caratteri per messaggio e organizza le richieste per priorità. Un messaggio può includere una risposta sì/no, un suono WAV o una sintesi vocale. Le richieste interattive possono restare in attesa per trenta secondi e il sistema limita il flood applicando una finestra di protezione per categoria.The Notifier owns four slots, retains up to 512 characters per message, and orders requests by priority. A message can include a yes/no response, a WAV sound, or speech synthesis. Interactive requests can remain pending for thirty seconds, and the system limits flooding with a per-category protection window.

Net gestisce scansione, connessione e riconnessione Wi-Fi con un timeout di otto secondi e un backoff progressivo. Il server WebService registra oltre cento route e serve asset, pagine e risposte JSON. Face rimane il solo modulo che disegna sul vetro, così le decisioni del Brain possono cambiare espressione senza confondere il confine con la presentazione.Net handles Wi-Fi scanning, connection, and reconnection with an eight-second timeout and progressive backoff. The WebService registers more than one hundred routes and serves assets, pages, and JSON responses. Face remains the only module that draws on the glass, keeping the boundary between Brain decisions and presentation clear.

  • Display e inputDisplay and input
    AMOLED 368×448, touch CST816S, IMU QMI8658.368×448 AMOLED, CST816S touch, QMI8658 IMU.
  • MemoriaMemory
    16 MB flash e 8 MB PSRAM OPI.16 MB flash and 8 MB OPI PSRAM.
  • AudioAudio
    Codec ES8311, microfono mono 16 kHz.ES8311 codec, single 16 kHz microphone.
  • EspansioneExpansion
    Scheda microSD in bus 1-bit.microSD card on a 1-bit bus.
  • AccessibilitàAccessibility
    Notifiche vocali, TTS e risposte fisiche.Voice notifications, TTS, and physical responses.

Dal vetro alla reteFrom the glass to the network

Ogni superficie è una vista diversa della stessa esperienza: il volto, la voce, la shell locale e le API.Each surface is a different view of the same experience: the face, the voice, the local shell, and the APIs.

Il robot è autonomoThe robot is autonomous

All'avvio rileva display, touch, IMU, alimentazione e connettività, quindi il Brain sceglie un'espressione coerente con l'ambiente. Anche senza browser il dispositivo continua a comunicare attraverso il viso, gli atti e le notifiche.At startup it detects the display, touch, IMU, power, and connectivity, then Brain selects an expression appropriate to the environment. Even without a browser the device continues communicating through its face, acts, and notifications.

La voce diventa conversazioneVoice becomes conversation

Il task audio raccoglie il microfono, trasmette l'audio al provider configurato e riproduce la risposta. Il modello può usare strumenti esposti dal robot, così una richiesta non si limita a generare testo: può anche interrogare il dispositivo e trasformare il risultato in azione o notifica. Il provider non deve per forza essere in cloud: con un server vocale locale self-hosted — per esempio AiLocalVoiceServer, che gira anche su Android — la catena resta offline, senza abbonamenti e senza dati che escono dalla rete.The audio task captures the microphone, sends audio to the configured provider, and plays the reply. The model can call tools exposed by the robot, so a request does more than generate text: it can query the device and turn the result into an action or notification. The provider does not have to be in the cloud: with a self-hosted local voice server — such as AiLocalVoiceServer, which also runs on Android — the chain stays offline, with no subscription and no data leaving the network.

Il browser diventa consoleThe browser becomes a console

La web UI raggruppa stato, media, file e configurazione. Le richieste sono JSON e coprono informazioni, potenza, volume, luminosità, Wi-Fi, BLE, notifiche, assistente, file e stream. È la stessa superficie usata per la diagnostica e per le automazioni locali.The web UI groups status, media, files, and configuration. Requests use JSON and cover information, power, volume, brightness, Wi-Fi, BLE, notifications, assistant, files, and streams. It is the same surface used for diagnostics and local automation.

Le API consentono l'automazioneAPIs enable automation

Ogni funzione esposta può essere usata da uno script locale. Le route permettono di aprire un'app, cambiare il volto, inviare una notifica, gestire playlist, leggere metriche e controllare la connettività senza dipendere dall'aspetto della UI.Every exposed function can be used by a local script. The routes allow an application to be opened, the face changed, a notification sent, playlists managed, metrics read, and connectivity controlled without depending on the UI's appearance.

Esplora il sitoExplore the site

Sette pagine, un percorso completo dal dispositivo fisico fino ai contratti HTTP.Seven pages provide a complete path from the physical device to the HTTP contracts.

Funzionalità principaliKey capabilities

Display368 × 448
MCUESP32-S3
EspressioniExpressions56
AttiActs49
ReteNetworkWi-Fi + BLE
StreamingStreamingMJPEG + PCM
EmulatoreEmulatorrobot_emu.exe
LicenzaLicenseMIT
Privacy e perimetro:Privacy and scope: La shell web e i dati di diagnostica restano sul robot e sulla rete locale. L'assistente vocale, se abilitato, può however utilizzare Gemini o un server OpenAI-compatibile configurato dall'utente. Nel sito non viene pubblicato l'indirizzo IP del dispositivo e gli screenshot applicano regole deterministiche di mascheramento. The web shell and diagnostic data remain on the robot and the local network. The voice assistant, when enabled, may use Gemini or a user-configured OpenAI-compatible server. The site never publishes the device IP, and screenshots follow deterministic masking rules.