3f24033cb10138d412a3fbbd8e3d1a0a70829d49
EVS - Embedded Voice System
ESP32-based voice client with:
INMP441microphone (I2S)PAM8403amplifier (analog input from ESP32 DAC)- WebSocket audio streaming to central bridge
- MQTT remote control
- optional UDP microphone stream (remote switchable)
Project Structure
src/main.cpp: Firmware (audio, WiFi, WebSocket, MQTT commands, UDP stream)include/secrets.h: local environment values (not versioned)include/secrets.example.h: template forsecrets.hbridge/: EVS bridge (WebSocket + MQTT + VAD + STT integration)stt-worker/: MQTT-based STT worker (vad_segment->transcript)
Firmware Behavior
- On WebSocket connect: mode switches automatically to
StreamToServer - On WebSocket disconnect: mode switches automatically to
Idle - Serial commands (
115200 baud):p= print network and mode statush= help
MQTT Remote Control
Topics:
- command:
evs/<device_id>/command - status:
evs/<device_id>/status
Example commands:
{"cmd":"status"}{"cmd":"mode","value":"idle"}{"cmd":"mode","value":"stream"}{"cmd":"io_mode","value":"mic"}{"cmd":"io_mode","value":"spk"}{"cmd":"udp_stream","enabled":true,"target_host":"10.100.3.247","target_port":5004}{"cmd":"udp_stream","enabled":false}
Status payload includes:
- current mode
- current
io_mode(micorspk) - WS/MQTT connectivity
- UDP stream state and target (only relevant in
micmode)
ESP32 Setup
- Copy
include/secrets.example.htoinclude/secrets.h. - Set values in
include/secrets.h:
- WiFi credentials
EVS_BRIDGE_HOSTEVS_WS_PORT,EVS_WS_PATHEVS_DEVICE_ID- role config:
EVS_ENABLE_MICEVS_ENABLE_SPEAKEREVS_DEFAULT_IO_MODE("mic"or"spk")EVS_SPK_DAC_PIN(25or26)
- optional MQTT overrides:
EVS_MQTT_HOST,EVS_MQTT_PORTEVS_MQTT_USER,EVS_MQTT_PASSWORDEVS_MQTT_BASE_TOPIC
- Build/flash:
pio run -e esp32dev_core2 -t upload
pio device monitor -b 115200
Audio Format
- PCM16LE
- mono
- 16 kHz
Notes
include/secrets.his intentionally ignored in git.- Speaker path is DAC-only (PWM removed):
GPIO25(DAC1) orGPIO26(DAC2) -> amplifier input (L+orR+)- common
GNDbetween ESP32 and amplifier is mandatory
- INMP441 wiring (default in firmware):
WS->GPIO25SCK->GPIO26SD->GPIO33VDD->3V3GND->GND
- For newer Arduino core testing,
esp32dev_core3is available inplatformio.ini. - Bridge and STT worker details are in
bridge/README.mdandstt-worker/README.md.
Description
Languages
Python
57.8%
C++
30.2%
HTML
6.9%
Dockerfile
3%
C
2.1%