# Bluetooth Troubleshooting

This page helps troubleshoot Bluetooth scan, pairing, and connection issues between the phone app and Rokid Glass3.

## 1. What Bluetooth is used for

In Glass3 SDK, Bluetooth is mainly used to:

- Scan and discover glasses.
- Establish the basic phone-glasses connection.
- Transfer small messages, control commands, and lightweight data.
- Trigger P2P connection negotiation.

Large files, images, video, and real-time AV streams should use P2P.

## 2. Pre-checks

| Item | Requirement | Notes |
| --- | --- | --- |
| Glasses system | Enterprise/work system | Rokid AI Enterprise only connects to enterprise systems. |
| Phone app | Enterprise app or enterprise Demo | Consumer and enterprise stacks are not interchangeable. |
| Bluetooth | Enabled on phone and glasses | Try toggling Bluetooth before reconnecting. |
| Location permission | Usually required on Android 10+ | Bluetooth scan may depend on location permission. |
| Nearby devices | Required on Android 12+ | Includes `BLUETOOTH_SCAN` and `BLUETOOTH_CONNECT`. |
| Existing connection | Glasses not connected to another phone | Connected glasses may not be discoverable. |

## 3. Cannot discover glasses

### Possible causes

- Bluetooth, nearby devices, or location permission is missing.
- Bluetooth is disabled on the phone or glasses.
- Glasses are already connected to another phone.
- System/app versions do not match.
- Scan filter is too strict.

### Steps

1. Confirm permissions in system settings.
2. Confirm the glasses are not connected to another phone.
3. Check whether `Glass3_XXXX` appears in phone system Bluetooth settings.
4. Verify that the scan filter does not drop `Glass3_` devices.
5. Capture logcat from permission request through scan start.

## 4. Device found but connection fails

### Possible causes

- Stale pairing information.
- Glasses already connected to another phone.
- Phone Bluetooth stack issue.
- Enterprise/consumer system or app mismatch.
- Connection starts before SDK initialization completes.

### Steps

1. Forget the device in phone Bluetooth settings and reconnect.
2. Restart phone and glasses.
3. Confirm enterprise system and enterprise app/Demo are used.
4. Start scan and connection after SDK initialization completes.
5. Capture logcat 30 seconds before and after failure.

## 5. Connected but messages fail

Check:

- Whether phone and glasses use the expected `clientId`.
- Whether the glasses app has registered its client.
- Whether receive callbacks are registered.
- Whether the target app is alive and not killed by the system.
- Whether large files are mistakenly sent over Bluetooth.

## 6. Logs to collect

Capture the full flow:

```text
Permission request → scan start → device found → connect → connection result → send/receive message
```

Provide:

- Phone model and Android version.
- Glasses SN and system version.
- SDK version.
- App package name.
- Whether another phone was connected.
- Full logcat.

## 7. Quick diagnosis

| Symptom | Check first |
| --- | --- |
| Cannot scan at all | Permissions, system version, existing phone connection. |
| Found but cannot connect | Pairing state, enterprise/consumer mismatch, Bluetooth stack. |
| Connected but no messages | `clientId`, callback registration, glasses app lifecycle. |
| Large file is slow | Use P2P instead of Bluetooth. |
