Files
IoTManager/esp32-esp8266_iot-manager_modules_firmware.ino

85 lines
2.0 KiB
Arduino
Raw Normal View History

2019-12-24 11:53:26 +03:00
#include "set.h"
void setup() {
//--------------------------------------------------------------
File_system_init();
2019-12-24 11:53:26 +03:00
Serial.println("SPIFFS_init");
//--------------------------------------------------------------
CMD_init();
Serial.println("[V] CMD_init");
//--------------------------------------------------------------
2020-05-02 12:20:30 +02:00
sensors_init();
Serial.println("[V] sensors_init");
//--------------------------------------------------------------
2019-12-24 11:53:26 +03:00
All_init();
Serial.println("[V] All_init");
//--------------------------------------------------------------
2020-05-28 00:33:26 +02:00
ROUTER_Connecting();
Serial.println("[V] ROUTER_Connecting");
2019-12-24 11:53:26 +03:00
//--------------------------------------------------------------
2020-06-11 22:51:34 +02:00
uptime_init();
2020-03-18 09:57:46 +01:00
Serial.println("[V] statistics_init");
2019-12-24 11:53:26 +03:00
//--------------------------------------------------------------
2020-03-18 09:57:46 +01:00
initUpgrade();
Serial.println("[V] initUpgrade");
//--------------------------------------------------------------
2020-03-20 21:00:11 +01:00
Web_server_init();
Serial.println("[V] Web_server_init");
2019-12-24 11:53:26 +03:00
//--------------------------------------------------------------
2020-06-04 01:08:08 +02:00
web_init();
2020-05-28 00:33:26 +02:00
Serial.println("[V] web_init");
2019-12-24 11:53:26 +03:00
//--------------------------------------------------------------
2020-03-18 09:57:46 +01:00
Time_Init();
Serial.println("[V] Time_Init");
//--------------------------------------------------------------
2020-05-20 02:16:23 +02:00
#ifdef UDP_enable
2020-04-05 01:52:02 +02:00
UDP_init();
Serial.println("[V] UDP_init");
2020-05-20 02:16:23 +02:00
#endif
2020-03-22 22:41:52 +01:00
//--------------------------------------------------------------
2019-12-24 11:53:26 +03:00
2020-04-05 01:52:02 +02:00
ts.add(TEST, 10000, [&](void*) {
2020-03-30 01:45:42 +02:00
getMemoryLoad("[i] periodic check of");
2020-04-05 01:52:02 +02:00
//ws.textAll(json);
2020-03-30 01:45:42 +02:00
}, nullptr, true);
2020-03-18 09:57:46 +01:00
2020-04-05 01:52:02 +02:00
2020-03-22 01:50:31 +01:00
just_load = false;
2019-12-24 11:53:26 +03:00
}
2020-03-18 09:57:46 +01:00
2019-12-24 11:53:26 +03:00
void loop() {
2020-02-10 01:06:18 +03:00
#ifdef OTA_enable
2019-12-24 11:53:26 +03:00
ArduinoOTA.handle();
2020-02-10 01:06:18 +03:00
#endif
2019-12-24 11:53:26 +03:00
2020-02-10 01:06:18 +03:00
#ifdef WS_enable
2019-12-24 11:53:26 +03:00
ws.cleanupClients();
#endif
2020-04-05 01:52:02 +02:00
not_async_actions();
2019-12-24 11:53:26 +03:00
2020-04-05 01:52:02 +02:00
handleMQTT();
2019-12-24 11:53:26 +03:00
handleCMD_loop();
handleButton();
handleScenario();
2020-05-20 02:16:23 +02:00
#ifdef UDP_enable
2020-04-05 01:52:02 +02:00
handleUdp();
2020-05-20 02:16:23 +02:00
#endif
2019-12-24 11:53:26 +03:00
ts.update();
2020-04-05 01:52:02 +02:00
}
void not_async_actions() {
do_mqtt_connection();
do_upgrade_url();
do_upgrade();
2020-05-20 02:16:23 +02:00
#ifdef UDP_enable
2020-04-05 01:52:02 +02:00
do_udp_data_parse();
do_mqtt_send_settings_to_udp();
2020-05-20 02:16:23 +02:00
#endif
2020-05-02 12:20:30 +02:00
do_i2c_scanning();
2019-12-24 11:53:26 +03:00
}