Skip to content

Commit

Permalink
Merge pull request esp8266#2649 from WereCatf/WiFiClientExamples
Browse files Browse the repository at this point in the history
Use WIFI_STA in WiFiClient-examples
  • Loading branch information
igrr authored Nov 14, 2016
2 parents 2f9b13c + d46d742 commit 7ccafad
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libraries/ESP8266WiFi/examples/WiFiClient/WiFiClient.ino
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ void setup() {
Serial.print("Connecting to ");
Serial.println(ssid);

/* Explicitly set the ESP8266 to be a WiFi-client, otherwise, it by default,
would try to act as both a client and an access-point and could cause
network-issues with your other WiFi-devices on your WiFi-network. */
WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password);

while (WiFi.status() != WL_CONNECTED) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ void setup() {

WiFi.onEvent(WiFiEvent);

/* Explicitly set the ESP8266 to be a WiFi-client, otherwise, it by default,
would try to act as both a client and an access-point and could cause
network-issues with your other WiFi-devices on your WiFi-network. */
WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password);

Serial.println();
Expand Down

0 comments on commit 7ccafad

Please sign in to comment.