From 2ff25a9b42fe7469e104b62ae6bf67c3c7cf1d29 Mon Sep 17 00:00:00 2001 From: ezn Date: Thu, 24 Aug 2023 18:58:22 +0100 Subject: [PATCH] Add 'ino_out/web--txt' --- ino_out/web--txt | 65 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 ino_out/web--txt diff --git a/ino_out/web--txt b/ino_out/web--txt new file mode 100644 index 0000000..8394a45 --- /dev/null +++ b/ino_out/web--txt @@ -0,0 +1,65 @@ +#include +#include +#include + +const char* ssid = "mathematics"; +const char* password = "fzbyj8r7pdEk"; + +ESP8266WebServer server(7000); + +String page = ""; +String txt = ""; +String txx = ""; + +void setup() { + + delay(1000); + Serial.begin(115200); + WiFi.begin(ssid, password); + Serial.println(""); + + // wait for connection + while (WiFi.status() != WL_CONNECTED) { + delay(500); + Serial.print("."); + } + Serial.print("connected to "); + Serial.println(ssid); + Serial.print("ip: "); + Serial.println(WiFi.localIP()); + server.on("/txt.txt", []() { + server.send(200, "text/html", txt); + }); + server.on("/", []() { + page = "

txx [ ] -

""

\r\n"; + page += "\r\n"; + server.send(200, "text/html", page); + }); + + server.begin(); + Serial.println("started"); +} + +void loop() { + + while (Serial.available() == 0) {} + String txx = Serial.readStringUntil('\n'); + txt = txx; + Serial.println(txt); + server.handleClient(); +} \ No newline at end of file