The use of the ESP8266 in the world of IoT

User avatar
By Jotaruiz30
#75065 Good morning everyone.
I consult this forum to resolve the following:
I want to make a sketch in which I upload a small HTML web page to my ESP8266. The ESP8266 will share WIFI temporarily as an access point and using the wifi ESP8266 connect me with my computer or my cell and use that page in HTML is you can transfer the name of my WIFI and password of the wifi in my house or my office. Currently all the examples that I have found are like the one I show below and it is loading from the sketch the name of the WIFI to connect and the key of the WIFI.

Part of example code.
.........
#include <ESP8266WiFi.h>
const char * ssid = "mynamewifi";
const char * password = "password";
WiFiServer server (80);
.............

Part of example code of HTML page.
............
  // Header http
    client.println ("HTTP / 1.1 200 OK");
    client.println ("Content-Type: text / html");
    client.println ("Connection: close"); // The connection closes after the end of the response
    client.println ();
    // Page html for in the browser
    client.println ("<! DOCTYPE HTML>");
    client.println ("<html>");
    client.println ("<head> <title> i-House </ title>");
    client.println ("<body>");
    client.println ("<h1 align = 'center'> Test ESP8266 </ h1>");
    client.println ("<div style = 'text-align: center;'>");
    client.println ("<br />");
    client.println ("<button onClick = location.href = '. /? LED = ON'> LED ON </ button>");
    client.println ("<button onClick = location.href = '. /? LED = OFF'> LED OFF </ button>");
    client.println ("<br />");
    client.println ("</ div>");
    client.println ("</ body>");
    client.println ("</ html>");
    
    delay (1);
    Serial.println ("sent response");
    Serial.println ();
............
Is it possible to do it as I propose? :roll:
(translate google translate)