All guides

Control an ESP32 over Bluetooth from your iPhone (no WiFi needed)

Not every project lives near a router. Interior lights in a car, a robot at a field day, a demo on a school desk, a sensor rig in a shed: the ESP32 has Bluetooth built in, and sometimes that is all you have.

Plynx now supports direct Bluetooth (BLE) control: your iPhone talks straight to the board. No WiFi network, no server, no account in the middle. It ships as a beta in Plynx 1.2.2 for iOS.

How it works

Over WiFi, Plynx normally works through a small server: the board connects out, the app connects too, and the server relays pins both ways. That is what gives you remote access, history and push notifications.

Bluetooth mode skips all of it. The board advertises a BLE service, the app scans, connects, and proves it belongs to your project with the same token the sketch carries. From there, widgets read and write pins exactly like they do over WiFi. Local, phone to board, nothing else involved.

Set it up in three steps

1. Add the board in the app. On the Boards tab, tap +, pick ESP32, and choose Bluetooth instead of WiFi. The app creates the project and shows you a sketch with your token already inside.

2. Flash the sketch. Copy it into the Arduino IDE (with the Plynx library installed) and upload. This is the whole firmware:

esp32-plynx-ble.ino
#define PLYNX_USE_DIRECT_CONNECT
#define PLYNX_PRINT Serial

#include <PlynxSimpleEsp32_BLE.h>
#include <BLEDevice.h>
#include <BLEServer.h>

char auth[] = "YOUR_TOKEN"; // the app fills this in for you

#define LED_PIN 2

PLYNX_WRITE(V1) {
  digitalWrite(LED_PIN, param.asInt());
}

void setup() {
  Serial.begin(115200);
  pinMode(LED_PIN, OUTPUT);
  Plynx.setDeviceName("MyBoard");
  Plynx.begin(auth);
}

void loop() {
  Plynx.run();
}

3. Connect. Back in the app, your board shows up in the nearby list. Tap it, and the starter Button widget on V1 toggles the onboard LED. Once a board has been paired, reopening its project reconnects automatically.

What Bluetooth mode is for

It is the right tool when the project is physically near you and WiFi is absent or annoying:

  • car and camper electronics
  • portable and battery projects
  • demos, classrooms, workshops
  • quick bench testing before a board earns a WiFi setup

What it is not

Bluetooth is a local, one phone to one board link. There is no remote access from outside BLE range, no data history, and no push notifications, because there is no server keeping watch. For irrigation controllers, water tanks and anything you want to check from anywhere, the WiFi and server path remains the way to go, and both modes coexist in the same app.

Status

Bluetooth mode is a beta in Plynx 1.2.2 for iOS. It targets the ESP32 today (the chip with BLE on board); the device side lives in the open source Plynx library, with more profiles planned. If you try it and something misbehaves, tell us at plynx.cc@gmail.com: beta means we read every report.

New to Plynx? Start with the getting started guide or the FAQ.