исправил проблему обновления по воздуху

This commit is contained in:
Dmitry Borisenko
2022-09-01 19:36:51 +02:00
parent 9ac0ab0b5a
commit e8526f0e1a
5 changed files with 15 additions and 7 deletions

View File

@@ -443,16 +443,18 @@
"num": 33 "num": 33
}, },
{ {
"name": "34. PWM ESP8266", "name": "34. PWM ESP32",
"type": "Writing", "type": "Writing",
"subtype": "Pwm8266", "subtype": "Pwm32",
"id": "pwm", "id": "pwm",
"widget": "range", "widget": "range",
"page": "Кнопки", "page": "Кнопки",
"descr": "PWM", "descr": "PWM",
"int": 0, "int": 0,
"pin": 15, "pin": 2,
"freq": 5000, "freq": 5000,
"ledChannel": 2,
"PWM_resolution": 10,
"val": 0, "val": 0,
"apin": -1, "apin": -1,
"num": 34 "num": 34

View File

@@ -21,7 +21,7 @@
}, },
"projectProp": { "projectProp": {
"platformio": { "platformio": {
"default_envs": "esp8266_4mb", "default_envs": "esp32_4mb",
"data_dir": "data_svelte" "data_dir": "data_svelte"
} }
}, },

View File

@@ -39,7 +39,7 @@ build_src_filter =
${env:esp32_4mb_fromitems.build_src_filter} ${env:esp32_4mb_fromitems.build_src_filter}
[platformio] [platformio]
default_envs = esp8266_4mb default_envs = esp32_4mb
data_dir = data_svelte data_dir = data_svelte
[common_env_data] [common_env_data]

View File

@@ -180,11 +180,17 @@ void webSocketEvent(uint8_t num, WStype_t type, uint8_t* payload, size_t length)
if (headerStr == "/reboot|") { if (headerStr == "/reboot|") {
ESP.restart(); ESP.restart();
} }
//команда очистки всех логов esp //команда очистки всех логов esp
if (headerStr == "/clean|") { if (headerStr == "/clean|") {
cleanLogs(); cleanLogs();
} }
//команда обновления прошивки esp
if (headerStr == "/update|") {
upgrade_firmware(3);
}
//Прием команд control c dashboard //Прием команд control c dashboard
if (headerStr == "/control|") { if (headerStr == "/control|") {
String msg; String msg;

View File

@@ -22,7 +22,7 @@ void* getAPI_ButtonOut(String subtype, String params);
void* getAPI_IoTServo(String subtype, String params); void* getAPI_IoTServo(String subtype, String params);
void* getAPI_Mcp23017(String subtype, String params); void* getAPI_Mcp23017(String subtype, String params);
void* getAPI_Mp3(String subtype, String params); void* getAPI_Mp3(String subtype, String params);
void* getAPI_Pwm8266(String subtype, String params); void* getAPI_Pwm32(String subtype, String params);
void* getAPI_Lcd2004(String subtype, String params); void* getAPI_Lcd2004(String subtype, String params);
void* getAPI(String subtype, String params) { void* getAPI(String subtype, String params) {
@@ -49,7 +49,7 @@ if ((tmpAPI = getAPI_ButtonOut(subtype, params)) != nullptr) return tmpAPI;
if ((tmpAPI = getAPI_IoTServo(subtype, params)) != nullptr) return tmpAPI; if ((tmpAPI = getAPI_IoTServo(subtype, params)) != nullptr) return tmpAPI;
if ((tmpAPI = getAPI_Mcp23017(subtype, params)) != nullptr) return tmpAPI; if ((tmpAPI = getAPI_Mcp23017(subtype, params)) != nullptr) return tmpAPI;
if ((tmpAPI = getAPI_Mp3(subtype, params)) != nullptr) return tmpAPI; if ((tmpAPI = getAPI_Mp3(subtype, params)) != nullptr) return tmpAPI;
if ((tmpAPI = getAPI_Pwm8266(subtype, params)) != nullptr) return tmpAPI; if ((tmpAPI = getAPI_Pwm32(subtype, params)) != nullptr) return tmpAPI;
if ((tmpAPI = getAPI_Lcd2004(subtype, params)) != nullptr) return tmpAPI; if ((tmpAPI = getAPI_Lcd2004(subtype, params)) != nullptr) return tmpAPI;
return nullptr; return nullptr;
} }