omiGlass/firmware/readme.md
This document provides comprehensive instructions for building, flashing, and managing the OMI Glass firmware.
The UF2 (USB Flashing Format) method is the simplest way to flash your ESP32-S3 device by dragging and dropping a file.
From the firmware directory, run the build script:
# Build optimized release version (recommended)
./scripts/build_uf2.sh -e uf2_release
# Or build standard version
./scripts/build_uf2.sh
Enter Bootloader Mode:
Flash the Firmware:
omi_glass_firmware.uf2 file to the "ESP32S3" drive.Monitor (Optional):
pio device monitor --baud 115200
| Environment | Description | Use Case |
|---|---|---|
seeed_xiao_esp32s3 | Standard build | Development |
seeed_xiao_esp32s3_slow | Slower upload | For connection issues |
uf2_release | Optimized release | Production/Best battery |
After building, you'll get:
omi_glass_firmware.uf2 - Main firmware file (ready to flash)..pio/build/*/firmware.bin - Original binary (for advanced use).pip install platformio). Try cleaning the build first (pio run --target clean)../scripts/build_uf2.sh -e seeed_xiao_esp32s3_slow).PlatformIO provides more control over the build and upload process.
firmware directory:
# Try standard environment first
platformio run -e seeed_xiao_esp32s3 --target upload
# If the above fails, try the slower environment
platformio run -e seeed_xiao_esp32s3_slow --target upload
platformio device monitor --baud 115200
seeed_xiao_esp32s3_slow environment.This method is for users who prefer using arduino-cli.
arduino-cli config add board_manager.additional_urls https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
arduino-cli core install esp32:[email protected]
On Windows 11 board should be showing as esp32:esp32:XIAO_ESP32S3
but instead might show as esp32:esp32:nora_w10, esp32:esp32:wifiduino32c3, or something else.
arduino-cli board list
arduino-cli board details -b esp32:esp32:XIAO_ESP32S3
Change COM5 to the port name from the board list output.
arduino-cli compile --build-path build --output-dir dist -e -u -p COM5 -b esp32:esp32:XIAO_ESP32S3:PSRAM=opi
Go to your Arduino libraries folder. You can find the location with arduino-cli config get directories.user (add /libraries to the path).
Then clone the two libraries needed for Opus support:
git clone https://github.com/pschatzmann/arduino-libopus.git
git clone https://github.com/pschatzmann/arduino-audio-tools.git
This section covers battery setup, charging, and monitoring.
The firmware includes a battery service that reports the battery level to the companion app.
A0A0Your current setup:
Battery + ----[R1: 169kΩ]----+----[R2: 110kΩ]---- Battery -
|
ADC Pin A0
The firmware is configured for these values. If you use different resistors, you must update the voltage multiplier in the code.
Connect to the device via serial monitor (115200 baud) and use these commands:
status
Shows current battery level, connection status, and device state.
charging
Takes 10 readings over 20 seconds and shows charging status:
runtime
Shows how long your glasses will last with current charge level for different usage scenarios.
chargetime
Calculates estimated time to reach 80%, 90%, and 100% charge based on current level.
monitor
Continuous 5-second interval monitoring. Type any command to stop.
The OMI app automatically shows battery percentage when connected to the glasses.
| Voltage Range | Battery % | Status | Time to Full (Mac USB) |
|---|---|---|---|
| 4.2V - 4.3V | 100% | Fully charged | 0 minutes |
| 4.0V - 4.2V | 80-100% | Good charge | 15-20 minutes |
| 3.8V - 4.0V | 20-80% | Moderate | 30-60 minutes |
| 3.7V - 3.8V | 0-20% | Low battery | 60-90 minutes |
| 3.5V - 3.7V | Critical | Very low | 90+ minutes |
| <3.5V | Critical | Unsafe | Check hardware |
Note: Times are for 500mAh total capacity (2 x 250mAh) at typical Mac USB rates.
| Usage Pattern | Runtime | Description |
|---|---|---|
| 🔥 Heavy Use | 6-7 hours | Continuous photo capture, always active |
| ⚡ Normal Use | 8-10 hours | Mixed usage: 60% active, 30% standby, 10% sleep |
| 💤 Light Use | 12-15 hours | Mostly connected but idle, occasional photos |
status
Note the starting voltage (should be <4.1V if not charged).
charging
You should see:
After 2-3 hours:
status
Should show:
Solution: Check voltage divider connections.
status
Look for unrealistic voltages (<2V or >5V).
Solution:
Solution:
A0 is connected correctly.status checkstatus checkscharging command to verify progressmonitor for continuous tracking| Issue | Command | Expected Result | Fix |
|---|---|---|---|
| Won't charge | charging | Voltage increases | Check charger/cable |
| Shows 0% always | status | Voltage <2V | Check hardware connections |
| Won't turn on | monitor | No response | Charge for 30+ minutes |
| Inconsistent readings | charging | Fluctuating values | Check loose connections |
| App shows wrong % | status | Compare readings | Reconnect BLE |
For hardware issues: Check the voltage divider circuit and ensure the ADC pin A0 is properly connected to the battery voltage divider midpoint.