example from arduino
per connect to wifi router casa use: HelloServer.cpp
const char* ssid = "telecom...";
const char* password = "";
WiFi.mode(WIFI_STA);
WiFi.begin(ssid, password);
Serial.println("");
// Wait for connection
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
per connect directly use: HelloServer.cpp2
const char *ssid = "esp8266"; // The name of the Wi-Fi network that will be created
const char *password = ""; // The password required to connect to it, leave blank for an open network
if (!MDNS.begin("esp8266")) {
Serial.println("Error setting up MDNS responder!");
while (1) {
delay(1000);
}
}
Serial.println("mDNS responder started");
// Start TCP (HTTP) server
server.begin();
Serial.println("TCP server started");
// Add service to MDNS-SD
MDNS.addService("http", "tcp", 80);