Run an Access Point Setup Page
Let users enter WiFi credentials from a phone.
Run an Access Point Setup Page is a free Arduino & IoT Academy lesson on CoddyKit — lesson 4 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Arduino & IoT Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
The Chicken-and-Egg Problem
How does a device with no screen learn your WiFi password? You cannot hardcode it for every user. Access Point mode solves this. 🥚
The Board Becomes the Host
In Access Point mode, the ESP creates its own WiFi network instead of joining one. Your phone connects directly to the board.
Set AP Mode
Switch roles with WiFi.mode() set to access point. Now the chip broadcasts a network rather than searching for one.
WiFi.mode(WIFI_AP);Name Your Hotspot
Create the network with WiFi.softAP(), giving it a name your users will recognize, like SmartSensor-Setup.
WiFi.softAP("SmartSensor-Setup");An Optional Password
You can add a password to softAP so only trusted people connect. Leave it open only for quick, local testing.
WiFi.softAP("SmartSensor-Setup", "config1234");The Board Gets an IP
As the host, your ESP picks its own IP address, often 192.168.4.1. Users type that into a browser to reach the page.
Serial.println(WiFi.softAPIP());Serve a Web Page
A small built-in WebServer hands out an HTML form. That form is where the user types their home WiFi details.
#include <WebServer.h>
WebServer server(80);Define a Route
Tell the server what to show at the root path using server.on(). This links the address slash to your setup form.
server.on("/", handleRoot);Keep It Listening
Inside loop() you call server.handleClient() on every pass. This is what answers each visitor's request promptly.
void loop() {
server.handleClient();
}Capture and Save
When the user submits, you read the typed credentials and store them so the device can join their network next boot.
This Is a Captive Portal
That self-hosted setup screen is called a captive portal. It is exactly how smart plugs and bulbs onboard onto your WiFi.
Quick Check
What is the main reason a device runs its own Access Point at first boot?
Recap
You hosted a setup hotspot: set AP mode, called softAP, served a form on a WebServer, and captured the user's WiFi details. 🎉
Frequently asked questions
Is the “Run an Access Point Setup Page” lesson free?
Yes — the full text of “Run an Access Point Setup Page” is free to read here on the web, and the Arduino & IoT Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Arduino & IoT Academy course, upgrade to CoddyKit PRO.
What will I learn in “Run an Access Point Setup Page”?
Let users enter WiFi credentials from a phone. You practise Arduino & IoT Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Arduino & IoT Academy?
No prior experience is required. Arduino & IoT Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 4 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Run an Access Point Setup Page” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Arduino & IoT Academy lesson?
Yes. Every Arduino & IoT Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- Why ESP32 & ESP8266 for IoT
- Add ESP Boards to the IDE
- Connect to WiFi in Station Mode
- Run an Access Point Setup Page