From e3ec40dec25797df406e472090c2f28a5c568df0 Mon Sep 17 00:00:00 2001 From: biver Date: Wed, 5 Oct 2022 21:07:49 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9A=D0=BE=D1=80=D1=80=D0=B5=D0=BA=D1=82?= =?UTF-8?q?=D0=B8=D1=80=D1=83=D0=B5=D0=BC=20=D0=BD=D0=B0=D1=81=D1=82=D1=80?= =?UTF-8?q?=D0=BE=D0=B9=D0=BA=D0=B8=20=D0=BF=D1=80=D0=BE=D1=88=D0=B8=D0=B2?= =?UTF-8?q?=D0=BA=D0=B8=20=D0=BF=D0=BE=D0=B4=20=D0=BF=D0=BE=D1=81=D0=BB?= =?UTF-8?q?=D0=B5=D0=B4=D0=BD=D0=B8=D0=B5=20=D0=B8=D0=B7=D0=BC=D0=B5=D0=BD?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data_svelte/items.json | 43 ++++++++++++++++++--------- platformio.ini | 66 ++++++++++++++++++++++-------------------- src/modules/API.cpp | 6 ++-- 3 files changed, 67 insertions(+), 48 deletions(-) diff --git a/data_svelte/items.json b/data_svelte/items.json index 9ac762bd..46e6b216 100644 --- a/data_svelte/items.json +++ b/data_svelte/items.json @@ -125,28 +125,30 @@ "num": 9 }, { - "name": "10. AHT20 Температура", + "name": "10. AHTXX Температура", "type": "Reading", - "subtype": "Aht20t", + "subtype": "AhtXXt", "id": "Temp20", "widget": "anydataTmp", "page": "Сенсоры", - "descr": "AHT20 Температура", + "descr": "AHTXX Температура", "int": 15, "addr": "0x38", + "shtType": 1, "round": 1, "num": 10 }, { - "name": "11. AHT20 Влажность", + "name": "11. AHTXX Влажность", "type": "Reading", - "subtype": "Aht20h", + "subtype": "AhtXXh", "id": "Hum20", "widget": "anydataHum", "page": "Сенсоры", - "descr": "AHT20 Влажность", + "descr": "AHTXX Влажность", "int": 15, "addr": "0x38", + "shtType": 1, "round": 1, "num": 11 }, @@ -554,7 +556,20 @@ "num": 42 }, { - "name": "43. PWM ESP8266", + "name": "43. Расширитель портов Pcf8574", + "type": "Reading", + "subtype": "Pcf8574", + "id": "Pcf", + "widget": "", + "page": "", + "descr": "", + "int": "0", + "addr": "0x20", + "index": 1, + "num": 43 + }, + { + "name": "44. PWM ESP8266", "type": "Writing", "subtype": "Pwm8266", "id": "pwm", @@ -566,10 +581,10 @@ "freq": 5000, "val": 0, "apin": -1, - "num": 43 + "num": 44 }, { - "name": "44. Телеграм-Лайт", + "name": "45. Телеграм-Лайт", "type": "Writing", "subtype": "TelegramLT", "id": "tg", @@ -578,13 +593,13 @@ "descr": "", "token": "", "chatID": "", - "num": 44 + "num": 45 }, { "header": "Экраны" }, { - "name": "45. LCD экран 2004", + "name": "46. LCD экран 2004", "type": "Reading", "subtype": "Lcd2004", "id": "Lcd", @@ -596,10 +611,10 @@ "size": "20,4", "coord": "0,0", "id2show": "id датчика", - "num": 45 + "num": 46 }, { - "name": "46. LCD экран 1602", + "name": "47. LCD экран 1602", "type": "Reading", "subtype": "Lcd2004", "id": "Lcd", @@ -611,6 +626,6 @@ "size": "16,2", "coord": "0,0", "id2show": "id датчика", - "num": 46 + "num": 47 } ] \ No newline at end of file diff --git a/platformio.ini b/platformio.ini index 13928626..920bc4f8 100644 --- a/platformio.ini +++ b/platformio.ini @@ -9,7 +9,7 @@ board = nodemcuv2 board_build.ldscript = eagle.flash.4m1m.ld platform = espressif8266 @4.0.1 monitor_filters = esp8266_exception_decoder -upload_speed = 921600 +upload_speed = 115200 monitor_speed = 115200 board_build.filesystem = littlefs build_src_filter = @@ -29,7 +29,7 @@ framework = arduino board = esp32dev platform = espressif32 @5.1.1 monitor_filters = esp32_exception_decoder -upload_speed = 921600 +upload_speed = 115200 monitor_speed = 115200 debug_tool = esp-prog board_build.filesystem = littlefs @@ -53,7 +53,7 @@ lib_deps_external = [env:esp8266_4mb_fromitems] lib_deps = - Adafruit AHTX0 + https://github.com/enjoyneering/AHTxx.git adafruit/Adafruit BME280 Library adafruit/Adafruit BMP280 Library beegee-tokyo/DHT sensor library for ESPx @@ -69,37 +69,39 @@ lib_deps = adafruit/Adafruit MCP23017 Arduino Library@^2.1.0 adafruit/Adafruit BusIO @ ^1.13.2 dfrobot/DFRobotDFPlayerMini @ ^1.0.5 + adafruit/Adafruit BusIO @ ^1.13.2 marcoschwartz/LiquidCrystal_I2C@^1.1.4 build_src_filter = - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [env:esp32_4mb_fromitems] lib_deps = diff --git a/src/modules/API.cpp b/src/modules/API.cpp index 467f8588..ab864765 100644 --- a/src/modules/API.cpp +++ b/src/modules/API.cpp @@ -6,7 +6,7 @@ void* getAPI_Timer(String subtype, String params); void* getAPI_Variable(String subtype, String params); void* getAPI_VButton(String subtype, String params); void* getAPI_Acs712(String subtype, String params); -void* getAPI_Aht20(String subtype, String params); +void* getAPI_AhtXX(String subtype, String params); void* getAPI_AnalogAdc(String subtype, String params); void* getAPI_Bme280(String subtype, String params); void* getAPI_Bmp280(String subtype, String params); @@ -26,6 +26,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_Pcf8574(String subtype, String params); void* getAPI_Pwm8266(String subtype, String params); void* getAPI_TelegramLT(String subtype, String params); void* getAPI_Lcd2004(String subtype, String params); @@ -38,7 +39,7 @@ if ((tmpAPI = getAPI_Timer(subtype, params)) != nullptr) return tmpAPI; if ((tmpAPI = getAPI_Variable(subtype, params)) != nullptr) return tmpAPI; if ((tmpAPI = getAPI_VButton(subtype, params)) != nullptr) return tmpAPI; if ((tmpAPI = getAPI_Acs712(subtype, params)) != nullptr) return tmpAPI; -if ((tmpAPI = getAPI_Aht20(subtype, params)) != nullptr) return tmpAPI; +if ((tmpAPI = getAPI_AhtXX(subtype, params)) != nullptr) return tmpAPI; if ((tmpAPI = getAPI_AnalogAdc(subtype, params)) != nullptr) return tmpAPI; if ((tmpAPI = getAPI_Bme280(subtype, params)) != nullptr) return tmpAPI; if ((tmpAPI = getAPI_Bmp280(subtype, params)) != nullptr) return tmpAPI; @@ -58,6 +59,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_Pcf8574(subtype, params)) != nullptr) return tmpAPI; if ((tmpAPI = getAPI_Pwm8266(subtype, params)) != nullptr) return tmpAPI; if ((tmpAPI = getAPI_TelegramLT(subtype, params)) != nullptr) return tmpAPI; if ((tmpAPI = getAPI_Lcd2004(subtype, params)) != nullptr) return tmpAPI;