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

# Wi-Fi and Bluetooth BLE Connectivity on Proton AI Core

> Connect Proton AI Core to Wi-Fi networks and use Bluetooth 5.0 BLE to communicate wirelessly with sensors, mobile apps, and other devices.

Proton AI Core's ESP32-S3 integrates 2.4 GHz Wi-Fi (802.11 b/g/n) and Bluetooth 5.0 with BLE support directly on the module — no external radio hardware required. This means you can stream camera images over HTTP, push sensor data to the cloud, or communicate with a mobile app over BLE, all from the same chip that runs your AI model.

<Tabs>
  <Tab title="Wi-Fi">
    ## Connecting to Wi-Fi

    The Arduino `WiFi.h` library included with the ESP32 board package handles connection management. Call `WiFi.begin()` with your network credentials and poll `WiFi.status()` until the connection is established.

    ```cpp wifi_connect.cpp theme={null}
    #include <WiFi.h>

    const char* ssid     = "YourNetworkName";
    const char* password = "YourPassword";

    void setup() {
      Serial.begin(115200);
      WiFi.begin(ssid, password);

      Serial.print("Connecting to Wi-Fi");
      while (WiFi.status() != WL_CONNECTED) {
        delay(500);
        Serial.print(".");
      }
      Serial.println();
      Serial.print("Connected! IP address: ");
      Serial.println(WiFi.localIP());
    }

    void loop() {}
    ```

    ## HTTP GET Request

    Once connected, use the `HTTPClient` library to fetch data from a remote server. The library handles connection setup, request formatting, and response parsing for you.

    ```cpp http_get.cpp theme={null}
    #include <WiFi.h>
    #include <HTTPClient.h>

    void fetchData() {
      if (WiFi.status() == WL_CONNECTED) {
        HTTPClient http;
        http.begin("http://api.example.com/data");
        int httpCode = http.GET();
        if (httpCode > 0) {
          String payload = http.getString();
          Serial.println(payload);
        }
        http.end();
      }
    }
    ```

    ## Sending Camera Images via HTTP POST

    You can combine the camera driver with `HTTPClient` to capture a JPEG frame and upload it directly to a server endpoint in a single function. This pattern is useful for remote monitoring, cloud-based AI processing, or building a timelapse pipeline. Grab a frame buffer with `esp_camera_fb_get()`, POST the raw JPEG bytes with the `image/jpeg` content type, then release the buffer.

    For a complete working sketch, see [Wi-Fi Image Upload](/guides/examples#example-2-wi-fi-image-upload) in the Examples page.
  </Tab>

  <Tab title="Bluetooth">
    ## BLE Server Example

    The ESP32 Arduino core includes a full BLE stack. The example below sets up Proton AI Core as a BLE peripheral that advertises a custom service and sends a notification to connected clients every two seconds.

    ```cpp ble_server.cpp theme={null}
    #include <BLEDevice.h>
    #include <BLEServer.h>
    #include <BLEUtils.h>
    #include <BLE2902.h>

    #define SERVICE_UUID        "4fafc201-1fb5-459e-8fcc-c5c9c331914b"
    #define CHARACTERISTIC_UUID "beb5483e-36e1-4688-b7f5-ea07361b26a8"

    BLECharacteristic *pCharacteristic;

    void setup() {
      Serial.begin(115200);
      BLEDevice::init("ProtonAICore");
      BLEServer *pServer = BLEDevice::createServer();
      BLEService *pService = pServer->createService(SERVICE_UUID);

      pCharacteristic = pService->createCharacteristic(
          CHARACTERISTIC_UUID,
          BLECharacteristic::PROPERTY_READ |
          BLECharacteristic::PROPERTY_NOTIFY);
      pCharacteristic->addDescriptor(new BLE2902());
      pService->start();

      BLEAdvertising *pAdvertising = BLEDevice::getAdvertising();
      pAdvertising->addServiceUUID(SERVICE_UUID);
      pAdvertising->start();
      Serial.println("BLE advertising started");
    }

    void loop() {
      pCharacteristic->setValue("Hello BLE");
      pCharacteristic->notify();
      delay(2000);
    }
    ```

    <Tip>
      Use a BLE scanner app (e.g., **nRF Connect** for iOS or Android) on your phone to verify the BLE advertisement is visible and to read the characteristic value without writing any client code.
    </Tip>
  </Tab>
</Tabs>
