-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathSonoff_WiFi_switch.ino
58 lines (56 loc) · 1.1 KB
/
Sonoff_WiFi_switch.ino
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// 392997 - 446904 = 44655
//#define Si7021
//#define POW
//#define mqttM //9496
#define ddnsM //1384 - 1012
#define rgbM // 1824 - 2700
#define rgbShimM //2480 - 2016
//#define irTransmitterM //9312
#define pinOutM // 1608 - 1848
//#define JalousieM //1408 - 1628
//#define DimmerM // 784
//#define safeData
//#define macros
#define webSocketM
#include "sets.h"
void setup() {
//Serial.begin(115200);
//Serial.println();
chipID = String( ESP.getChipId() ) + "-" + String( ESP.getFlashChipId() );
TickerScheduler(1);
SPIFFS.begin();
HTTP.begin();
configSetup = readFile(fileConfigS, 4096 );
initCMD();
initWIFI();
initHTTP();
//initUpgrade();
initFS();
initSSDP();
initScenary();
setupToInit();
#ifdef webSocketM
initWebSoket();
#endif
//testPin();
}
void loop() {
ts.update();
HTTP.handleClient();
dnsServer.processNextRequest();
handleSSDP();
handleScenary();
HTTPWAN.handleClient();
#ifdef mqttM
handleMQTT();
#endif
#ifdef rgbM
ws2812fx.service();
//ws2812fx[1].service();
#endif
handleRfReceiv();
handleButtons();
#ifdef webSocketM
webSocket.loop();
#endif
}