paolo_olivieri
tools · audio · browser

ESP32 Offline Chat

A fully offline local chat system running on an ESP32. The device creates its own Wi-Fi network (SoftAP) and serves a web interface to connected clients, with message exchange handled via simple HTTP endpoints.

The goal was a minimal, infrastructure-free communication tool: connect to the ESP32 network, open the page, and chat.

No cloud. No accounts. No persistence. Messages live in volatile memory and disappear on reboot.

Open static UI demo Download Arduino sketch

Note: the demo is UI-only and stores messages in localStorage, so it does not replicate the ESP32 multi-client behaviour.

What it is

The ESP32 runs in Wi-Fi SoftAP mode and exposes an HTTP server on port 80. Clients connect directly to the device and submit messages via POST, while the chat log is retrieved via GET.

The original system is LAN-only and intentionally simple: one shared log, no authentication, no encryption layer.

HTTP endpoints

  • GET / – serves the chat interface
  • POST /send – accepts user and msg, appends to the log
  • GET /chatlog – returns the full log as text/plain

Clients refresh the view via polling (once per second), not WebSockets.

Message storage

  • Chat log stored in ESP32 RAM (volatile)
  • Trimmed to a fixed size (~3000 characters) to bound memory use
  • Client-side timestamps appended before submission

This is a deliberate tradeoff: fast and self-contained, but not durable.

Client interface

  • Single-page HTML served by the ESP32
  • Matrix-style canvas background
  • Per-user colour hashing (stable hue from username)
  • Nickname persistence via localStorage
  • Easter egg triggers (e.g. NEO → scripted MORPHEUS messages)

Static demo limitations

The static demo is included to showcase the interface and interaction model, but it is not networked:

  • Messages are stored locally in the browser (localStorage)
  • There is no shared server log, so multiple devices will not see the same chat
  • The ESP32 build uses a shared RAM log served via /chatlog

In other words: the demo shows the UI, the ESP32 version is the actual multi-client system.

Hardware behaviour

  • Status LED on GPIO4
  • Two-blink boot sequence as a simple alive indicator

What it is not

  • ❌ Real-time push messaging (no WebSockets)
  • ❌ Persistent chat platform
  • ❌ Encrypted communication layer
  • ❌ Internet-connected service