Created
January 9, 2019 10:57
-
-
Save iotguider/0666b931f4c94cce2416e29e5c7426e1 to your computer and use it in GitHub Desktop.
Station mode for Establishing WiFi Connection in ESP8266 WiFi Module
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <ESP8266WiFi.h> | |
const char* ssid = "WiFi_SSID"; //Enter Wi-Fi SSID | |
const char* password = "WiFi_Password"; //Enter Wi-Fi Password | |
void setup() { | |
Serial.begin(115200); //Begin Serial at 115200 Baud | |
WiFi.begin(ssid, password); //Connect to the WiFi network | |
// Connect to the network | |
Serial.print("Connecting to WiFi network..."); | |
while (WiFi.status() != WL_CONNECTED) { //Wait for connection | |
delay(500); | |
Serial.println("Waiting to connect..."); | |
} | |
Serial.println("Connection established"); | |
Serial.print("IP address: "); | |
Serial.println(WiFi.localIP()); //Print the local IP | |
} | |
void loop() { | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment