Skip to content

Instantly share code, notes, and snippets.

@noob-master147
Created May 11, 2020 13:24
Show Gist options
  • Save noob-master147/4346f47d4ce8ca845243d37379ba9c1e to your computer and use it in GitHub Desktop.
Save noob-master147/4346f47d4ce8ca845243d37379ba9c1e to your computer and use it in GitHub Desktop.
ESP8266 OTA
#include <ESP8266WiFi.h> // Include the Wi-Fi libraryconst
char* ssid = "SSID"; // The SSID (name) of network to connect
char* password = "PASSWORD"; // The password of the Wi-Fi
void setup() {
Serial.begin(115200); // Start the Serial communication
WiFi.begin(ssid, password); // Connect to the network
Serial.print("Connecting ");
while (WiFi.status() != WL_CONNECTED)
{ // Wait for the Wi-Fi to connect
delay(1000);
Serial.print('.');
}
Serial.println('\n');
Serial.println("Connection established!");
Serial.print("IP address:\t");
Serial.println(WiFi.localIP());
// Send the IP address of the ESP8266 to the computer
}
void loop() {
// Type Your Code
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment