fix: убрали retry, debounce 3500мс, версия 1.7
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
#define ETH_CLK_MODE ETH_CLOCK_GPIO17_OUT
|
||||
|
||||
#define AP_SSID "Barrier-Setup"
|
||||
#define FW_VERSION "1.6"
|
||||
#define FW_VERSION "1.7"
|
||||
#define AP_PASS "barrier123"
|
||||
|
||||
Preferences prefs;
|
||||
@@ -40,7 +40,7 @@ String cfg_subnet = "255.255.255.0";
|
||||
|
||||
unsigned long lastPress1 = 0;
|
||||
unsigned long lastPress2 = 0;
|
||||
const unsigned long DEBOUNCE = 2000;
|
||||
const unsigned long DEBOUNCE = 3500;
|
||||
|
||||
void WiFiEvent(WiFiEvent_t event) {
|
||||
switch (event) {
|
||||
@@ -102,18 +102,12 @@ void sendCommand(String ip) {
|
||||
Serial.println("Нет сети!");
|
||||
return;
|
||||
}
|
||||
int code = -1;
|
||||
for (int attempt = 1; attempt <= 3; attempt++) {
|
||||
HTTPClient http;
|
||||
http.setTimeout(2000);
|
||||
http.begin("http://" + ip + "/open");
|
||||
http.addHeader("X-Token", cfg_token);
|
||||
code = http.GET();
|
||||
http.end();
|
||||
Serial.println("Ответ от " + ip + " (попытка " + String(attempt) + "): " + String(code));
|
||||
if (code == 200) break;
|
||||
delay(300);
|
||||
}
|
||||
HTTPClient http;
|
||||
http.begin("http://" + ip + "/open");
|
||||
http.addHeader("X-Token", cfg_token);
|
||||
int code = http.GET();
|
||||
Serial.println("Ответ от " + ip + ": " + String(code));
|
||||
http.end();
|
||||
}
|
||||
|
||||
String currentIP() {
|
||||
|
||||
Reference in New Issue
Block a user