Mentra Live Development Guide
This guide covers working with Mentra Live smart glasses, the primary device running ASG Client.
Device Overview
Mentra Live (K900) specifications:
- OS: Custom Android build
- Connectivity: WiFi 802.11 b/g/n, Bluetooth 5.0 LE
- Camera: 1080p photo/video capability
- ADB: WiFi only (no USB ADB support)
- MCU: Integrated microcontroller for hardware control
Setup
Prerequisites
-
Development Machine
- Android Studio with Java SDK 17
- ADB tools installed
- Same WiFi network as glasses
-
Mobile Device
- MentraOS app installed
- Bluetooth enabled
- Same WiFi network as glasses
Initial Pairing
- Turn on Mentra Live - Press and hold power button
- Open MentraOS app on your phone
- Start pairing - Follow in-app instructions
- Connect to WiFi - Use app to configure network
ADB Connection
Mentra Live only supports ADB over WiFi. Here's how to connect:
Finding the IP Address
- Open MentraOS app
- Go to "Glasses" screen
- Look for "Local IP Address"
- Note this IP (e.g., 192.168.1.123)
Connecting via ADB
# Connect using the IP from the app
adb connect [IP_ADDRESS]:5555
# Example
adb connect 192.168.1.123:5555
# Output should show:
# connected to 192.168.1.123:5555
# Verify connection
adb devices
# Should list: 192.168.1.123:5555 device
Connection Troubleshooting
If connection fails:
# 1. Kill and restart ADB server
adb kill-server
adb start-server
# 2. Try connecting again
adb connect [IP_ADDRESS]:5555
# 3. Check network - ping the glasses
ping [IP_ADDRESS]
# 4. If still failing, restart glasses and try again
Development Workflow
Building and Installing
# Navigate to asg_client directory
cd /path/to/AugmentOS/asg_client
# Build debug APK
./gradlew assembleDebug
# Install on connected glasses
adb install -r app/build/outputs/apk/debug/app-debug.apk
Local Server Development
For testing with local MentraOS server:
# Forward local port to glasses
# This makes localhost:8002 on glasses connect to your PC
adb reverse tcp:8002 tcp:8002
# Configure .env file:
MENTRAOS_HOST=localhost
MENTRAOS_PORT=8002
MENTRAOS_SECURE=false
Viewing Logs
# View all logs
adb logcat
# Filter ASG Client logs
adb logcat | grep -E "AsgClient|MediaCapture|RtmpStreaming"
# Save logs to file
adb logcat -d > mentra_logs.txt
# Clear old logs
adb logcat -c
Hardware Features
Button Commands
The MCU sends these commands for button presses:
Action | Command | Description |
---|---|---|
Short press | cs_pho | Take photo |
Long press | cs_vdo | Start/stop video |
Swipe | cs_swst | Arm swipe gesture |
LED Indicators
- Blue blinking: Bluetooth advertising
- Blue solid: Bluetooth connected
- Red blinking: Low battery
- Green: Charging
Camera Access
The camera is accessed through CameraNeo API:
// Take photo
CameraNeo.takePictureWithCallback(context, filePath, callback);
// Start video recording
CameraNeo.startVideoRecording(context, filePath, callback);
Debugging Tips
Common Issues
-
Can't connect ADB
- Ensure same WiFi network
- Check IP is current in app
- Restart glasses if needed
-
App crashes on launch
- Check logcat for errors
- Verify permissions granted
- Clear app data and retry
-
Camera not working
- Check camera permissions
- Ensure no other app using camera
- Restart ASG Client service
Useful Commands
# Check if service is running
adb shell ps | grep augmentos
# View service logs
adb logcat -s AsgClientService
# Force stop the app
adb shell am force-stop com.augmentos.asg_client
# Start service manually
adb shell am startservice com.augmentos.asg_client/.AsgClientService
# Take screenshot
adb shell screencap -p /sdcard/screen.png
adb pull /sdcard/screen.png
Performance Optimization
Battery Life
- Minimize WiFi scanning
- Use efficient image compression
- Implement proper wake locks
- Stop services when not needed
Memory Usage
- Monitor with:
adb shell dumpsys meminfo com.augmentos.asg_client
- Release resources promptly
- Use appropriate image sizes
- Clear caches periodically
Thermal Management
- Monitor device temperature
- Throttle intensive operations
- Add delays between captures
- Stop streaming if overheating
Factory Reset
If needed, factory reset via:
- Settings UI (if accessible on device)
- MentraOS app → Settings → Factory Reset
- Hardware buttons (see device manual)
Development Best Practices
- Always test on device - Emulator won't have MCU
- Monitor battery - Development drains faster
- Use stable WiFi - Connection drops interrupt ADB
- Handle offline - Glasses often lose connectivity
- Test permissions - Camera, storage, network
- Log extensively - Helps debug remote issues