EchoScreen is a multi-component system for real-time audio capture, visualization, and transcription. It consists of:
- Node.js backend (Socket.IO + HTTP + Redis) for room/user coordination and transcription requests.
- ESP32 firmware (PlatformIO/Arduino) for device UI, network handling, and audio streaming.
- Java desktop WebSocket server with a live waveform UI and optional auto-recording/transcription bridge.
EchoScreen/
├── backend/ # Node.js server
│ ├── src/
│ │ ├── server.js # Express + Socket.IO entry
│ │ ├── events/ # Socket.IO event handlers
│ │ ├── config/redisClient.js
│ │ ├── globals.js # Redis-backed room/user helpers
│ │ └── index.html # Landing page
│ ├── app.js # Thin entry that runs src/server
│ ├── .env.example # Environment variables template
│ └── package.json
├── dev/ # ESP32 firmware (PlatformIO)
│ ├── platformio.ini # Board, framework, serial config
│ ├── include/ # Headers (pins, WiFi map, websocket, etc.)
│ └── src/ # Firmware sources
└── java_server/ # Java desktop WebSocket server + UI
├── AudioWebSocketServerWithPlot.java
├── run.bat # Compile & run helper (Windows)
└── *.jar # Required dependencies
-
Backend
Node.js18+ andnpm.Redisserver (local or managed). Default URLredis://localhost:6379.- AssemblyAI API key for transcription.
-
ESP32 Firmware (dev)
VS Code+PlatformIOextension or PlatformIO Core CLI.- Board:
esp32doit-devkit-v1.
-
Java Desktop Server
Java JDK8+.- Windows recommended (provided
run.bat), but can run on any OS with equivalent commands.
-
Backend: install and run
- Open
backend/. - Copy
.env.exampleto.envand set values (see below). - Install deps:
npm install. - Development:
npm run dev(nodemon). Production:npm start. - Server listens on port
4000by default.
- Open
-
ESP32 firmware: build and flash
- Open
dev/in VS Code with PlatformIO. - Adjust serial ports in
platformio.ini(upload_port,monitor_port). - Set backend URL in
dev/src/constants.cpp(see below). - Build:
pio run. Upload:pio run -t upload. Monitor:pio device monitor.
- Open
-
Java desktop server: compile and run
- Open
java_server/. - Double-click
run.bator run from terminal to compile and start. - Server binds to port
8081and opens the waveform UI.
- Open
- Environment (
backend/.env)
REDIS_URL=redis://localhost:6379
ASSEMBLYAI_API_KEY=your-api-key
PORT=4000 # optional; defaults to 4000
-
Scripts (
backend/package.json)npm run dev: runssrc/server.jsvia nodemon.npm start: runssrc/server.js.
-
Behavior
- Express serves
index.htmlon/. - Socket.IO is enabled with CORS
origin: *. - Redis is used to store rooms/users via
src/config/redisClient.jsandsrc/globals.js.
- Express serves
- Board & serial config (
dev/platformio.ini)
[env:esp32doit-devkit-v1]
platform = espressif32
board = esp32doit-devkit-v1
framework = arduino
upload_port = COM3
upload_speed = 115200
monitor_port = COM3
monitor_speed = 115200
- Backend URL
- Update the backend host in
dev/src/constants.cpp:
- Update the backend host in
String URL = "echoscreen.onrender.com"; // change to your backend host
-
If self-hosting locally, use your machine’s IP or hostname, e.g.
"192.168.1.10:4000". -
For HTTPS deployments, prefer secure WebSockets (
wss://) and HTTPS URLs. -
WiFi credentials
- WiFi SSID/password helpers live in
dev/include/ssid_pass_map.h. - Add or implement lookup/set functions to prefill known networks.
- WiFi SSID/password helpers live in
-
Pins & peripherals
- Pins for buttons, LCD, and I2S microphone are defined in
dev/include/constants.h.
- Pins for buttons, LCD, and I2S microphone are defined in
-
Purpose
- Accepts raw PCM audio via WebSocket from clients (e.g., ESP32), renders a live waveform, and optionally auto-records 5-second clips for transcription.
-
How to run (Windows)
- In
java_server/, runrun.bat. It compiles and starts:
- In
javac -cp ".;Java-WebSocket-1.5.4.jar;slf4j-api-2.0.9.jar;concentus-1.0.1.jar;slf4j-simple-2.0.9.jar;socket.io-client-2.1.0.jar;engine.io-client-2.1.0.jar;json-20180813.jar;okhttp-3.12.12.jar;okio-1.17.5.jar" AudioWebSocketServerWithPlot.java
java -cp ".;Java-WebSocket-1.5.4.jar;slf4j-api-2.0.9.jar;concentus-1.0.1.jar;slf4j-api-2.0.9.jar;slf4j-simple-2.0.9.jar;socket.io-client-2.1.0.jar;engine.io-client-2.1.0.jar;json-20180813.jar;okhttp-3.12.12.jar;okio-1.17.5.jar" AudioWebSocketServerWithPlot
-
Defaults
- WebSocket server port:
8081. - Transcription endpoint:
https://echoscreen.onrender.com(configured in code asTRANSCRIPTION_SERVER).
- WebSocket server port:
-
Connecting a client
- Point your client (ESP32 or other) to
ws://<PC-IP>:8081. - The UI opens automatically and updates the waveform in real-time.
- Point your client (ESP32 or other) to
- ESP32 device discovers WiFi, connects, and communicates via WebSockets (
WebSocketsClient) to the backend URL. - Backend coordinates users/rooms with Redis and Socket.IO and serves a simple index page.
- Java desktop server (optional) can accept raw audio streams for local visualization and auto-recording; it can forward recordings for transcription.
-
Hosted backend
- If deploying to Render or similar, set
URLto your public domain (e.g.,echoscreen.onrender.com). - Ensure CORS and Socket.IO transports (
websocket,polling) are allowed.
- If deploying to Render or similar, set
-
TLS
- When hosting behind HTTPS, use
wss://for WebSocket endpoints and configure any reverse proxy to forwardUpgradeandConnectionheaders correctly.
- When hosting behind HTTPS, use
-
Redis connection errors
- Verify Redis is accessible at
REDIS_URL. Check logs forRedis Client Error.
- Verify Redis is accessible at
-
Port conflicts
- Backend default:
4000. Java server default:8081. Change via env or code if needed.
- Backend default:
-
PlatformIO upload/monitor
- Update
COMports inplatformio.ini. Close other serial monitors before opening.
- Update
-
Java compile/runtime
- Ensure JDK is installed and
javac/javaare onPATH. On non-Windows systems, replicate the classpath fromrun.bat.
- Ensure JDK is installed and
See LICENSE in the repository root.