add Ethernet

This commit is contained in:
proddy
2021-01-18 19:38:22 +01:00
parent b81435e713
commit 44045ae658
60 changed files with 905 additions and 973 deletions

View File

@@ -31,9 +31,6 @@ AsyncWebServer webServer(80);
#if defined(ESP32)
ESP8266React EMSESP::esp8266React(&webServer, &SPIFFS);
WebSettingsService EMSESP::webSettingsService = WebSettingsService(&webServer, &SPIFFS, EMSESP::esp8266React.getSecurityManager());
#elif defined(ESP8266)
ESP8266React EMSESP::esp8266React(&webServer, &LittleFS);
WebSettingsService EMSESP::webSettingsService = WebSettingsService(&webServer, &LittleFS, EMSESP::esp8266React.getSecurityManager());
#elif defined(EMSESP_STANDALONE)
FS dummyFS;
ESP8266React EMSESP::esp8266React(&webServer, &dummyFS);
@@ -1027,11 +1024,9 @@ void EMSESP::send_raw_telegram(const char * data) {
// start all the core services
// the services must be loaded in the correct order
void EMSESP::start() {
// start the file system. We use LittleFS for ESP8266.
#ifdef ESP32
// start the file system
#ifndef EMSESP_STANDALONE
SPIFFS.begin(true);
#elif defined(ESP8266)
LittleFS.begin();
#endif
esp8266React.begin(); // loads system settings (wifi, mqtt, etc)
@@ -1039,25 +1034,11 @@ void EMSESP::start() {
system_.check_upgrade(); // do any upgrades
#if defined(EMSESP_DEBUG)
#ifndef EMSESP_STANDALONE
uint32_t tbefore = ESP.getFreeHeap();
#endif
#endif
// Load our library of known devices into stack mem. Names are stored in Flash memory
// Still it takes up about 960bytes
device_library_.reserve(80);
// Load our library of known devices into stack mem. Names are stored in Flash memory (take about 960bytes)
device_library_ = {
#include "device_library.h"
};
#if defined(EMSESP_DEBUG)
#ifndef EMSESP_STANDALONE
uint32_t tafter = ESP.getFreeHeap();
#endif
#endif
console_.start(); // telnet and serial console
mqtt_.start(); // mqtt init
system_.start(heap_start); // starts syslog, uart, sets version, initializes LED. Requires pre-loaded settings.
@@ -1069,13 +1050,6 @@ void EMSESP::start() {
LOG_INFO(F("EMS Device library loaded with %d records"), device_library_.size());
#if defined(EMSESP_DEBUG)
#ifndef EMSESP_STANDALONE
LOG_INFO(F("Used %d mem for devices"), tbefore - tafter);
System::show_mem("after start()");
#endif
#endif
#if defined(EMSESP_STANDALONE)
Mqtt::on_connect(); // simulate an MQTT connection
#endif