Wi-Fi DISCUSSION

What is the best way to get Wi-Fi credentials onto a headless ESP32 product: SoftAP, BLE or SmartConfig?

Started by djmad Wi-Fi provisioningSoftAP captive portalBLE provisioningSmartConfigheadless IoT device
4 replies 248 views 5 participants
Latest activity · 30 Sep 2026

What is the best way to get Wi-Fi credentials onto a headless ESP32 product: SoftAP, BLE or SmartConfig?

djmad Wi-Fi Forum
#1

I am turning an ESP32 prototype into a small product. Until now the SSID and password have been hard-coded in the firmware, which obviously cannot ship. The device has no display and only one button.

I have seen SoftAP with a web page, provisioning over Bluetooth LE, SmartConfig and WPS mentioned. How do these work, what are the trade-offs for end users, and how should the credentials be stored and reset?

Community replies 4

Re: What is the best way to get Wi-Fi credentials onto a headless ESP32 product: SoftAP, BLE or SmartConfig?

#2

SoftAP provisioning: the unconfigured device starts its own access point. The user joins that network with a phone or laptop, and a small web server on the device (usually behind a captive portal, so the page pops up automatically) shows a form, often with a scan list of nearby networks. The device saves the credentials, shuts the access point down and joins the home network.

Its strength is that it needs no app, only a browser. The weaknesses are in usability: the phone has to leave its normal Wi-Fi, some phones drop a network that has no internet access, and if the password was typed wrongly the user gets no feedback, because the access point has already disappeared. Keeping AP and station mode active together until the connection is confirmed solves the last problem.

Re: What is the best way to get Wi-Fi credentials onto a headless ESP32 product: SoftAP, BLE or SmartConfig?

#3

BLE provisioning: the device advertises over Bluetooth Low Energy and a phone app sends the credentials over an encrypted BLE session. The phone stays on its own Wi-Fi the whole time, the device can report back "connected" or "wrong password" over the same link, and the app can show the device's scan list.

This gives the smoothest experience, but it needs a chip with BLE (the original ESP32, the C3, S3 and C6 have it; the S2 does not) and an app on both phone platforms. Espressif's provisioning component and its companion apps cover the protocol side.

Re: What is the best way to get Wi-Fi credentials onto a headless ESP32 product: SoftAP, BLE or SmartConfig?

#4

SmartConfig and similar schemes work without any connection to the device. The phone app, while connected to the home network, sends a stream of UDP packets in which the SSID and password are encoded in the packet lengths. The unconfigured device listens in promiscuous mode on each channel; it cannot decrypt the frames, but it can see their lengths and so recovers the data.

It is convenient when it works, but it fails when the phone is on 5 GHz and the device only has 2.4 GHz, with some mesh systems and with client isolation, and the basic form exposes the credentials to anyone listening unless an additional encryption key is used. WPS is best avoided: many routers ship with it disabled, and it has a history of security weaknesses.

Re: What is the best way to get Wi-Fi credentials onto a headless ESP32 product: SoftAP, BLE or SmartConfig?

#5

Whichever transport you choose, the security and storage details are the same. Protect the provisioning session with a secret that a nearby attacker does not have: a per-device proof-of-possession code or QR code printed on the label, rather than an open access point or a fixed PIN shared by all units. Accept provisioning only for a limited time after power-up or after a button press.

Store the credentials in non-volatile storage, never in the source, and provide a factory reset: holding the button for several seconds should erase them and return to provisioning mode. If the saved network is unavailable, keep retrying with backoff instead of dropping into provisioning mode immediately, otherwise a router reboot leaves every device sitting in AP mode.

TEP COMMUNITY