From e8526f0e1adc5ac2d7384e15f5ceedf7e7af9885 Mon Sep 17 00:00:00 2001 From: Dmitry Borisenko <49808844+DmitryBorisenko33@users.noreply.github.com> Date: Thu, 1 Sep 2022 19:36:51 +0200 Subject: [PATCH] =?UTF-8?q?=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=20=D0=BF=D1=80=D0=BE=D0=B1=D0=BB=D0=B5=D0=BC=D1=83=20?= =?UTF-8?q?=D0=BE=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D1=8F=20?= =?UTF-8?q?=D0=BF=D0=BE=20=D0=B2=D0=BE=D0=B7=D0=B4=D1=83=D1=85=D1=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data_svelte/items.json | 8 +++++--- myProfile.json | 2 +- platformio.ini | 2 +- src/WsServer.cpp | 6 ++++++ src/modules/API.cpp | 4 ++-- 5 files changed, 15 insertions(+), 7 deletions(-) diff --git a/data_svelte/items.json b/data_svelte/items.json index 3468a035..859257f7 100644 --- a/data_svelte/items.json +++ b/data_svelte/items.json @@ -443,16 +443,18 @@ "num": 33 }, { - "name": "34. PWM ESP8266", + "name": "34. PWM ESP32", "type": "Writing", - "subtype": "Pwm8266", + "subtype": "Pwm32", "id": "pwm", "widget": "range", "page": "Кнопки", "descr": "PWM", "int": 0, - "pin": 15, + "pin": 2, "freq": 5000, + "ledChannel": 2, + "PWM_resolution": 10, "val": 0, "apin": -1, "num": 34 diff --git a/myProfile.json b/myProfile.json index 4fcac5c5..1c948144 100644 --- a/myProfile.json +++ b/myProfile.json @@ -21,7 +21,7 @@ }, "projectProp": { "platformio": { - "default_envs": "esp8266_4mb", + "default_envs": "esp32_4mb", "data_dir": "data_svelte" } }, diff --git a/platformio.ini b/platformio.ini index d7470c0d..bbef89ff 100644 --- a/platformio.ini +++ b/platformio.ini @@ -39,7 +39,7 @@ build_src_filter = ${env:esp32_4mb_fromitems.build_src_filter} [platformio] -default_envs = esp8266_4mb +default_envs = esp32_4mb data_dir = data_svelte [common_env_data] diff --git a/src/WsServer.cpp b/src/WsServer.cpp index 7ba48c38..5d3b0ba1 100644 --- a/src/WsServer.cpp +++ b/src/WsServer.cpp @@ -180,11 +180,17 @@ void webSocketEvent(uint8_t num, WStype_t type, uint8_t* payload, size_t length) if (headerStr == "/reboot|") { ESP.restart(); } + //команда очистки всех логов esp if (headerStr == "/clean|") { cleanLogs(); } + //команда обновления прошивки esp + if (headerStr == "/update|") { + upgrade_firmware(3); + } + //Прием команд control c dashboard if (headerStr == "/control|") { String msg; diff --git a/src/modules/API.cpp b/src/modules/API.cpp index e570b3b6..5aa39fb1 100644 --- a/src/modules/API.cpp +++ b/src/modules/API.cpp @@ -22,7 +22,7 @@ void* getAPI_ButtonOut(String subtype, String params); void* getAPI_IoTServo(String subtype, String params); void* getAPI_Mcp23017(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(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_Mcp23017(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; return nullptr; } \ No newline at end of file