Skip to content

Commit aff4de3

Browse files
Aircoookiesofthack007
authored andcommitted
WS logic: No resending, improved ESP8266 stability
Update ESP8266 core to 3.1.2
1 parent e94064a commit aff4de3

File tree

3 files changed

+19
-9
lines changed

3 files changed

+19
-9
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@
6161
- Improved ESP8266 stability by reducing WebSocket response resends
6262
- Updated ESP8266 core to 3.1.2
6363

64+
#### Build 2306180
65+
66+
- Added client-side option for applying effect defaults from metadata
67+
- Improved ESP8266 stability by reducing WebSocket response resends
68+
- Updated ESP8266 core to 3.1.2
69+
6470
#### Build 2306141
6571
- Lissajous improvements
6672
- Scrolling Text improvements (leading 0)

wled00/const.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,10 @@
494494
#define DEFAULT_LED_COUNT 30
495495
#endif
496496

497-
#define INTERFACE_UPDATE_COOLDOWN 2000 //time in ms to wait between websockets, alexa, and MQTT updates
497+
#define INTERFACE_UPDATE_COOLDOWN 1200 // time in ms to wait between websockets, alexa, and MQTT updates
498+
499+
#define PIN_RETRY_COOLDOWN 3000 // time in ms after an incorrect attempt PIN and OTA pass will be rejected even if correct
500+
#define PIN_TIMEOUT 900000 // time in ms after which the PIN will be required again, 15 minutes
498501

499502
// HW_PIN_SCL & HW_PIN_SDA are used for information in usermods settings page and usermods themselves
500503
// which GPIO pins are actually used in a hardware layout (controller board)

wled00/ws.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,15 @@ void wsEvent(AsyncWebSocket * server, AsyncWebSocketClient * client, AwsEventTyp
6262
}
6363
releaseJSONBufferLock(); // will clean fileDoc
6464

65-
// force broadcast in 500ms after updating client
66-
if (verboseResponse) {
67-
sendDataWs(client);
68-
lastInterfaceUpdate = millis() - (INTERFACE_UPDATE_COOLDOWN -500);
69-
} else {
70-
// we have to send something back otherwise WS connection closes
71-
client->text(F("{\"success\":true}"));
72-
lastInterfaceUpdate = millis() - (INTERFACE_UPDATE_COOLDOWN -500);
65+
if (!interfaceUpdateCallMode) { // individual client response only needed if no WS broadcast soon
66+
if (verboseResponse) {
67+
sendDataWs(client);
68+
} else {
69+
// we have to send something back otherwise WS connection closes
70+
client->text(F("{\"success\":true}"));
71+
}
72+
// force broadcast in 500ms after updating client
73+
//lastInterfaceUpdate = millis() - (INTERFACE_UPDATE_COOLDOWN -500); // ESP8266 does not like this
7374
}
7475
}
7576
} else {

0 commit comments

Comments
 (0)