Eine Einrichtungsseite für den Access Point bereitstellen
Ermöglichen Sie Benutzern, WiFi-Zugangsdaten über ein Smartphone einzugeben.
Eine Einrichtungsseite für den Access Point bereitstellen ist eine kostenlose Arduino & IoT Academy-Lektion auf CoddyKit. Dies ist Lektion 4 von 4. Du kannst die komplette Lektion unten kostenlos lesen – dann übst du sie direkt im Browser mit einem integrierten Code-Editor und einem KI-Tutor rund um die Uhr. Sie ist Teil des Arduino & IoT Academy-Lernpfads, und dein Fortschritt wird über Web und CoddyKit-App synchronisiert. Der Arduino & IoT Academy-Kurs umfasst insgesamt 4 Lektionen.
Teile dieser Lektion wurden noch nicht übersetzt und werden auf Englisch angezeigt.
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. 🎉
Häufig gestellte Fragen
Ist die Lektion „Eine Einrichtungsseite für den Access Point bereitstellen“ kostenlos?
Ja — der vollständige Text von „Eine Einrichtungsseite für den Access Point bereitstellen“ ist hier im Web kostenlos zu lesen. Um sie interaktiv zu üben (integrierter Code-Editor und 24/7 KI-Tutor) und den Rest des Arduino & IoT Academy-Kurses freizuschalten, upgrade auf CoddyKit PRO. Der Arduino & IoT Academy-Kurs umfasst insgesamt 4 Lektionen.
Was lerne ich in „Eine Einrichtungsseite für den Access Point bereitstellen“?
Ermöglichen Sie Benutzern, WiFi-Zugangsdaten über ein Smartphone einzugeben. Du übst Arduino & IoT Academy mit praktischem Code, den du direkt im Browser ausführst, und ein 24/7 KI-Tutor beantwortet deine Fragen während du die Lektion bearbeitest.
Brauche ich Erfahrung, um Arduino & IoT Academy zu starten?
Keine Vorkenntnisse erforderlich. Arduino & IoT Academy auf CoddyKit ist für Anfänger bis fortgeschrittene Lernende strukturiert, sodass du hier starten oder von Anfang an beginnen und in deinem eigenen Tempo voranschreiten kannst. Dies ist Lektion 4 von 4.
Wie lange dauert die Lektion „Eine Einrichtungsseite für den Access Point bereitstellen“?
Die meisten CoddyKit-Lektionen dauern etwa 5–10 Minuten. Jede ist kompakt und interaktiv, sodass du stetig Fortschritte machst und genau dort weitermachst, wo du aufgehört hast – im Web und in der App.
Kann ich in dieser Arduino & IoT Academy-Lektion Code schreiben und ausführen?
Ja. Jede Arduino & IoT Academy-Lektion enthält einen integrierten Code-Editor, sodass du echten Code direkt in deinem Browser schreibst und ausführst und sofort KI-Feedback erhältst — ohne lokale Einrichtung erforderlich.
Alle Lektionen in diesem Kurs
- Warum ESP32 und ESP8266 für IoT
- ESP-Boards zur IDE hinzufügen
- Im Stationsmodus mit WiFi verbinden
- Eine Einrichtungsseite für den Access Point bereitstellen