Adding Support for New Smart Glasses
This guide explains how to add support for new smart glasses to the MentraOS ecosystem. The process involves creating platform-specific communicators and updating the UI to recognize your glasses model.Overview
MentraOS supports different types of smart glasses through a modular architecture:- Android-based glasses (like Mentra Live, TCL Rayneo, INMO Air) - Run Android OS directly
- RTOS/Firmware-based glasses (like Even Realities G1, Vuzix Z100) - Run custom firmware
- Future glasses - Any glasses that can communicate via Bluetooth/WiFi
What is a SmartGlassesCommunicator (SGC)?
A SmartGlassesCommunicator (SGC) is the bridge between MentraOS and your specific smart glasses hardware. It handles:- Bluetooth/USB connection to the glasses
- Translating MentraOS commands to your glasses’ protocol
- Sending display data, audio, and control commands
- Receiving sensor data, button presses, and status updates
Implementation Paths
For Android-Based Glasses
If your glasses run Android OS:-
Use the MentraOS ASG Client - An Android app that runs on the glasses
- See MentraOS ASG Client Guidelines
- Modify device detection in the NetworkManager and BluetoothManager factories
- The existing StandardBluetoothManager can work with most Android glasses
-
Create an SGC in the phone app to communicate with your glasses
- Location:
android_core/
folder (Android) ormobile/ios/
(iOS) - Your SGC will act as a BLE client connecting to the glasses’ BLE server
- Location:
For RTOS/Firmware-Based Glasses
If your glasses run custom firmware:-
Review the firmware specification
- See firmware_spec.md
- Implement the required BLE services and characteristics
- Handle display commands, sensor data, etc.
-
Create an SGC to communicate with your firmware
- Implement the BLE client protocol matching your firmware
Creating a SmartGlassesCommunicator (Android)
1. Create Your SGC Class
Location:android_core/app/src/main/java/com/augmentos/android_core/smarterglassesmanager/smartglassescommunicators/
Create a new Java file extending SmartGlassesCommunicator
:
2. Implement Required Methods
Device Discovery
Connection Management
3. Handle Display Commands
Implement based on your glasses’ capabilities:4. Register Your Glasses in the System
To make your glasses available in the system, you need to:a. Create a SmartGlassesDevice class
Inandroid_core/app/src/main/java/com/augmentos/augmentos_core/smarterglassesmanager/supportedglasses/
:
b. Add your Operating System type
InSmartGlassesOperatingSystem.java
, add your OS type:
c. Update SmartGlassesManager
InSmartGlassesManager.java
, add your device to the supported list:
d. Map OS to SGC in SmartGlassesRepresentative
InSmartGlassesRepresentative.java
, update the createCommunicator()
method:
2. Define Glasses Features
Inmobile/src/config/glassesFeatures.ts
:
3. Add Glasses Image
- Add your image to
mobile/assets/glasses/your-glasses-image.png
- Update
mobile/src/utils/getGlassesImage.tsx
:
4. Create Pairing Guide
Inmobile/src/components/misc/GlassesPairingGuides.tsx
:
mobile/src/utils/getPairingGuide.tsx
:
Testing Your Implementation
- Device Discovery: Verify your glasses appear in the pairing list
- Connection: Test connection/disconnection cycles
- Display: Send test cards and bitmaps
- Events: Verify battery, tap, and other events work
- Cleanup: Ensure proper disconnect and resource cleanup
Example Implementations
Study these existing SGCs for reference:- EvenRealitiesG1SGC.java - Display-focused glasses with dual device support
- MentraLiveSGC.java - Audio-focused glasses with streaming capabilities
- VuzixZ100SGC.java - Simple display implementation
Getting Help
- Join the Discord community
- Review existing SGC implementations
- Post questions on GitHub issues
- Schedule a demo call to show your glasses and get guidance
Important Notes
- Naming consistency: The device model name must match exactly across all files
- Platform support: Only add to iOS if you’ve implemented iOS support
- Testing: Test the complete flow from pairing to data exchange
- Documentation: Document any special pairing procedures or requirements