Skip to content

Instantly share code, notes, and snippets.

@ruten-proteus
Last active September 9, 2019 08:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ruten-proteus/ebd9350cc4b6f4eca135d6c0e9607577 to your computer and use it in GitHub Desktop.
Save ruten-proteus/ebd9350cc4b6f4eca135d6c0e9607577 to your computer and use it in GitHub Desktop.
ESP8266 WPS 功能測試
#include <ESP8266WiFi.h>
void setup(void)
{
Serial.begin(115200);
Serial.println();
Serial.printf("Wi-Fi mode set to WIFI_STA %s\n", WiFi.mode(WIFI_STA) ? "" : "Failed!");
Serial.print("Begin WPS (press WPS button on your router) ... ");
Serial.println(WiFi.beginWPSConfig() ? "Success" : "Failed");
while (WiFi.status() != WL_CONNECTED)
{
delay(500);
Serial.print(".");
}
Serial.println();
Serial.print("Connected, IP address: ");
Serial.println(WiFi.localIP());
}
void loop() {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment