Commit 847f7b2e authored by Eric Duminil's avatar Eric Duminil
Browse files

Works (Password 12345678) but still blocking

parent 80a71660
Pipeline #5894 failed with stage
in 1 minute and 24 seconds
......@@ -84,29 +84,14 @@ void setup() {
#endif
#ifdef AMPEL_WIFI
wifi::connect(ampel.sensorId);
// wifi::connect(ampel.sensorId);
Serial.print(F("WiFi - Status: "));
Serial.println(WiFi.status());
// Serial.print(F("WiFi - Status: "));
// Serial.println(WiFi.status());
if (WiFi.status() == WL_CONNECTED) {
# ifdef AMPEL_HTTP
web_server::initialize();
web_server::initialize();
# endif
ntp::initialize();
if (MDNS.begin(ampel.sensorId)) { // Start the mDNS responder for SENSOR_ID.local
MDNS.addService("http", "tcp", 80);
Serial.println(F("mDNS responder started"));
} else {
Serial.println(F("Error setting up MDNS responder!"));
}
# ifdef AMPEL_MQTT
mqtt::initialize(ampel.sensorId);
# endif
}
#endif
#if defined(AMPEL_LORAWAN) && defined(ESP32)
......@@ -199,19 +184,8 @@ void checkFlashButton() {
void keepServicesAlive() {
#ifdef AMPEL_WIFI
if (WiFi.status() == WL_CONNECTED) {
# if defined(ESP8266)
//NOTE: Sadly, there seems to be a bug in the current MDNS implementation.
// It stops working after 2 minutes. And forcing a restart leads to a memory leak.
MDNS.update();
# endif
ntp::update(); // NTP client has its own timer. It will connect to NTP server every 60s.
# ifdef AMPEL_HTTP
web_server::update();
web_server::update();
# endif
# ifdef AMPEL_MQTT
mqtt::keepConnection(); // MQTT client has its own timer. It will keep alive every 15s.
# endif
}
#endif
}
......@@ -35,8 +35,11 @@ namespace web_server {
WebServer http(80);
#endif
AutoConnect PORTAL(http);
void update() {
http.handleClient(); // Listen for HTTP requests from clients
PORTAL.handleClient();
// http.handleClient(); // Listen for HTTP requests from clients
}
void initialize() {
......@@ -183,7 +186,8 @@ namespace web_server {
http.on("/delete_csv", HTTP_POST, handleDeleteCSV);
#endif
http.onNotFound(handlePageNotFound);
http.begin();
// http.begin();
PORTAL.begin();
Serial.print(F("You can access this sensor via http://"));
Serial.print(ampel.sensorId);
......
......@@ -7,6 +7,7 @@
# include <WebServer.h>
#endif
#include "src/lib/AutoConnect/AutoConnect.h"
#include "config.h"
#include "util.h"
#include "wifi_util.h"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment