Voice-controlled smart glasses system with dynamic device discovery and comprehensive mock mode.
Status: β Implementation Complete - Ready for hardware integration and demo deployment.
Smart glasses that use your phone as eyes, ears, and mouth while a LT acts as the brain and a Pi Zero W drives a tiny OLED display.
Phone (Galaxy S22+ running IP Webcam)
βββββββββββββββββββββββββββββββββββββββ
β β
β ποΈ Camera ββββ video stream βββββββΌβββββββΆ ββββββββββββββ
β β β β
β π Mic ββββββββ audio stream ββββββΌβββββββΆ β LT β
β β β (brain) β
β π Speaker ββββ TTS audio βββββββββΌβββββββ β β
β β βββββββ¬βββββββ
βββββββββββββββββββββββββββββββββββββββ β
β SSH
βΌ
βββββββββββββββ
β Pi Zero W β
β (bridge) β
ββββββββ¬βββββββ
β I2C
βΌ
βββββββββββββββ
β OLED β
β 128x64 β
βββββββββββββββ
| Component | Role | What it does |
|---|---|---|
| Phone (Galaxy S22+) | Eyes, ears, mouth | Camera captures video. Mic captures voice. Speaker plays TTS audio output. |
| Pi Zero W | Dumb display terminal | Receives text strings from LT. Draws them on OLED. Zero logic. |
- OLED: Elegoo 0.96" 128x64, SSD1306 driver, I2C (4 pins), address 0x3c
- Pi: Raspberry Pi Zero W
- Phone: Galaxy S22+ running IP Webcam app (Thyoni Tech)
- Network: Phone WiFi hotspot connects LT + Pi
iris-glasses/
βββ .gitignore
βββ .env.example # API keys and config
βββ README.md
βββ requirements.txt # LT dependencies
βββ config.yaml # Configuration file
βββ main.py # Entry point (runs on LT)
β
βββ core/ # Core infrastructure (LT)
β βββ __init__.py
β βββ feature_base.py # Abstract base class for features
β βββ display.py # Sends text to Pi over SSH
β βββ audio.py # Audio I/O with phone via IP Webcam
β βββ camera.py # Video capture from phone
β βββ voice_trigger.py # Wake word + command parsing
β
βββ features/ # Modular features (LT)
β βββ __init__.py
β βββ todo/ # Voice-controlled todo list
β βββ directions/ # Turn-by-turn navigation
β βββ translation/ # Live text translation via OCR
β
βββ pi/ # 0w
βββ display_server.py # Dumb terminal for OLED display
βββ requirements.txt # Pi dependencies
βββ setup.sh # Pi setup script
# Setup (one time)
./setup.sh
# Run in full mock mode (no hardware needed)
python3 main.py --mock
# Run with laptop microphone + terminal display (starts immediately)
python3 main.py --audio-source laptop --display terminal
# Run with ESP32 display (Texas team - starts immediately)
python3 main.py --audio-source laptop --display esp32 --display-ip 192.168.1.100
# Run with Arduino Nano display (starts immediately)
python3 main.py --audio-source laptop --display nano
# Run with Pi Zero W display (waits for Pi discovery)
python3 main.py --audio-source laptop --display pi
# Run hardware diagnostics
python3 main.py --debug-hardware
# Run tests
./run_tests.py --coveragePhone (mic) β Laptop (brain) β Pi Zero W (display) + ESP32 devices (IoT)
- State machine voice command processing
- mDNS discovery (no hardcoded IPs)
- Pluggable audio (laptop mic, IP Webcam, mock)
- Persistent SSH display connection
- Thread-safe interrupts for motion alerts
- Complete mock mode for testing
# Quick setup with script
./setup.sh
# OR manual setup:
pip3 install -r requirements.txt
cp .env.example .env
# Edit .env with API keys# On the Pi, run the setup script
cd ~
git clone <repository-url> iris
cd iris
chmod +x pi/setup.sh
./pi/setup.sh
# Follow the script's instructions to reboot and test- Install IP Webcam app by Thyoni Tech from Google Play Store
- Open the app and start the server
- Note the IP address shown (e.g., http://192.168.43.1:8080)
- Enable WiFi hotspot on your phone
- Connect both LT and Pi to the phone's hotspot
Edit .env on the LT:
# Update with your phone's IP Webcam URL
IP_WEBCAM_URL=http://192.168.43.1:8080
# Update Pi hostname if needed
PI_HOST=raspberrypi.local
# Add API keys for features
GOOGLE_MAPS_API_KEY=your_key_here
DEEPL_API_KEY=your_key_here
OPENAI_API_KEY=your_key_here- Start the phone: Open IP Webcam app and start server
- Start the Pi: SSH into Pi and run display server (or it can be auto-started)
- Start the LT brain:
cd iris-glasses source venv/bin/activate python main.py
"hey iris" # Wake up β Main menu
"todo" # β Todo list
"weather" # β Weather display
"translation" # β Translation mode
"connect" # β Device list
# In device list:
"connect light" # Connect to smart light
"connect fan" # Connect to smart fan
# Device controls:
"on", "off" # Light/fan control
"low", "high" # Fan speed
"back" # Return to previous screen
The 0.96" 128x64 OLED is tiny:
- Max 4 lines of text
- Max 21 characters per line
- Uses symbols to save space: β β β β β β β β
Phone (Galaxy S22+) hosting WiFi hotspot
β
ββββ LT connects to hotspot
β ββββ Runs main.py (brain)
β
ββββ Pi Zero W connects to hotspot
ββββ Runs display_server.py (display only)
LT SSHs to Pi to send display commands
The system supports multiple display hardware types:
| Display Type | Description | Usage | Startup Speed |
|---|---|---|---|
none |
No display output | Testing without hardware | Immediate |
terminal |
ASCII display to stdout | Local development | Immediate |
nano |
Arduino Nano over serial USB | Prototyping | Immediate |
esp32 |
ESP32 over HTTP | Texas team glasses | Immediate |
pi |
Pi Zero W over SSH | Main demo glasses | Waits for Pi |
# No display (testing only)
python3 main.py --display none
# Terminal ASCII (default in mock mode)
python3 main.py --display terminal
# Arduino Nano (auto-detect USB port)
python3 main.py --display nano
# Arduino Nano (specific port)
python3 main.py --display nano --serial-port /dev/ttyUSB0
# ESP32 display (requires IP)
python3 main.py --display esp32 --display-ip 192.168.1.100
# Pi Zero W (default in real mode)
python3 main.py --display piEdit config.yaml and .env for:
- Audio source preference
- Device hostnames for discovery
- API keys (OpenWeather, DeepL)
- Timeout and polling settings
See UNDERSTAND.md for detailed API contracts and integration instructions.
- Advertise via mDNS (e.g., "iris-light.local")
- Implement HTTP JSON endpoints
- Motion sensor must POST alerts to laptop
// ESP32 display must implement:
// GET /status β 200 OK (health check)
// POST /display with JSON: {"lines": ["line1", "line2", "line3", "line4"]}// Nano display reads from serial (9600 baud):
// Format: "line1|line2|line3|line4\n"
// Parse and display on OLED/LCD
- Run
pi/setup.sh - Start
pi/advertise.py - Configure SSH keys for passwordless access
- test_parser.py - State machine behavior
- test_discovery.py - Device discovery system
- test_iot.py - IoT client communication
- test_features.py - Todo, weather, translation
./run_tests.py --parser # Run specific module
./run_tests.py --coverage # Generate coverage reportAll components support mock mode for development without hardware:
python3 main.py --mock --audio-source mockUse keyboard input instead of voice, ASCII display instead of OLED, simulated device responses.
- Verify all devices are on the same WiFi network (phone's hotspot)
- Check IP Webcam URL in
.envmatches what's shown in the app - Test Pi SSH connection:
ssh pi@raspberrypi.local - Use
i2cdetect -y 1on Pi to verify OLED at address 0x3c
- Ensure I2C is enabled on Pi (
sudo raspi-config) - Check OLED wiring: VCC, GND, SDA (pin 3), SCL (pin 5)
- Test display server:
echo "Test|Display|Working|OK" | python pi/display_server.py
- Hardware: Pi Zero W + OLED display integration
- Software: Python application architecture
- Mobile: IP Webcam integration for camera/audio
- AI: Voice recognition and command processing
Full documentation: UNDERSTAND.md
Hardware diagnostics: python3 main.py --debug-hardware
Built for TAMU Hacks Hardware Track 2026