mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-30 20:09:14 +03:00
ws started
This commit is contained in:
@@ -55,7 +55,7 @@
|
||||
#define DEVICE_SCENARIO_FILE "s.scen.txt"
|
||||
//#define OTA_UPDATES_ENABLED
|
||||
//#define MDNS_ENABLED
|
||||
//#define WEBSOCKET_ENABLED
|
||||
#define WEBSOCKET_ENABLED
|
||||
//#define LAYOUT_IN_RAM
|
||||
//#define UDP_ENABLED
|
||||
//#define SSDP_ENABLED
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#ifdef ESP8266
|
||||
#include <ESP8266WebServer.h>
|
||||
//#include <ESP8266WebServer.h>
|
||||
#include <ESP8266httpUpdate.h>
|
||||
#include "ESPAsyncTCP.h"
|
||||
#include "ESPAsyncWebServer.h"
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
#pragma once
|
||||
//===================Libraries===================================================================================================================================================
|
||||
#include "Consts.h"
|
||||
#include <Arduino.h>
|
||||
#include "CTBot.h"
|
||||
#include <ArduinoJson.h>
|
||||
#include <ArduinoOTA.h>
|
||||
#include <PubSubClient.h>
|
||||
@@ -10,13 +8,15 @@
|
||||
#include <TickerScheduler.h>
|
||||
#include <Wire.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "CTBot.h"
|
||||
#include "Clock.h"
|
||||
#include "Consts.h"
|
||||
#include "ESP32.h"
|
||||
#include "ESP8266.h"
|
||||
#include "GyverFilters.h"
|
||||
#include "MqttClient.h"
|
||||
#include "Upgrade.h"
|
||||
|
||||
#include "Utils/FileUtils.h"
|
||||
#include "Utils/JsonUtils.h"
|
||||
#include "Utils/SerialPrint.h"
|
||||
@@ -26,25 +26,20 @@
|
||||
|
||||
#ifdef WEBSOCKET_ENABLED
|
||||
extern AsyncWebSocket ws;
|
||||
//extern AsyncEventSource events;
|
||||
extern AsyncEventSource events;
|
||||
#endif
|
||||
|
||||
|
||||
extern TickerScheduler ts;
|
||||
extern WiFiClient espClient;
|
||||
extern PubSubClient mqtt;
|
||||
extern StringCommand sCmd;
|
||||
extern AsyncWebServer server;
|
||||
|
||||
|
||||
|
||||
// Global vars
|
||||
extern boolean just_load;
|
||||
extern boolean telegramInitBeen;
|
||||
extern boolean savedFromWeb;
|
||||
|
||||
|
||||
|
||||
// Json
|
||||
extern String configSetupJson; //все настройки
|
||||
extern String configLiveJson; //все данные с датчиков (связан с mqtt)
|
||||
@@ -101,12 +96,9 @@ extern String logging_KeyList;
|
||||
extern int logging_EnterCounter;
|
||||
//=========================================
|
||||
|
||||
|
||||
|
||||
extern String itemName;
|
||||
extern String presetName;
|
||||
|
||||
|
||||
extern int scenario_line_status[40];
|
||||
extern int lastVersion;
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#include "HttpServer.h"
|
||||
#include "BufferExecute.h"
|
||||
#include "FSEditor.h"
|
||||
#include "HttpServer.h"
|
||||
#include "Utils/FileUtils.h"
|
||||
#include "Utils/WebUtils.h"
|
||||
#include "FSEditor.h"
|
||||
|
||||
AsyncWebSocket ws("/ws");
|
||||
AsyncEventSource events("/events");
|
||||
namespace HttpServer {
|
||||
|
||||
|
||||
/* Forward declaration */
|
||||
void initOta();
|
||||
void initMDNS();
|
||||
@@ -74,8 +74,6 @@ void init() {
|
||||
request->send(200, "text/html", "OK");
|
||||
});
|
||||
|
||||
|
||||
|
||||
server.begin();
|
||||
|
||||
initOta();
|
||||
|
||||
@@ -84,8 +84,8 @@ void setup() {
|
||||
just_load = false;
|
||||
initialized = true;
|
||||
|
||||
const int capacity = JSON_OBJECT_SIZE(35);
|
||||
SerialPrint("I", F("Test"), String(capacity));
|
||||
// const int capacity = JSON_OBJECT_SIZE(35);
|
||||
// SerialPrint("I", F("Test"), String(capacity));
|
||||
|
||||
ts.add(
|
||||
MYTEST, 5000, [&](void*) {
|
||||
|
||||
Reference in New Issue
Block a user