xxxxxxxxxx
Connecting .
Connected, IP address: 192.168.1.10
xxxxxxxxxx
Enter http://arduino.esp8266.com/stable/package_esp8266com_index.json
into the “Additional Boards Manager URLs” field.
Then, click the “OK” button.
xxxxxxxxxx
#include <ESP8266WiFi.h>
void setup()
{
Serial.begin(115200);
Serial.println();
WiFi.begin("network-name", "pass-to-network");
Serial.print("Connecting");
while (WiFi.status() != WL_CONNECTED)
{
delay(500);
Serial.print(".");
}
Serial.println();
Serial.print("Connected, IP address: ");
Serial.println(WiFi.localIP());
}
void loop() {}
xxxxxxxxxx
Serial.printf("Wi-Fi mode set to WIFI_STA %s\n", WiFi.mode(WIFI_STA) ? "" : "Failed!");
xxxxxxxxxx
Serial.printf("Connection status: %d\n", WiFi.status());
xxxxxxxxxx
Mode: STA+AP
PHY mode: N
Channel: 11
AP id: 0
Status: 5
Auto connect: 1
SSID (10): sensor-net
Passphrase (12): 123!$#0&*esP
BSSID set: 0
xxxxxxxxxx
while (WiFi.status() != WL_CONNECTED)
{
delay(500);
Serial.print(".");
}