How to control an ESP32 from your iPhone (2026 guide)
The ESP32 is the default brain for hobby electronics in 2026: WiFi and Bluetooth on board, dual core, a few euros per module. The iPhone is the computer you always have in your pocket. Getting the two to talk should be trivial, and yet the first search result usually sends you down a rabbit hole of half-abandoned GitHub repos and cloud platforms that want a credit card.
This guide covers every practical approach, with honest tradeoffs, and then walks through the fastest one end to end. By the end you will be toggling a GPIO from your phone and reading a sensor in real time.
The four ways to do it
1. Serve a web page from the ESP32
The classic approach: run a tiny HTTP server on the board itself and open its
IP address in Safari. Libraries like ESPAsyncWebServer make this a weekend
project, and it needs no external services at all.
The catch is that you are now a frontend developer. Every button, every chart, every bit of state synchronization is HTML and JavaScript you write and embed in flash memory. It works on your home network only, unless you also want to become a VPN administrator, and there is no push, no widgets, no watch app. Great for learning, tedious for anything with more than two controls.
2. HomeKit or Matter
Projects like HomeSpan let an ESP32 pretend to be a HomeKit accessory, and
Matter support on the ESP32 family keeps improving. If your project is a light
switch or a thermostat, this is a genuinely nice route: Siri, automations and
the Home app for free.
The limitation is the accessory model. HomeKit thinks in lights, locks and sensors. It has no concept of “show me a live chart of the last ten minutes of pump current” or “give me a slider for PWM duty cycle”. The moment your project stops looking like a smart home product, you are fighting the framework.
3. MQTT plus a dashboard app
Run an MQTT broker (Mosquitto on a Raspberry Pi, or a public broker), publish readings from the ESP32, and point a generic MQTT dashboard app at it. This is the most flexible architecture and it scales to dozens of devices.
It is also the most moving parts: a broker to maintain, topics to design, retained messages and QoS levels to understand, and the dashboard apps on iOS are mostly generic MQTT clients, so the UI polish varies a lot. If you already run Home Assistant, this ecosystem is where you probably live. If you just want your project on your phone this afternoon, it is a lot of yak shaving.
4. A dedicated IoT dashboard app
The fourth route is an app built specifically for this job: you drag widgets onto a canvas on the phone, each widget binds to a pin, and a small library on the ESP32 keeps a socket open to sync pin state both ways. No HTML on the board, no broker to configure, no accessory model to fit into.
This was the approach popularized by the classic Blynk platform years ago, and it remains the fastest path from bare board to polished dashboard. Plynx is a modern, free iOS app that takes this route: native widgets, Home Screen and Lock Screen widgets, an Apple Watch app, and a server you can self-host on a Raspberry Pi so nothing leaves your network.
Here is the whole setup, for real, not a sketch of it.
Step by step: ESP32 to iPhone in 15 minutes
What you need
- An ESP32 dev board (any of them: WROOM, S3, C3, a NodeMCU-style clone is fine)
- An iPhone with Plynx installed, free
- The Arduino IDE with the ESP32 core installed
Create the project in the app
Open Plynx, register (the free public cloud is the default server, you can
move to your own Raspberry Pi later), and create a project. Add a Button
widget and bind it to virtual pin V1. Add a Gauge and bind it to V2.
In the project settings you will find the auth token. That string is how your board identifies itself, so keep it handy.
The two widgets you just added behave like this (live demo, click around):
Install the device library
Install the Plynx library: download the ZIP from GitHub and add it via Sketch, Include Library, Add .ZIP Library. Because Plynx speaks the classic Blynk Legacy protocol, existing Blynk-legacy sketches port over by swapping the includes and the object name.
Flash this sketch
#define PLYNX_PRINT Serial
#include <WiFi.h>
#include <PlynxSimpleEsp32.h>
char auth[] = "YOUR_AUTH_TOKEN";
char ssid[] = "YOUR_WIFI";
char pass[] = "YOUR_WIFI_PASSWORD";
PlynxTimer timer;
// Button on V1 drives the onboard LED
PLYNX_WRITE(V1) {
digitalWrite(LED_BUILTIN, param.asInt());
}
// Push a reading to the Gauge on V2 every 2 seconds
void sendReading() {
Plynx.virtualWrite(V2, analogRead(34));
}
void setup() {
Serial.begin(115200);
pinMode(LED_BUILTIN, OUTPUT);
Plynx.begin(auth, ssid, pass); // default server: yes.plynx.cc
timer.setInterval(2000L, sendReading);
}
void loop() {
Plynx.run();
timer.run();
} Open the Serial Monitor. Within a few seconds you should see Ready, and the
device dot in the app turns green. Tap the button: the LED follows your
finger. The gauge starts moving with whatever is on GPIO 34.
That is the whole mental model: widgets talk to pins, your code reads and writes pins. Charts, sliders, joysticks, the RGB picker and the terminal all work the same way.
Go further
- Add a Home Screen widget on the iPhone to toggle
V1without opening the app. Genuinely useful for garage doors and lights. - Put your battery voltage on the Lock Screen.
- Open the Apple Watch app and flip the same switch from your wrist.
- When the WiFi drops, the dashboard keeps showing the last known values instead of a spinner.
Which approach should you pick?
If your project is a smart home accessory, use HomeKit or Matter and enjoy Siri. If you are deep in the Home Assistant world already, MQTT is your native tongue. If you want to learn web development on microcontrollers, serve your own page.
For everything else, a dedicated dashboard app is the shortest path by a wide margin, and it is the only one that gets you native iOS niceties like widgets and a watch app without writing a single line of Swift.
Plynx is free, has no ads and no device limits, and if you care about privacy you can point it at your own server and keep every byte on your LAN. Grab it from the App Store, flash the sketch above, and your ESP32 is on your phone before your soldering iron cools down.