Skip to content

Instantly share code, notes, and snippets.

@shahriarshafin
Created April 18, 2021 17:21
Show Gist options
  • Save shahriarshafin/61fc4a2e7a127172327512919800667f to your computer and use it in GitHub Desktop.
Save shahriarshafin/61fc4a2e7a127172327512919800667f to your computer and use it in GitHub Desktop.
// open Serial Monitor and Set baud rate 115200
#include <ESP8266WiFi.h>
WiFiClient client;
WiFiServer server(80);
const char* ssid = "Network Unavailable";
const char* password = "dontshare";
void setup()
{
Serial.begin(115200);
connectWiFi();
server.begin();
}
void loop()
{
}
void connectWiFi()
{
Serial.println("Connecting to WIFI");
WiFi.begin(ssid, password);
while ((!(WiFi.status() == WL_CONNECTED)))
{
delay(300);
Serial.print("..");
}
Serial.println("");
Serial.println("WiFi connected");
Serial.println("NodeMCU Local IP is : ");
Serial.print((WiFi.localIP()));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment