1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-27 18:02:17 +03:00

Put WiFi into station mode in examples (#3731)

This commit is contained in:
James Stanley
2017-10-22 06:53:01 +01:00
committed by Ivan Grokhotkov
parent 098172c5e4
commit 2abbc36da4
23 changed files with 24 additions and 1 deletions

View File

@ -29,6 +29,7 @@ void setup() {
Serial.println();
Serial.print("connecting to ");
Serial.println(ssid);
WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);

View File

@ -37,6 +37,7 @@ void setup() {
Serial.println();
Serial.print("connecting to ");
Serial.println(ssid);
WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);

View File

@ -49,6 +49,7 @@ void setup()
// We start by connecting to a WiFi network
Serial.print("Connecting to ");
Serial.println(ssid);
WiFi.mode(WIFI_STA);
WiFi.begin(ssid, pass);
while (WiFi.status() != WL_CONNECTED) {

View File

@ -13,6 +13,7 @@ void setup() {
delay(10);
// We start by connecting to a WiFi network
WiFi.mode(WIFI_STA);
WiFiMulti.addAP("SSID", "passpasspass");
Serial.println();

View File

@ -12,6 +12,7 @@ void setup() {
Serial.begin(115200);
delay(10);
WiFi.mode(WIFI_STA);
wifiMulti.addAP("ssid_from_AP_1", "your_password_for_AP_1");
wifiMulti.addAP("ssid_from_AP_2", "your_password_for_AP_2");
wifiMulti.addAP("ssid_from_AP_3", "your_password_for_AP_3");
@ -30,4 +31,4 @@ void loop() {
Serial.println("WiFi not connected!");
delay(1000);
}
}
}

View File

@ -30,6 +30,7 @@ WiFiClient serverClients[MAX_SRV_CLIENTS];
void setup() {
Serial1.begin(115200);
WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password);
Serial1.print("\nConnecting to "); Serial1.println(ssid);
uint8_t i = 0;

View File

@ -30,6 +30,7 @@ void setup() {
Serial.print("Connecting to ");
Serial.println(ssid);
WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {