Skip to content

Instantly share code, notes, and snippets.

@DfKimera
Created May 20, 2017 18:17
Show Gist options
  • Save DfKimera/4d736cfe06376f946b0750b23fad2484 to your computer and use it in GitHub Desktop.
Save DfKimera/4d736cfe06376f946b0750b23fad2484 to your computer and use it in GitHub Desktop.
Testing NodeMCU wi-fi capabilities
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
const char *ssid = "ESPap";
const char *password = "thereisnospoon";
ESP8266WebServer server(80);
void handleRoot() {
server.send(200, "text/html", "<h1>You are connected</h1>");
}
void setup() {
delay(1000);
Serial.begin(115200);
Serial.println();
Serial.print("Configuring access point...");
WiFi.softAP(ssid, password);
IPAddress myIP = WiFi.softAPIP();
Serial.print("AP IP address: ");
Serial.println(myIP);
server.on("/", handleRoot);
server.begin();
Serial.println("HTTP server started");
}
void loop() {
server.handleClient();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment