> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bota.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Connectivity

> How Bota devices connect, upload, and self-manage their network paths

Bota devices support multiple connectivity methods for uploading recordings to the cloud. Each device manages its own network connections — selecting the best available path, handling failovers, and resuming interrupted transfers automatically.

## Upload Methods

Bota supports four upload methods across its device lineup:

| Method           | Path                               | Best For                                   |
| ---------------- | ---------------------------------- | ------------------------------------------ |
| **BLE Sync**     | Device → Phone App → Cloud         | All devices; phone always nearby           |
| **Wi-Fi Direct** | Device → Phone (P2P Wi-Fi) → Cloud | Fast bulk transfer without a Wi-Fi network |
| **WiFi Upload**  | Device → Wi-Fi Network → Cloud     | Stationary setups with reliable Wi-Fi      |
| **4G Upload**    | Device → Cellular Network → Cloud  | Field work with no Wi-Fi or phone          |

### Bluetooth Sync

The device transfers recordings to the companion mobile app over Bluetooth Low Energy. The app then uploads to the Bota cloud. This is the default method for all devices and works in any environment where a paired phone is within range.

```mermaid theme={null}
sequenceDiagram
    participant D as Device
    participant P as Phone App
    participant C as Bota Cloud

    D->>P: Transfer recording over BLE
    P->>C: Upload to S3
    C-->>P: Upload complete
    P-->>D: Confirm & delete from device
```

* Supported on **all devices**
* Typical range: \~10 meters
* Transfer speed depends on Bluetooth connection quality

### Wi-Fi Direct

The device creates a peer-to-peer Wi-Fi connection with the companion app — no Wi-Fi router needed. This provides faster transfer speeds than BLE, making it useful for syncing large recordings or batch transfers.

```mermaid theme={null}
sequenceDiagram
    participant D as Device
    participant P as Phone App
    participant C as Bota Cloud

    D->>P: P2P Wi-Fi connection (no router)
    D->>P: Transfer recording over Wi-Fi Direct
    P->>C: Upload to S3
    C-->>P: Upload complete
    P-->>D: Confirm & delete from device
```

* Supported on **all devices**
* Faster than BLE; no network infrastructure required
* Initiated from the companion app

### WiFi Upload

The device connects to a Wi-Fi network and uploads recordings directly to the Bota cloud, bypassing the phone entirely. Wi-Fi credentials are configured through the [WiFi Config Grant](/api-reference/devices/wifi-config-grant) flow via BLE.

```mermaid theme={null}
sequenceDiagram
    participant D as Device
    participant W as Wi-Fi Network
    participant C as Bota Cloud

    D->>W: Connect to Wi-Fi AP
    D->>C: Upload recording to S3
    C-->>D: Upload complete
```

* Supported on **all devices**
* Lowest latency for direct upload when Wi-Fi is available
* Ideal for desk setups, clinics, and offices

### 4G Upload

The device uses its built-in cellular modem to upload recordings directly to the cloud. No phone or Wi-Fi needed — the device operates fully independently.

```mermaid theme={null}
sequenceDiagram
    participant D as Device
    participant T as Cellular Network
    participant C as Bota Cloud

    D->>T: Connect via 4G modem
    D->>C: Upload recording to S3
    C-->>D: Upload complete
```

* Supported on **Bota Pin** and **Bota Pin Pro**
* Works anywhere with cellular coverage
* See [Cellular Mode](/guides/cellular-mode) for data management and configuration

## Device Support Matrix

| Method         | Bota Pin | Bota Pin Pro | Bota Note |
| -------------- | -------- | ------------ | --------- |
| Bluetooth Sync | Yes      | Yes          | Yes       |
| Wi-Fi Direct   | Yes      | Yes          | Yes       |
| WiFi Upload    | Yes      | Yes          | Yes       |
| 4G Upload      | Yes      | Yes          | —         |

## How Connectivity Works

Devices self-manage their network connections based on configured preferences. You control the behavior through [device settings](/api-reference/devices/update) — the device handles the rest.

```mermaid theme={null}
stateDiagram-v2
    [*] --> CheckConnections
    CheckConnections --> WiFi: WiFi configured
    CheckConnections --> Cellular: No WiFi, 4G available
    CheckConnections --> BLE: No WiFi or 4G
    WiFi --> Upload: Connected
    Cellular --> Upload: Connected
    Bluetooth --> PhoneSync: Phone in range
    WiFi --> Cellular: WiFi failed
    Cellular --> BLE: 4G failed
    Upload --> [*]: Complete
    PhoneSync --> [*]: Complete
```

### Configuration

Upload behavior is configurable per device via the [Update Device](/api-reference/devices/update) endpoint:

| Setting                                         | Description                                                        |
| ----------------------------------------------- | ------------------------------------------------------------------ |
| `settings.connection.enabled_connections`       | Which connection types are active (e.g., `["wifi", "cellular"]`)   |
| `settings.connection.upload_network_preference` | Ordered priority for uploads (e.g., `["wifi", "cellular", "ble"]`) |
| `settings.connection.power_management`          | Idle timeouts for WiFi and cellular radios                         |
| `settings.upload.streaming_enabled`             | Enable real-time chunk upload during recording                     |
| `settings.upload.allow_roaming`                 | Allow cellular upload while roaming                                |
| `settings.upload.daily_data_limit_mb`           | Cap daily cellular data usage                                      |

### Automatic Failover

When the preferred connection is unavailable, the device falls back to the next option in `upload_network_preference`. For example, with `["wifi", "cellular", "ble"]`:

1. Try WiFi — if connected and reachable, upload over WiFi
2. Fall back to 4G — if WiFi is unavailable or fails
3. Fall back to Bluetooth — wait for phone to come in range and sync

Failover is automatic and transparent. The device resumes interrupted uploads when connectivity returns.

## Related

* [Cellular Mode](/guides/cellular-mode) — 4G data management, SIM provisioning, power optimization
* [Streaming Upload](/guides/streaming-upload) — Real-time upload during recording
* [Device Management](/guides/device-management) — Register, configure, and monitor devices
* [WiFi Config Grant](/api-reference/devices/wifi-config-grant) — Configure WiFi credentials via BLE
