利用手機WIFI 來使ESP32 自動連上WIFI
ESP32 --> SSID : esp32ap Pass:12345678
AutoConnect root URL via
http://{localIP}/_ac
. (eg. http://172.217.28.1/_ac
) - Configure new AP: Configure SSID and Password for new access point.
- Open SSIDs: Opens the past SSID which has been established connection from the flash.
- Disconnect: Disconnects current connection.
- Reset...: Rest the ESP8266/ESP32 module.
- Update: OTA updates. (Optional)
- HOME: Return to user home page.
Apply 後 查看 ESP32 GateWay 變成192.168.1.1 IP : 192.168.1.100
已經連上74170287 SSID了
- HOME: Return to user home page.
- 172.217.28.1 root home page
- void rootPage() {
- char content[] = "Hello, world";
- Server.send(200, "text/plain", content);
- }
Arduino ESP32 程式
#include <WiFi.h>
#include <WebServer.h>
#include <AutoConnect.h>
WebServer Server;
AutoConnect Portal(Server);
void rootPage() {
char content[] = "Hello, world";
Server.send(200, "text/plain", content);
}
void setup() {
delay(1000);
Serial.begin(115200);
Serial.println();
Server.on("/", rootPage);
if (Portal.begin()) {
Serial.println("HTTP server:" + WiFi.localIP().toString());
}
}
void loop() {
Portal.handleClient();
}
沒有留言:
張貼留言