mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-27 06:32:19 +03:00
uart working version
This commit is contained in:
91
src/main.cpp
91
src/main.cpp
@@ -29,116 +29,48 @@ Timings metric;
|
||||
boolean initialized = false;
|
||||
|
||||
void setup() {
|
||||
WiFi.setAutoConnect(false);
|
||||
WiFi.persistent(false);
|
||||
|
||||
Serial.begin(115200);
|
||||
Serial.flush();
|
||||
Serial.println();
|
||||
Serial.println(F("--------------started----------------"));
|
||||
|
||||
setChipId();
|
||||
|
||||
myNotAsyncActions = new NotAsync(do_LAST);
|
||||
myScenario = new Scenario();
|
||||
|
||||
//=========================================initialisation==============================================================
|
||||
setChipId();
|
||||
fileSystemInit();
|
||||
SerialPrint("I", F("FS"), F("FS Init"));
|
||||
|
||||
SerialPrint("I", F("UART"), F("UART Init"));
|
||||
uartInit();
|
||||
|
||||
loadConfig();
|
||||
SerialPrint("I", F("Conf"), F("Config Init"));
|
||||
|
||||
clock_init();
|
||||
SerialPrint("I", F("Time"), F("Clock Init"));
|
||||
|
||||
handle_time_init();
|
||||
SerialPrint("I", F("Time"), F("Handle time init"));
|
||||
|
||||
sensorsInit();
|
||||
SerialPrint("I", F("Sensors"), F("Sensors Init"));
|
||||
|
||||
uartInit();
|
||||
clockInit();
|
||||
timeInit();
|
||||
sensorsInit(); //Will be remooved
|
||||
itemsListInit();
|
||||
SerialPrint("I", F("Items"), F("Items Init"));
|
||||
|
||||
all_init();
|
||||
SerialPrint("I", F("Init"), F("Init Init"));
|
||||
|
||||
espInit();
|
||||
routerConnect();
|
||||
SerialPrint("I", F("WIFI"), F("Network Init"));
|
||||
|
||||
telegramInit();
|
||||
SerialPrint("I", F("Telegram"), F("Telegram Init"));
|
||||
|
||||
uptime_init();
|
||||
SerialPrint("I", F("Uptime"), F("Uptime Init"));
|
||||
|
||||
upgradeInit();
|
||||
SerialPrint("I", F("Update"), F("Updater Init"));
|
||||
|
||||
HttpServer::init();
|
||||
SerialPrint("I", F("HTTP"), F("HttpServer Init"));
|
||||
|
||||
web_init();
|
||||
SerialPrint("I", F("Web"), F("WebAdmin Init"));
|
||||
|
||||
initSt();
|
||||
SerialPrint("I", F("Stat"), F("Stat Init"));
|
||||
|
||||
busInit();
|
||||
#ifdef UDP_ENABLED
|
||||
SerialPrint("I", F("UDP"), "Udp Init");
|
||||
asyncUdpInit();
|
||||
#endif
|
||||
|
||||
SerialPrint("I", F("Bus"), F("Bus Init"));
|
||||
busInit();
|
||||
|
||||
|
||||
|
||||
#ifdef SSDP_ENABLED
|
||||
SerialPrint("I", F("SSDP"), F("Ssdp Init"));
|
||||
SsdpInit();
|
||||
#endif
|
||||
|
||||
//esp_log_level_set("esp_littlefs", ESP_LOG_NONE);
|
||||
|
||||
ts.add(
|
||||
SYGNAL, 1000 * 60, [&](void*) {
|
||||
SerialPrint("I", "System", printMemoryStatus());
|
||||
switch (RSSIquality()) {
|
||||
case 0:
|
||||
jsonWriteStr(configSetupJson, F("signal"), F("Уровень WiFi сигнала: <font color='red'>не подключено к роутеру</font>"));
|
||||
break;
|
||||
case 1:
|
||||
jsonWriteStr(configSetupJson, F("signal"), F("Уровень WiFi сигнала: <font color='red'>нет сигнала</font>"));
|
||||
break;
|
||||
case 2:
|
||||
jsonWriteStr(configSetupJson, F("signal"), F("Уровень WiFi сигнала: <font color='red'>очень низкий</font>"));
|
||||
break;
|
||||
case 3:
|
||||
jsonWriteStr(configSetupJson, F("signal"), F("Уровень WiFi сигнала: <font color='orange'>низкий</font>"));
|
||||
break;
|
||||
case 4:
|
||||
jsonWriteStr(configSetupJson, F("signal"), F("Уровень WiFi сигнала: <font color='green'>хороший</font>"));
|
||||
break;
|
||||
case 5:
|
||||
jsonWriteStr(configSetupJson, F("signal"), F("Уровень WiFi сигнала: <font color='green'>очень хороший</font>"));
|
||||
break;
|
||||
case 6:
|
||||
jsonWriteStr(configSetupJson, F("signal"), F("Уровень WiFi сигнала: <font color='green'>отличный</font>"));
|
||||
break;
|
||||
}
|
||||
},
|
||||
nullptr, true);
|
||||
|
||||
|
||||
|
||||
just_load = false;
|
||||
initialized = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void loop() {
|
||||
if (!initialized) {
|
||||
return;
|
||||
@@ -154,7 +86,6 @@ void loop() {
|
||||
myButtonIn.loop();
|
||||
myScenario->loop();
|
||||
loopCmdExecute();
|
||||
//loopSerial();
|
||||
|
||||
myNotAsyncActions->loop();
|
||||
ts.update();
|
||||
|
||||
Reference in New Issue
Block a user