From 326a7c5cd84f684929d33b4ec805835cb76a9994 Mon Sep 17 00:00:00 2001 From: studentidisinistra Date: Thu, 1 Dec 2022 18:17:17 +0100 Subject: [PATCH] added initial code, empty --- PyCoffeeESP8266/PyCoffeeESP8266.ino | 61 +++++++++++++++++++++++++++++ PyCoffeeNano/PyCoffeeNano.ino | 9 +++++ 2 files changed, 70 insertions(+) create mode 100644 PyCoffeeESP8266/PyCoffeeESP8266.ino create mode 100644 PyCoffeeNano/PyCoffeeNano.ino diff --git a/PyCoffeeESP8266/PyCoffeeESP8266.ino b/PyCoffeeESP8266/PyCoffeeESP8266.ino new file mode 100644 index 0000000..981f398 --- /dev/null +++ b/PyCoffeeESP8266/PyCoffeeESP8266.ino @@ -0,0 +1,61 @@ +#include +#include +#include +#include +#include +#include + +AsyncWebServer server(80); + +// WiFi settings +const char* ssid = "LILiK_WiFi"; //replace with your SSID +const char* password = "pippopippo"; //password +String hostname = "PyCoffee"; + + +// HTML WEB interface +const char index_html[] PROGMEM = R"rawliteral( + + PyCoffee HTML interface + + +

Ciao! Sono l'ESP8266 che gestisce la PyCoffee!

+ + +

Clicca qui sotto per aggiornare il firmware, o il secondo link per il sorgente.

+ ⬆️ OTA Firmware_Update ⬆️ + ☕Gitea☕

+ +)rawliteral"; + +void notFound(AsyncWebServerRequest *request) { + request->send(404, "text/plain", "Not found"); +} + +// the setup function runs once when you press reset or power the board +void setup(void) { + WiFi.mode(WIFI_STA); + // WiFi.config(INADDR_NONE, INADDR_NONE, INADDR_NONE, INADDR_NONE); + WiFi.setHostname(hostname.c_str()); //define hostname + WiFi.begin(ssid, password); + + + // Send web page with input fields to client + server.on("/", HTTP_GET, [](AsyncWebServerRequest * request) { + request->send(200, "text/html", index_html); + }); + + server.onNotFound(notFound); + AsyncElegantOTA.begin(&server); // Start ElegantOTA + server.begin(); + Serial.println("HTTP server started"); +} + +// the loop function runs over and over again forever +void loop() { + +} diff --git a/PyCoffeeNano/PyCoffeeNano.ino b/PyCoffeeNano/PyCoffeeNano.ino new file mode 100644 index 0000000..95c2b6e --- /dev/null +++ b/PyCoffeeNano/PyCoffeeNano.ino @@ -0,0 +1,9 @@ +void setup() { + // put your setup code here, to run once: + +} + +void loop() { + // put your main code here, to run repeatedly: + +}