Skip to main content

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
The data flow is: Cloud → Phone App → SGC → Your Glasses

Implementation Paths

For Android-Based Glasses

If your glasses run Android OS:
  1. Use the MentraOS ASG Client - An Android app that runs on the glasses
  2. Create an SGC in the phone app to communicate with your glasses
    • Location: android_core/ folder (Android) or mobile/ios/ (iOS)
    • Your SGC will act as a BLE client connecting to the glasses’ BLE server

For RTOS/Firmware-Based Glasses

If your glasses run custom firmware:
  1. Review the firmware specification
    • See firmware_spec.md
    • Implement the required BLE services and characteristics
    • Handle display commands, sensor data, etc.
  2. 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

In android_core/app/src/main/java/com/augmentos/augmentos_core/smarterglassesmanager/supportedglasses/:

b. Add your Operating System type

In SmartGlassesOperatingSystem.java, add your OS type:

c. Update SmartGlassesManager

In SmartGlassesManager.java, add your device to the supported list:

d. Map OS to SGC in SmartGlassesRepresentative

In SmartGlassesRepresentative.java, update the createCommunicator() method:

2. Define Glasses Features

In mobile/src/config/glassesFeatures.ts:

3. Add Glasses Image

  1. Add your image to mobile/assets/glasses/your-glasses-image.png
  2. Update mobile/src/utils/getGlassesImage.tsx:

4. Create Pairing Guide

In mobile/src/components/misc/GlassesPairingGuides.tsx:
Update mobile/src/utils/getPairingGuide.tsx:

Testing Your Implementation

  1. Device Discovery: Verify your glasses appear in the pairing list
  2. Connection: Test connection/disconnection cycles
  3. Display: Send test cards and bitmaps
  4. Events: Verify battery, tap, and other events work
  5. 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