2020年10月19日 星期一

ESP32 Auto Connected WIFI

 利用手機WIFI 來使ESP32 自動連上WIFI 

ESP32 --> SSID : esp32ap  Pass:12345678




查IP位置 ESP32 AP  Gate Way  172.217.28.1  IP:  172.217.28.2  

AutoConnect root URL via http://{localIP}/_ac. (eg. http://172.217.28.1/_ac) 

進入AtuoConnect   172.217.28.1/_ac

進入root URL後畫面
  • 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.

進入Configure new AP 連結到你的SSID 
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();

}






沒有留言:

張貼留言

零成本學 ESP32!在 Wokwi 打造你的第一個微型氣象站 (ESP32 + DHT22 + 1602 LCD)

零成本學 ESP32!在 Wokwi 打造你的第一個微型氣象站(溫度 濕度) (ESP32 + DHT22 + 1602 LCD) 想學物聯網(IoT)與 ESP32 電子實作,卻擔心接線與電壓規範搞砸嗎?透過強大的線上模擬器 Wokwi ,我們不需要花費任何硬體費用,打開瀏覽器...