add dummy webserver

This commit is contained in:
Cedric Girard 2019-07-31 15:44:31 +02:00
parent bd35a357a1
commit 5d263b9657
Signed by: X-dark
GPG key ID: E7D0E125DB9519E4

View file

@ -4,6 +4,7 @@
#include <WiFi.h>
#include "wifi_login.h"
#include <WebServer.h>
#include <U8g2lib.h>
@ -15,6 +16,8 @@
#include <Adafruit_SGP30.h>
WebServer server(80);
Preferences preferences;
U8G2_SSD1327_WS_128X128_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 17, /* dc=*/ 3, /* reset=*/ 16);
@ -99,6 +102,14 @@ void setup() {
u8g2log.print("\n");
u8g2log.print("\n");
//Init Server
server.onNotFound(
[]() {
server.send(404, "text/plain", "Content not found\n");
}
);
server.begin();
//Init BME280 sensor
Wire.begin();
@ -167,6 +178,8 @@ int elapsed_minutes = 0;
int elapsed_hours = 0;
void loop() {
server.handleClient();
//Clear screen
u8g2log.print("\f");