From 164f3be9984f6adf7b14850b318d28517d0242cf Mon Sep 17 00:00:00 2001 From: Mit4el Date: Sun, 8 Oct 2023 18:19:08 +0300 Subject: [PATCH] new board esp32 3m flash, bugfix modules --- data_svelte/myProfile.json | 10 ++- include/classes/IoTItem.h | 5 +- myProfile.json | 10 ++- platformio.ini | 80 +++++++++++++++++++ src/MqttClient.cpp | 9 +++ src/classes/IoTItem.cpp | 18 +++-- src/modules/display/DwinI/modinfo.json | 1 + src/modules/display/Lcd2004/modinfo.json | 4 + .../display/NextionUpload/modinfo.json | 3 + src/modules/display/Oled128/modinfo.json | 3 + src/modules/display/Smi2_m/modinfo.json | 1 + src/modules/display/TM16XX/modinfo.json | 5 ++ src/modules/display/Ws2812b/modinfo.json | 3 + src/modules/exec/ButtonIn/modinfo.json | 1 + src/modules/exec/ButtonOut/modinfo.json | 1 + src/modules/exec/Buzzer/modinfo.json | 1 + src/modules/exec/Enconder/modinfo.json | 3 + src/modules/exec/Ftp/modinfo.json | 1 + src/modules/exec/HttpGet/modinfo.json | 1 + src/modules/exec/IoTServo/modinfo.json | 3 + src/modules/exec/Mcp23008/modinfo.json | 4 + src/modules/exec/Mcp23017/modinfo.json | 4 + src/modules/exec/Mp3/modinfo.json | 3 + src/modules/exec/Multitouch/modinfo.json | 1 + src/modules/exec/MySensors/modinfo.json | 1 + src/modules/exec/Pcf8574/modinfo.json | 3 + src/modules/exec/Pwm32/modinfo.json | 1 + src/modules/exec/SDcard/modinfo.json | 3 + src/modules/exec/SysExt/modinfo.json | 1 + src/modules/exec/Telegram/modinfo.json | 3 + src/modules/exec/TelegramLT/modinfo.json | 1 + src/modules/exec/Telegram_v2/modinfo.json | 3 + src/modules/exec/Thermostat/Thermostat.cpp | 40 +++++++--- src/modules/exec/Thermostat/modinfo.json | 2 + src/modules/sensors/Acs712/modinfo.json | 1 + src/modules/sensors/Ads1115/modinfo.json | 3 + src/modules/sensors/AhtXX/modinfo.json | 3 + src/modules/sensors/AnalogAdc/modinfo.json | 1 + src/modules/sensors/BH_1750/modinfo.json | 3 + src/modules/sensors/Ble/modinfo.json | 4 + src/modules/sensors/Bme280/modinfo.json | 3 + src/modules/sensors/Bmp280/modinfo.json | 3 + src/modules/sensors/DS2401/modinfo.json | 1 + src/modules/sensors/Dht1122/modinfo.json | 3 + src/modules/sensors/Ds18b20/modinfo.json | 3 + src/modules/sensors/Ds2423/modinfo.json | 4 + src/modules/sensors/Emon/modinfo.json | 3 + .../sensors/ExampleModule/modinfo.json | 1 + .../sensors/ExternalMQTT/ExternalMQTT.cpp | 51 ++++-------- src/modules/sensors/ExternalMQTT/modinfo.json | 1 + src/modules/sensors/FreqMeter/modinfo.json | 3 + src/modules/sensors/GY21/modinfo.json | 3 + src/modules/sensors/Hdc1080/modinfo.json | 3 + src/modules/sensors/Hx710/modinfo.json | 3 + src/modules/sensors/Hx711/modinfo.json | 3 + src/modules/sensors/Impulse/modinfo.json | 1 + src/modules/sensors/Ina219/Ina219.cpp | 14 ++-- src/modules/sensors/Ina219/modinfo.json | 3 + src/modules/sensors/Ina226/Ina226.cpp | 14 ++-- src/modules/sensors/Ina226/modinfo.json | 3 + src/modules/sensors/IoTWiegand/modinfo.json | 3 + src/modules/sensors/Max6675/modinfo.json | 3 + src/modules/sensors/Mhz19/modinfo.json | 1 + src/modules/sensors/Ntc/modinfo.json | 1 + src/modules/sensors/Pzem004t/modinfo.json | 1 + src/modules/sensors/RCswitch/modinfo.json | 3 + src/modules/sensors/RTC/modinfo.json | 3 + src/modules/sensors/S8/modinfo.json | 1 + src/modules/sensors/Scd40/modinfo.json | 4 + src/modules/sensors/Sds011/modinfo.json | 3 + src/modules/sensors/Sgp30/modinfo.json | 3 + src/modules/sensors/Sht20/modinfo.json | 3 + src/modules/sensors/Sht30/modinfo.json | 3 + src/modules/sensors/Sonar/modinfo.json | 1 + src/modules/sensors/UART/modinfo.json | 3 + src/modules/sensors/ld2410/modinfo.json | 3 + src/modules/virtual/Cron/modinfo.json | 1 + src/modules/virtual/GoogleSheet/modinfo.json | 1 + src/modules/virtual/Loging/modinfo.json | 1 + src/modules/virtual/LogingDaily/modinfo.json | 1 + src/modules/virtual/Timer/modinfo.json | 1 + src/modules/virtual/VButton/modinfo.json | 1 + src/modules/virtual/Variable/modinfo.json | 1 + .../virtual/VariableColor/modinfo.json | 1 + src/modules/virtual/Weather/modinfo.json | 1 + src/modules/virtual/owmWeather/modinfo.json | 1 + 86 files changed, 348 insertions(+), 72 deletions(-) diff --git a/data_svelte/myProfile.json b/data_svelte/myProfile.json index a6e193dc..57a70708 100644 --- a/data_svelte/myProfile.json +++ b/data_svelte/myProfile.json @@ -25,7 +25,7 @@ "projectProp": { "platformio": { "default_envs": "esp8266_4mb", - "comments_default_envs": "choose from: esp8266_4mb or esp32_4mb or esp32cam_4mb or esp32s2_4mb or esp8266_1mb or esp8266_1mb_ota or esp8285_1mb or esp8285_1mb_ota", + "comments_default_envs": "choose from: esp8266_4mb or esp32_4mb or esp32cam_4mb or esp32s2_4mb or esp32_4mb3f or esp8266_1mb or esp8266_1mb_ota or esp8285_1mb or esp8285_1mb_ota", "envs": [ { "name": "esp8266_4mb", @@ -45,6 +45,14 @@ "partitions": "0x8000", "littlefs": "0x290000" }, + { + "name": "esp32_4mb3f", + "boot_app0": "0xe000", + "bootloader_qio_80m": "0x1000", + "firmware": "0x10000", + "partitions": "0x8000", + "littlefs": "0x310000" + }, { "name": "esp32cam_4mb", "boot_app0": "0xe000", diff --git a/include/classes/IoTItem.h b/include/classes/IoTItem.h index afb6be02..3ad344f8 100644 --- a/include/classes/IoTItem.h +++ b/include/classes/IoTItem.h @@ -29,7 +29,7 @@ class IoTItem { virtual String getValue(); long getInterval(); bool isGlobal(); - + void sendSubWidgetsValues(String& id, String& json); void setInterval(long interval); @@ -63,8 +63,9 @@ class IoTItem { virtual void setValue(const IoTValue& Value, bool genEvent = true); virtual void setValue(const String& valStr, bool genEvent = true); - String getRoundValue(); + String getRoundValue(); void getNetEvent(String& event); + virtual String getMqttExterSub(); // хуки для системных событий (должны начинаться с "on") virtual void onRegEvent(IoTItem* item); diff --git a/myProfile.json b/myProfile.json index a6e193dc..57a70708 100644 --- a/myProfile.json +++ b/myProfile.json @@ -25,7 +25,7 @@ "projectProp": { "platformio": { "default_envs": "esp8266_4mb", - "comments_default_envs": "choose from: esp8266_4mb or esp32_4mb or esp32cam_4mb or esp32s2_4mb or esp8266_1mb or esp8266_1mb_ota or esp8285_1mb or esp8285_1mb_ota", + "comments_default_envs": "choose from: esp8266_4mb or esp32_4mb or esp32cam_4mb or esp32s2_4mb or esp32_4mb3f or esp8266_1mb or esp8266_1mb_ota or esp8285_1mb or esp8285_1mb_ota", "envs": [ { "name": "esp8266_4mb", @@ -45,6 +45,14 @@ "partitions": "0x8000", "littlefs": "0x290000" }, + { + "name": "esp32_4mb3f", + "boot_app0": "0xe000", + "bootloader_qio_80m": "0x1000", + "firmware": "0x10000", + "partitions": "0x8000", + "littlefs": "0x310000" + }, { "name": "esp32cam_4mb", "boot_app0": "0xe000", diff --git a/platformio.ini b/platformio.ini index 2b2e296c..669c3fbc 100644 --- a/platformio.ini +++ b/platformio.ini @@ -199,6 +199,27 @@ build_src_filter = + ${env:esp32_4mb_fromitems.build_src_filter} +[env:esp32_4mb3f] +lib_deps = + ${common_env_data.lib_deps_external} + ${env:esp32_4mb3f_fromitems.lib_deps} +build_flags = -Desp32_4mb="esp32_4mb" +framework = arduino +board = esp32dev +platform = espressif32 @5.1.1 +monitor_filters = esp32_exception_decoder +upload_speed = 921600 +monitor_speed = 115200 +debug_tool = esp-prog +board_build.partitions = tools/partitions_custom.csv +board_build.filesystem = littlefs +build_src_filter = + +<*.cpp> + + + + + + + ${env:esp32_4mb3f_fromitems.build_src_filter} + [env:esp32cam_4mb] lib_deps = ${common_env_data.lib_deps_external} @@ -580,6 +601,65 @@ build_src_filter = + + +[env:esp32_4mb3f_fromitems] +lib_deps = + https://github.com/enjoyneering/AHTxx.git + adafruit/Adafruit BME280 Library + adafruit/Adafruit BMP280 Library + beegee-tokyo/DHT sensor library for ESPx + https://github.com/milesburton/Arduino-Temperature-Control-Library + https://github.com/tremaru/iarduino_RTC + robtillaart/SHT2x@^0.1.1 + WEMOS SHT3x@1.0.0 + plerup/EspSoftwareSerial + gyverlibs/EncButton @ ^2.0 + https://github.com/RoboticsBrno/ServoESP32#v1.0.3 + 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 + https://github.com/robotclass/RobotClass_LiquidCrystal_I2C + marcoschwartz/LiquidCrystal_I2C@^1.1.4 + https://github.com/maxint-rd/TM16xx + adafruit/Adafruit GFX Library @ ^1.11.5 +build_src_filter = + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [env:esp32cam_4mb_fromitems] lib_deps = espressif/esp32-camera @ ^2.0.0 diff --git a/src/MqttClient.cpp b/src/MqttClient.cpp index a08f3000..c6edb6e7 100644 --- a/src/MqttClient.cpp +++ b/src/MqttClient.cpp @@ -118,6 +118,15 @@ void mqttSubscribe() { mqtt.subscribe((mqttPrefix + "/+/+/order/#").c_str()); mqtt.subscribe((mqttPrefix + "/+/+/info").c_str()); } + for (std::list::iterator it = IoTItems.begin(); it != IoTItems.end(); ++it) { + if ((*it)->getSubtype() == "ExternalMQTT") { + String tmps = (*it)->getMqttExterSub(); + if (tmps != ""){ + mqtt.subscribe(tmps.c_str()); + SerialPrint("i", F("MQTT"), ("subscribed external " + tmps).c_str()); + } + } + } } void mqttSubscribeExternal(String topic, bool usePrefix) { diff --git a/src/classes/IoTItem.cpp b/src/classes/IoTItem.cpp index ab749e96..798ec902 100644 --- a/src/classes/IoTItem.cpp +++ b/src/classes/IoTItem.cpp @@ -70,19 +70,19 @@ long IoTItem::getInterval() { return _interval; } bool IoTItem::isGlobal() { return _global; } void IoTItem::setValue(const String& valStr, bool genEvent) { - value.isDecimal = isDigitDotCommaStr(valStr); - + value.isDecimal = isDigitDotCommaStr(valStr); + if (value.isDecimal) { value.valD = valStr.toFloat(); - getRoundValue(); + getRoundValue(); } else { - value.valS = valStr; + value.valS = valStr; } setValue(value, genEvent); } void IoTItem::setValue(const IoTValue& Value, bool genEvent) { - value = Value; + value = Value; if (value.isDecimal) { regEvent(value.valD, "", false, genEvent); @@ -100,7 +100,7 @@ void IoTItem::sendSubWidgetsValues(String& id, String& json) { // когда событие случилось void IoTItem::regEvent(const String& value, const String& consoleInfo, bool error, bool genEvent) { - if (_needSave) { + if (_needSave) { jsonWriteStr_(valuesFlashJson, _id, value); needSaveValues = true; } @@ -141,7 +141,7 @@ String IoTItem::getRoundValue() { } void IoTItem::regEvent(float regvalue, const String& consoleInfo, bool error, bool genEvent) { - value.valD = regvalue; + value.valD = regvalue; if (_multiply) value.valD = value.valD * _multiply; if (_plus) value.valD = value.valD + _plus; @@ -185,6 +185,10 @@ void IoTItem::checkIntFromNet() { } } +String IoTItem::getMqttExterSub() { + return ""; +} + // хуки для системных событий (должны начинаться с "on") void IoTItem::onRegEvent(IoTItem* item) {} void IoTItem::onMqttRecive(String& topic, String& msg) {} diff --git a/src/modules/display/DwinI/modinfo.json b/src/modules/display/DwinI/modinfo.json index c696860a..5f89a4c1 100644 --- a/src/modules/display/DwinI/modinfo.json +++ b/src/modules/display/DwinI/modinfo.json @@ -44,6 +44,7 @@ "defActive": false, "usedLibs": { "esp32_4mb": [], + "esp32_4mb3f": [], "esp32cam_4mb": [], "esp8266_4mb": [], "esp8266_1mb": [], diff --git a/src/modules/display/Lcd2004/modinfo.json b/src/modules/display/Lcd2004/modinfo.json index f96cf0f5..1176d45e 100644 --- a/src/modules/display/Lcd2004/modinfo.json +++ b/src/modules/display/Lcd2004/modinfo.json @@ -123,6 +123,10 @@ "https://github.com/robotclass/RobotClass_LiquidCrystal_I2C", "marcoschwartz/LiquidCrystal_I2C@^1.1.4" ], + "esp32_4mb3f": [ + "https://github.com/robotclass/RobotClass_LiquidCrystal_I2C", + "marcoschwartz/LiquidCrystal_I2C@^1.1.4" + ], "esp32cam_4mb": [ "https://github.com/robotclass/RobotClass_LiquidCrystal_I2C", "marcoschwartz/LiquidCrystal_I2C@^1.1.4" diff --git a/src/modules/display/NextionUpload/modinfo.json b/src/modules/display/NextionUpload/modinfo.json index da09e32a..2f602950 100644 --- a/src/modules/display/NextionUpload/modinfo.json +++ b/src/modules/display/NextionUpload/modinfo.json @@ -39,6 +39,9 @@ "esp32_4mb": [ "https://github.com/avaksru/ESPNexUpload.git" ], + "esp32_4mb3f": [ + "https://github.com/avaksru/ESPNexUpload.git" + ], "esp32cam_4mb": [ "https://github.com/avaksru/ESPNexUpload.git" ], diff --git a/src/modules/display/Oled128/modinfo.json b/src/modules/display/Oled128/modinfo.json index 3c3c73ac..5a59dc57 100644 --- a/src/modules/display/Oled128/modinfo.json +++ b/src/modules/display/Oled128/modinfo.json @@ -76,6 +76,9 @@ "esp32_4mb": [ "gyverlibs/GyverOLED @ 1.4" ], + "esp32_4mb3f": [ + "gyverlibs/GyverOLED @ 1.4" + ], "esp32_16mb": [ "gyverlibs/GyverOLED @ 1.4" ], diff --git a/src/modules/display/Smi2_m/modinfo.json b/src/modules/display/Smi2_m/modinfo.json index f79a7051..8c1debc0 100644 --- a/src/modules/display/Smi2_m/modinfo.json +++ b/src/modules/display/Smi2_m/modinfo.json @@ -53,6 +53,7 @@ "defActive": true, "usedLibs": { "esp32_4mb": [], + "esp32_4mb3f": [], "esp32cam_4mb": [] } } \ No newline at end of file diff --git a/src/modules/display/TM16XX/modinfo.json b/src/modules/display/TM16XX/modinfo.json index 25d74438..a7c8c82f 100644 --- a/src/modules/display/TM16XX/modinfo.json +++ b/src/modules/display/TM16XX/modinfo.json @@ -107,6 +107,11 @@ "adafruit/Adafruit GFX Library @ ^1.11.5", "adafruit/Adafruit BusIO @ ^1.13.2" ], + "esp32_4mb3f": [ + "https://github.com/maxint-rd/TM16xx", + "adafruit/Adafruit GFX Library @ ^1.11.5", + "adafruit/Adafruit BusIO @ ^1.13.2" + ], "esp32cam_4mb": [ "https://github.com/maxint-rd/TM16xx", "adafruit/Adafruit GFX Library @ ^1.11.5", diff --git a/src/modules/display/Ws2812b/modinfo.json b/src/modules/display/Ws2812b/modinfo.json index 4aa08ae6..bcad5b1e 100644 --- a/src/modules/display/Ws2812b/modinfo.json +++ b/src/modules/display/Ws2812b/modinfo.json @@ -100,6 +100,9 @@ "esp32_4mb": [ "adafruit/Adafruit NeoPixel@^1.10.6" ], + "esp32_4mb3f": [ + "adafruit/Adafruit NeoPixel@^1.10.6" + ], "esp32cam_4mb": [ "adafruit/Adafruit NeoPixel@^1.10.6" ], diff --git a/src/modules/exec/ButtonIn/modinfo.json b/src/modules/exec/ButtonIn/modinfo.json index e241adec..09759edf 100644 --- a/src/modules/exec/ButtonIn/modinfo.json +++ b/src/modules/exec/ButtonIn/modinfo.json @@ -46,6 +46,7 @@ "defActive": true, "usedLibs": { "esp32_4mb": [], + "esp32_4mb3f": [], "esp32cam_4mb": [], "esp32_16mb": [], "esp32s2_4mb": [], diff --git a/src/modules/exec/ButtonOut/modinfo.json b/src/modules/exec/ButtonOut/modinfo.json index 6a16dd18..10a39ded 100644 --- a/src/modules/exec/ButtonOut/modinfo.json +++ b/src/modules/exec/ButtonOut/modinfo.json @@ -50,6 +50,7 @@ "defActive": true, "usedLibs": { "esp32_4mb": [], + "esp32_4mb3f": [], "esp32cam_4mb": [], "esp32_16mb": [], "esp32s2_4mb": [], diff --git a/src/modules/exec/Buzzer/modinfo.json b/src/modules/exec/Buzzer/modinfo.json index 4d22dbcd..44b01e2b 100644 --- a/src/modules/exec/Buzzer/modinfo.json +++ b/src/modules/exec/Buzzer/modinfo.json @@ -104,6 +104,7 @@ "defActive": true, "usedLibs": { "esp32_4mb": [], + "esp32_4mb3f": [], "esp32cam_4mb": [], "esp8266_4mb": [], "esp8266_1mb": [], diff --git a/src/modules/exec/Enconder/modinfo.json b/src/modules/exec/Enconder/modinfo.json index f344bf17..5019d20e 100644 --- a/src/modules/exec/Enconder/modinfo.json +++ b/src/modules/exec/Enconder/modinfo.json @@ -46,6 +46,9 @@ "esp32_4mb": [ "gyverlibs/EncButton @ ^2.0" ], + "esp32_4mb3f": [ + "gyverlibs/EncButton @ ^2.0" + ], "esp32cam_4mb": [ "gyverlibs/EncButton @ ^2.0" ], diff --git a/src/modules/exec/Ftp/modinfo.json b/src/modules/exec/Ftp/modinfo.json index 3f9dd379..a4049ee5 100644 --- a/src/modules/exec/Ftp/modinfo.json +++ b/src/modules/exec/Ftp/modinfo.json @@ -35,6 +35,7 @@ "defActive": false, "usedLibs": { "esp32_4mb": [], + "esp32_4mb3f": [], "esp32cam_4mb": [], "esp32_16mb": [], "esp32s2_4mb": [], diff --git a/src/modules/exec/HttpGet/modinfo.json b/src/modules/exec/HttpGet/modinfo.json index 4cbe39da..d8bcda2c 100644 --- a/src/modules/exec/HttpGet/modinfo.json +++ b/src/modules/exec/HttpGet/modinfo.json @@ -50,6 +50,7 @@ "defActive": false, "usedLibs": { "esp32_4mb": [], + "esp32_4mb3f": [], "esp32cam_4mb": [], "esp32s2_4mb": [], "esp8266_4mb": [], diff --git a/src/modules/exec/IoTServo/modinfo.json b/src/modules/exec/IoTServo/modinfo.json index df3be571..73f8e61e 100644 --- a/src/modules/exec/IoTServo/modinfo.json +++ b/src/modules/exec/IoTServo/modinfo.json @@ -51,6 +51,9 @@ "esp32_4mb": [ "https://github.com/RoboticsBrno/ServoESP32#v1.0.3" ], + "esp32_4mb3f": [ + "https://github.com/RoboticsBrno/ServoESP32#v1.0.3" + ], "esp32cam_4mb": [ "https://github.com/RoboticsBrno/ServoESP32#v1.0.3" ], diff --git a/src/modules/exec/Mcp23008/modinfo.json b/src/modules/exec/Mcp23008/modinfo.json index dbd92130..7554b884 100644 --- a/src/modules/exec/Mcp23008/modinfo.json +++ b/src/modules/exec/Mcp23008/modinfo.json @@ -40,6 +40,10 @@ "adafruit/Adafruit Mcp23017 Arduino Library@^2.1.0", "adafruit/Adafruit BusIO @ ^1.13.2" ], + "esp32_4mb3f": [ + "adafruit/Adafruit Mcp23017 Arduino Library@^2.1.0", + "adafruit/Adafruit BusIO @ ^1.13.2" + ], "esp32cam_4mb": [ "adafruit/Adafruit Mcp23017 Arduino Library@^2.1.0", "adafruit/Adafruit BusIO @ ^1.13.2" diff --git a/src/modules/exec/Mcp23017/modinfo.json b/src/modules/exec/Mcp23017/modinfo.json index e08d8c77..53534b90 100644 --- a/src/modules/exec/Mcp23017/modinfo.json +++ b/src/modules/exec/Mcp23017/modinfo.json @@ -40,6 +40,10 @@ "adafruit/Adafruit MCP23017 Arduino Library@^2.1.0", "adafruit/Adafruit BusIO @ ^1.13.2" ], + "esp32_4mb3f": [ + "adafruit/Adafruit MCP23017 Arduino Library@^2.1.0", + "adafruit/Adafruit BusIO @ ^1.13.2" + ], "esp32cam_4mb": [ "adafruit/Adafruit MCP23017 Arduino Library@^2.1.0", "adafruit/Adafruit BusIO @ ^1.13.2" diff --git a/src/modules/exec/Mp3/modinfo.json b/src/modules/exec/Mp3/modinfo.json index a8f8c296..6896d77b 100644 --- a/src/modules/exec/Mp3/modinfo.json +++ b/src/modules/exec/Mp3/modinfo.json @@ -92,6 +92,9 @@ "esp32_4mb": [ "dfrobot/DFRobotDFPlayerMini @ ^1.0.5" ], + "esp32_4mb4f": [ + "dfrobot/DFRobotDFPlayerMini @ ^1.0.5" + ], "esp32cam_4mb": [ "dfrobot/DFRobotDFPlayerMini @ ^1.0.5" ], diff --git a/src/modules/exec/Multitouch/modinfo.json b/src/modules/exec/Multitouch/modinfo.json index 416cb8c2..c08f35e7 100644 --- a/src/modules/exec/Multitouch/modinfo.json +++ b/src/modules/exec/Multitouch/modinfo.json @@ -44,6 +44,7 @@ "defActive": true, "usedLibs": { "esp32_4mb": [], + "esp32_4mb3f": [], "esp32cam_4mb": [], "esp8266_4mb": [], "esp8266_1mb": [], diff --git a/src/modules/exec/MySensors/modinfo.json b/src/modules/exec/MySensors/modinfo.json index e36a743c..75afbfe8 100644 --- a/src/modules/exec/MySensors/modinfo.json +++ b/src/modules/exec/MySensors/modinfo.json @@ -50,6 +50,7 @@ "defActive": false, "usedLibs": { "esp32_4mb": [], + "esp32_4mb3f": [], "esp32cam_4mb": [] } } \ No newline at end of file diff --git a/src/modules/exec/Pcf8574/modinfo.json b/src/modules/exec/Pcf8574/modinfo.json index c83ab02b..45f008ce 100644 --- a/src/modules/exec/Pcf8574/modinfo.json +++ b/src/modules/exec/Pcf8574/modinfo.json @@ -35,6 +35,9 @@ "esp32_4mb": [ "adafruit/Adafruit BusIO @ ^1.13.2" ], + "esp32_4mb3f": [ + "adafruit/Adafruit BusIO @ ^1.13.2" + ], "esp32cam_4mb": [ "adafruit/Adafruit BusIO @ ^1.13.2" ], diff --git a/src/modules/exec/Pwm32/modinfo.json b/src/modules/exec/Pwm32/modinfo.json index b864baef..ce789a19 100644 --- a/src/modules/exec/Pwm32/modinfo.json +++ b/src/modules/exec/Pwm32/modinfo.json @@ -45,6 +45,7 @@ "defActive": true, "usedLibs": { "esp32_4mb": [], + "esp32_4mb3f": [], "esp32cam_4mb": [] } } \ No newline at end of file diff --git a/src/modules/exec/SDcard/modinfo.json b/src/modules/exec/SDcard/modinfo.json index aacf0091..5f10bce6 100644 --- a/src/modules/exec/SDcard/modinfo.json +++ b/src/modules/exec/SDcard/modinfo.json @@ -35,6 +35,9 @@ "esp32_4mb": [ "espressif/esp32-camera @ ^2.0.0" ], + "esp32_4mb3f": [ + "espressif/esp32-camera @ ^2.0.0" + ], "esp32cam_4mb": [ "espressif/esp32-camera @ ^2.0.0" ] diff --git a/src/modules/exec/SysExt/modinfo.json b/src/modules/exec/SysExt/modinfo.json index b77d3d80..1cd552ac 100644 --- a/src/modules/exec/SysExt/modinfo.json +++ b/src/modules/exec/SysExt/modinfo.json @@ -33,6 +33,7 @@ "defActive": false, "usedLibs": { "esp32_4mb": [], + "esp32_4mb3f": [], "esp32cam_4mb": [], "esp8266_4mb": [] } diff --git a/src/modules/exec/Telegram/modinfo.json b/src/modules/exec/Telegram/modinfo.json index bce50689..2910ace1 100644 --- a/src/modules/exec/Telegram/modinfo.json +++ b/src/modules/exec/Telegram/modinfo.json @@ -58,6 +58,9 @@ "esp32_4mb": [ "CTBot @2.1.9" ], + "esp32_4mb3f": [ + "CTBot @2.1.9" + ], "esp32cam_4mb": [ "CTBot @2.1.9" ], diff --git a/src/modules/exec/TelegramLT/modinfo.json b/src/modules/exec/TelegramLT/modinfo.json index 98cccde7..4f2ce19d 100644 --- a/src/modules/exec/TelegramLT/modinfo.json +++ b/src/modules/exec/TelegramLT/modinfo.json @@ -52,6 +52,7 @@ "defActive": true, "usedLibs": { "esp32_4mb": [], + "esp32_4mb3f": [], "esp32cam_4mb": [], "esp32_16mb": [], "esp32s2_4mb": [], diff --git a/src/modules/exec/Telegram_v2/modinfo.json b/src/modules/exec/Telegram_v2/modinfo.json index 9f6dd6a6..a87f130b 100644 --- a/src/modules/exec/Telegram_v2/modinfo.json +++ b/src/modules/exec/Telegram_v2/modinfo.json @@ -77,6 +77,9 @@ "esp32_4mb": [ "gyverlibs/FastBot" ], + "esp32_4mb3f": [ + "gyverlibs/FastBot" + ], "esp32cam_4mb": [ "gyverlibs/FastBot" ], diff --git a/src/modules/exec/Thermostat/Thermostat.cpp b/src/modules/exec/Thermostat/Thermostat.cpp index 3e342931..8d3c9260 100644 --- a/src/modules/exec/Thermostat/Thermostat.cpp +++ b/src/modules/exec/Thermostat/Thermostat.cpp @@ -150,8 +150,9 @@ public: class ThermostatPID : public IoTItem { private: - String _set_id; // заданная температура - String _term_id; // термометр + String _set_id; // заданная температура + String _term_id; // термометр + String _term_rezerv_id; // резервный термометр float _int, _KP, _KI, _KD, sp, pv, pv_last = 0, // предыдущая температура ierr = 0, // интегральная погрешность @@ -168,6 +169,7 @@ public: { jsonRead(parameters, "set_id", _set_id); jsonRead(parameters, "term_id", _term_id); + jsonRead(parameters, "term_rezerv_id", _term_rezerv_id); jsonRead(parameters, "int", _int); jsonRead(parameters, "KP", _KP); jsonRead(parameters, "KI", _KI); @@ -237,20 +239,40 @@ protected: interim = tmp->getValue(); pv = ::atof(interim.c_str()); } + if (pv < -40 && pv > 120 && !pv) // Решаем что ошибка датчика + { + if (_term_rezerv_id != "") + { + tmp = findIoTItem(_term_rezerv_id); // используем резервный + if (tmp) + { + interim = tmp->getValue(); + pv = ::atof(interim.c_str()); + if (pv < -40 && pv > 120 && !pv) + pv = 0; + } + else + pv = 0; + } + else + pv = 0; + } if (sp && pv) { -// value.valD = pid(sp, pv, pv_last, ierr, _int); -// value.valS = (String)(int)value.valD; + // value.valD = pid(sp, pv, pv_last, ierr, _int); + // value.valS = (String)(int)value.valD; regEvent(pid(sp, pv, pv_last, ierr, _int), "ThermostatPID", false, true); - } + } + else + regEvent(0, "ThermostatPID", false, true); pv_last = pv; } -// временное решение + // временное решение unsigned long currentMillis; unsigned long prevMillis; unsigned long difference; - + void loop() { if (enableDoByInt) @@ -332,8 +354,8 @@ private: public: ThermostatETK(String parameters) : IoTItem(parameters) { -// jsonRead(parameters, "set_id", _set_id); -// jsonRead(parameters, "term_id", _term_id); + // jsonRead(parameters, "set_id", _set_id); + // jsonRead(parameters, "term_id", _term_id); jsonRead(parameters, "iv_k", _iv_k); jsonRead(parameters, "outside_id", _outside_id); } diff --git a/src/modules/exec/Thermostat/modinfo.json b/src/modules/exec/Thermostat/modinfo.json index 2aeb4ae3..2e7bd938 100644 --- a/src/modules/exec/Thermostat/modinfo.json +++ b/src/modules/exec/Thermostat/modinfo.json @@ -34,6 +34,7 @@ "map": "1,100,1,100", "set_id": "", "term_id": "", + "term_rezerv_id": "", "rele": "", "KP": 5.0, "KI": 50, @@ -134,6 +135,7 @@ "defActive": false, "usedLibs": { "esp32_4mb": [], + "esp32_4mb3f": [], "esp32cam_4mb": [], "esp8266_4mb": [], "esp8266_1mb": [], diff --git a/src/modules/sensors/Acs712/modinfo.json b/src/modules/sensors/Acs712/modinfo.json index ed26573e..2f68ee40 100644 --- a/src/modules/sensors/Acs712/modinfo.json +++ b/src/modules/sensors/Acs712/modinfo.json @@ -42,6 +42,7 @@ "defActive": true, "usedLibs": { "esp32_4mb": [], + "esp32_4mb3f": [], "esp32cam_4mb": [], "esp32s2_4mb": [], "esp8266_4mb": [], diff --git a/src/modules/sensors/Ads1115/modinfo.json b/src/modules/sensors/Ads1115/modinfo.json index 9a69a717..dccbbc28 100644 --- a/src/modules/sensors/Ads1115/modinfo.json +++ b/src/modules/sensors/Ads1115/modinfo.json @@ -44,6 +44,9 @@ "esp32_4mb": [ "adafruit/Adafruit ADS1X15 @ ^2.3.0" ], + "esp32_4mb3f": [ + "adafruit/Adafruit ADS1X15 @ ^2.3.0" + ], "esp32cam_4mb": [ "adafruit/Adafruit ADS1X15 @ ^2.3.0" ], diff --git a/src/modules/sensors/AhtXX/modinfo.json b/src/modules/sensors/AhtXX/modinfo.json index 9f28ea3e..b621e931 100644 --- a/src/modules/sensors/AhtXX/modinfo.json +++ b/src/modules/sensors/AhtXX/modinfo.json @@ -59,6 +59,9 @@ "esp32_4mb": [ "https://github.com/enjoyneering/AHTxx.git" ], + "esp32_4mb3f": [ + "https://github.com/enjoyneering/AHTxx.git" + ], "esp32cam_4mb": [ "https://github.com/enjoyneering/AHTxx.git" ], diff --git a/src/modules/sensors/AnalogAdc/modinfo.json b/src/modules/sensors/AnalogAdc/modinfo.json index 21ecc6ac..873701ff 100644 --- a/src/modules/sensors/AnalogAdc/modinfo.json +++ b/src/modules/sensors/AnalogAdc/modinfo.json @@ -42,6 +42,7 @@ "defActive": true, "usedLibs": { "esp32_4mb": [], + "esp32_4mb3f": [], "esp32cam_4mb": [], "esp8266_4mb": [], "esp8266_1mb": [], diff --git a/src/modules/sensors/BH_1750/modinfo.json b/src/modules/sensors/BH_1750/modinfo.json index 41e3f369..9177a22f 100644 --- a/src/modules/sensors/BH_1750/modinfo.json +++ b/src/modules/sensors/BH_1750/modinfo.json @@ -37,6 +37,9 @@ "esp32_4mb": [ "BH1750" ], + "esp32_4mb3f": [ + "BH1750" + ], "esp32cam_4mb": [ "BH1750" ], diff --git a/src/modules/sensors/Ble/modinfo.json b/src/modules/sensors/Ble/modinfo.json index 8b0e8457..090ccb24 100644 --- a/src/modules/sensors/Ble/modinfo.json +++ b/src/modules/sensors/Ble/modinfo.json @@ -63,6 +63,10 @@ "https://github.com/h2zero/NimBLE-Arduino.git", "https://github.com/avaksru/decoder.git" ], + "esp32_4mb3f": [ + "https://github.com/h2zero/NimBLE-Arduino.git", + "https://github.com/avaksru/decoder.git" + ], "esp32cam_4mb": [ "https://github.com/h2zero/NimBLE-Arduino.git", "https://github.com/avaksru/decoder.git" diff --git a/src/modules/sensors/Bme280/modinfo.json b/src/modules/sensors/Bme280/modinfo.json index 86af866e..c8b114da 100644 --- a/src/modules/sensors/Bme280/modinfo.json +++ b/src/modules/sensors/Bme280/modinfo.json @@ -83,6 +83,9 @@ "esp32_4mb": [ "adafruit/Adafruit BME280 Library" ], + "esp32_4mb3f": [ + "adafruit/Adafruit BME280 Library" + ], "esp32cam_4mb": [ "adafruit/Adafruit BME280 Library" ], diff --git a/src/modules/sensors/Bmp280/modinfo.json b/src/modules/sensors/Bmp280/modinfo.json index 03b6f3e0..ad796c25 100644 --- a/src/modules/sensors/Bmp280/modinfo.json +++ b/src/modules/sensors/Bmp280/modinfo.json @@ -55,6 +55,9 @@ "esp32_4mb": [ "adafruit/Adafruit BMP280 Library" ], + "esp32_4mb3f": [ + "adafruit/Adafruit BMP280 Library" + ], "esp32cam_4mb": [ "adafruit/Adafruit BMP280 Library" ], diff --git a/src/modules/sensors/DS2401/modinfo.json b/src/modules/sensors/DS2401/modinfo.json index 0954be0a..c718c39d 100644 --- a/src/modules/sensors/DS2401/modinfo.json +++ b/src/modules/sensors/DS2401/modinfo.json @@ -36,6 +36,7 @@ "defActive": false, "usedLibs": { "esp32_4mb": [], + "esp32_4mb3f": [], "esp32cam_4mb": [], "esp8266_4mb": [], "esp8266_1mb": [], diff --git a/src/modules/sensors/Dht1122/modinfo.json b/src/modules/sensors/Dht1122/modinfo.json index d4df0ce6..802cd8fd 100644 --- a/src/modules/sensors/Dht1122/modinfo.json +++ b/src/modules/sensors/Dht1122/modinfo.json @@ -55,6 +55,9 @@ "esp32_4mb": [ "beegee-tokyo/DHT sensor library for ESPx" ], + "esp32_4mb3f": [ + "beegee-tokyo/DHT sensor library for ESPx" + ], "esp32cam_4mb": [ "beegee-tokyo/DHT sensor library for ESPx" ], diff --git a/src/modules/sensors/Ds18b20/modinfo.json b/src/modules/sensors/Ds18b20/modinfo.json index b4806609..7bb5e566 100644 --- a/src/modules/sensors/Ds18b20/modinfo.json +++ b/src/modules/sensors/Ds18b20/modinfo.json @@ -42,6 +42,9 @@ "esp32_4mb": [ "https://github.com/milesburton/Arduino-Temperature-Control-Library" ], + "esp32_4mb3f": [ + "https://github.com/milesburton/Arduino-Temperature-Control-Library" + ], "esp32cam_4mb": [ "https://github.com/milesburton/Arduino-Temperature-Control-Library" ], diff --git a/src/modules/sensors/Ds2423/modinfo.json b/src/modules/sensors/Ds2423/modinfo.json index 50fd76ba..958541a4 100644 --- a/src/modules/sensors/Ds2423/modinfo.json +++ b/src/modules/sensors/Ds2423/modinfo.json @@ -64,6 +64,10 @@ "https://github.com/jbechter/arduino-onewire-DS2423", "paulstoffregen/OneWire @ ^2.3.7" ], + "esp32_4mb3f": [ + "https://github.com/jbechter/arduino-onewire-DS2423", + "paulstoffregen/OneWire @ ^2.3.7" + ], "esp32cam_4mb": [ "https://github.com/jbechter/arduino-onewire-DS2423", "paulstoffregen/OneWire @ ^2.3.7" diff --git a/src/modules/sensors/Emon/modinfo.json b/src/modules/sensors/Emon/modinfo.json index f518a1f3..f984a65c 100644 --- a/src/modules/sensors/Emon/modinfo.json +++ b/src/modules/sensors/Emon/modinfo.json @@ -62,6 +62,9 @@ "esp32_4mb": [ "openenergymonitor/EmonLib@1.1.0" ], + "esp32_4mb3f": [ + "openenergymonitor/EmonLib@1.1.0" + ], "esp32cam_4mb": [ "openenergymonitor/EmonLib@1.1.0" ], diff --git a/src/modules/sensors/ExampleModule/modinfo.json b/src/modules/sensors/ExampleModule/modinfo.json index 00632cc6..5e2a5dd2 100644 --- a/src/modules/sensors/ExampleModule/modinfo.json +++ b/src/modules/sensors/ExampleModule/modinfo.json @@ -76,6 +76,7 @@ "defActive": false, "usedLibs": { "esp32_4mb": [], + "esp32_4mb3f": [], "esp32cam_4mb": [], "esp32s2_4mb": [], "esp8266_4mb": [], diff --git a/src/modules/sensors/ExternalMQTT/ExternalMQTT.cpp b/src/modules/sensors/ExternalMQTT/ExternalMQTT.cpp index abe1ac60..744381b6 100644 --- a/src/modules/sensors/ExternalMQTT/ExternalMQTT.cpp +++ b/src/modules/sensors/ExternalMQTT/ExternalMQTT.cpp @@ -15,7 +15,6 @@ private: bool dataFromNode = false; String _topic = ""; bool _isJson; -// bool _addPrefix; bool _debug; bool sendOk = false; @@ -28,12 +27,14 @@ public: jsonRead(parameters, F("offline"), offline); _topic = jsonReadStr(parameters, "topic"); jsonRead(parameters, "isJson", _isJson); -// jsonRead(parameters, "addPrefix", _addPrefix); + // jsonRead(parameters, "addPrefix", _addPrefix); jsonRead(parameters, "debug", _debug); dataFromNode = false; if (mqttIsConnect()) + { sendOk = true; - mqttSubscribeExternal(_topic); + mqttSubscribeExternal(_topic); + } } char *TimeToString(unsigned long t) { @@ -49,16 +50,15 @@ public: { if (msg.indexOf("HELLO") == -1) { - if (_debug) - { - SerialPrint("i", "onMqttRecive", "Прилетело " + topic + " msg: " + msg); - // SerialPrint("i", "onMqttRecive", "Прилетело " + msg); - } String dev = selectToMarkerLast(topic, "/"); dev.toUpperCase(); dev.replace(":", ""); if (_topic != topic) { + if (_debug) + { + SerialPrint("i", "ExternalMQTT", _id + " not equal: " + topic + " msg: " + msg); + } return; } @@ -68,7 +68,7 @@ public: DeserializationError error = deserializeJson(doc, msg); if (error) { - SerialPrint("E", F("onMqttRecive"), error.f_str()); + SerialPrint("E", F("ExternalMQTT"), error.f_str()); } JsonObject jsonObject = doc.as(); @@ -78,34 +78,34 @@ public: String val = kv.value(); if (_debug) { - SerialPrint("i", "onMqttRecive", "Прилетело MAC: " + dev + " key=" + key + " val=" + val); + SerialPrint("i", "ExternalMQTT", "Received MAC: " + dev + " key=" + key + " val=" + val); } if (_sensor == key) { dataFromNode = true; _minutesPassed = 0; setValue(val); - // setNewWidgetAttributes(); } - - // Serial.println("Key: " + key); - // Serial.println("Value: " + val); } } else { if (_debug) { - SerialPrint("i", "onMqttRecive", "Прилетело MAC: " + dev + " val=" + msg); + SerialPrint("i", "ExternalMQTT", "Received MAC: " + dev + " val=" + msg); } dataFromNode = true; _minutesPassed = 0; setValue(msg); - // setNewWidgetAttributes(); } } } + String getMqttExterSub() + { + return _topic; + } + void doByInterval() { _minutesPassed++; @@ -144,8 +144,7 @@ public: if (_minutesPassed >= offline) { jsonWriteStr(json, F("info"), F("offline")); - regEvent(NAN, "ExternalMQTT"); - SerialPrint("E", "ExternalMQTT", "V error", _id); + SerialPrint("i", "ExternalMQTT", _id + " - offline"); } } } @@ -155,22 +154,6 @@ public: } sendSubWidgetsValues(_id, json); } - /* - IoTValue execute(String command, std::vector ¶m) - { - if (command == "mqttSubscribe") - { - if (param.size() == 2) - { - if (!param[0].isDecimal && param[1].isDecimal) - { - mqttSubscribeExternal(param[0].valS, (bool)param[0].valD); - } - } - } - return {}; - } - */ ~ExternalMQTT(){}; }; diff --git a/src/modules/sensors/ExternalMQTT/modinfo.json b/src/modules/sensors/ExternalMQTT/modinfo.json index 9737126a..b1ed1b11 100644 --- a/src/modules/sensors/ExternalMQTT/modinfo.json +++ b/src/modules/sensors/ExternalMQTT/modinfo.json @@ -51,6 +51,7 @@ "defActive": false, "usedLibs": { "esp32_4mb": [], + "esp32_4mb3f": [], "esp32s2_4mb": [], "esp32cam_4mb": [], "esp8266_4mb": [], diff --git a/src/modules/sensors/FreqMeter/modinfo.json b/src/modules/sensors/FreqMeter/modinfo.json index ef730773..73fb8007 100644 --- a/src/modules/sensors/FreqMeter/modinfo.json +++ b/src/modules/sensors/FreqMeter/modinfo.json @@ -87,6 +87,9 @@ "esp32_4mb": [ "kosme/arduinoFFT@^1.5.6" ], + "esp32_4mb3f": [ + "kosme/arduinoFFT@^1.5.6" + ], "esp32cam_4mb": [ "kosme/arduinoFFT@^1.5.6" ], diff --git a/src/modules/sensors/GY21/modinfo.json b/src/modules/sensors/GY21/modinfo.json index 5018a9fd..aa80c3d4 100644 --- a/src/modules/sensors/GY21/modinfo.json +++ b/src/modules/sensors/GY21/modinfo.json @@ -52,6 +52,9 @@ "esp32_4mb": [ "https://github.com/JonasGMorsch/GY-21.git" ], + "esp32_4mb3f": [ + "https://github.com/JonasGMorsch/GY-21.git" + ], "esp32cam_4mb": [ "https://github.com/JonasGMorsch/GY-21.git" ], diff --git a/src/modules/sensors/Hdc1080/modinfo.json b/src/modules/sensors/Hdc1080/modinfo.json index c5514c3d..574a8331 100644 --- a/src/modules/sensors/Hdc1080/modinfo.json +++ b/src/modules/sensors/Hdc1080/modinfo.json @@ -55,6 +55,9 @@ "esp32_4mb": [ "ClosedCube HDC1080" ], + "esp32_4mb3f": [ + "ClosedCube HDC1080" + ], "esp32cam_4mb": [ "ClosedCube HDC1080" ], diff --git a/src/modules/sensors/Hx710/modinfo.json b/src/modules/sensors/Hx710/modinfo.json index e98e3c34..4a2bf5c7 100644 --- a/src/modules/sensors/Hx710/modinfo.json +++ b/src/modules/sensors/Hx710/modinfo.json @@ -49,6 +49,9 @@ "esp32_4mb": [ "https://github.com/kurimawxx00/hx710B_pressure_sensor" ], + "esp32_4mb3f": [ + "https://github.com/kurimawxx00/hx710B_pressure_sensor" + ], "esp32cam_4mb": [ "https://github.com/kurimawxx00/hx710B_pressure_sensor" ], diff --git a/src/modules/sensors/Hx711/modinfo.json b/src/modules/sensors/Hx711/modinfo.json index 04573254..d3713615 100644 --- a/src/modules/sensors/Hx711/modinfo.json +++ b/src/modules/sensors/Hx711/modinfo.json @@ -64,6 +64,9 @@ "esp32_4mb": [ "GyverHX711@1.2" ], + "esp32_4mb3f": [ + "GyverHX711@1.2" + ], "esp32cam_4mb": [ "GyverHX711@1.2" ], diff --git a/src/modules/sensors/Impulse/modinfo.json b/src/modules/sensors/Impulse/modinfo.json index a9cf2fd4..4fa98b2a 100644 --- a/src/modules/sensors/Impulse/modinfo.json +++ b/src/modules/sensors/Impulse/modinfo.json @@ -41,6 +41,7 @@ "defActive": true, "usedLibs": { "esp32_4mb": [], + "esp32_4mb3f": [], "esp32cam_4mb": [], "esp8266_4mb": [], "esp8266_1mb": [], diff --git a/src/modules/sensors/Ina219/Ina219.cpp b/src/modules/sensors/Ina219/Ina219.cpp index 60269a1a..ec05a6c8 100644 --- a/src/modules/sensors/Ina219/Ina219.cpp +++ b/src/modules/sensors/Ina219/Ina219.cpp @@ -38,7 +38,7 @@ INA219 *instanceIna219(uint8_t ADDR) // учитываем, что библиотека может работать с несколькими линиями на разных пинах, поэтому инициируем библиотеку, если линия ранее не использовалась if (ina219Array.find(ADDR) == ina219Array.end()) { - if (ina219SettingArray.find(ADDR) == ina219SettingArray.end()) + if (ina219SettingArray.find(ADDR) != ina219SettingArray.end()) ina219Array[ADDR] = new INA219(ina219SettingArray[ADDR]->shunt, ina219SettingArray[ADDR]->maxV, (uint8_t)ADDR); else ina219Array[ADDR] = new INA219(0.1f, 3.2f, (uint8_t)ADDR); // Стандартные значения для модуля INA219 (0.1 Ом, 3.2А, адрес 0x40) @@ -66,8 +66,7 @@ public: void doByInterval() { - value.valD = instanceIna219(_addr)->getVoltage(); - regEvent(value.valD, "Ina219voltage"); + regEvent(instanceIna219(_addr)->getVoltage(), "Ina219voltage"); } ~Ina219voltage(){}; @@ -90,8 +89,7 @@ public: } void doByInterval() { - value.valD = instanceIna219(_addr)->getShuntVoltage(); - regEvent(value.valD, "Ina219shuntvoltage"); + regEvent(instanceIna219(_addr)->getShuntVoltage(), "Ina219shuntvoltage"); } ~Ina219shuntvoltage(){}; @@ -114,8 +112,7 @@ public: } void doByInterval() { - value.valD = instanceIna219(_addr)->getCurrent(); - regEvent(value.valD, "Ina219curr"); + regEvent(instanceIna219(_addr)->getCurrent(), "Ina219curr"); } ~Ina219curr(){}; @@ -138,8 +135,7 @@ public: } void doByInterval() { - value.valD = instanceIna219(_addr)->getPower(); - regEvent(value.valD, "Ina219power"); // TODO: найти способ понимания ошибки получения данных + regEvent(instanceIna219(_addr)->getPower(), "Ina219power"); // TODO: найти способ понимания ошибки получения данных } ~Ina219Power(){}; diff --git a/src/modules/sensors/Ina219/modinfo.json b/src/modules/sensors/Ina219/modinfo.json index 7bc545f3..f9694297 100644 --- a/src/modules/sensors/Ina219/modinfo.json +++ b/src/modules/sensors/Ina219/modinfo.json @@ -122,6 +122,9 @@ "esp32_4mb": [ "https://github.com/GyverLibs/GyverINA" ], + "esp32_4mb3f": [ + "https://github.com/GyverLibs/GyverINA" + ], "esp32cam_4mb": [ "https://github.com/GyverLibs/GyverINA" ], diff --git a/src/modules/sensors/Ina226/Ina226.cpp b/src/modules/sensors/Ina226/Ina226.cpp index 74b614f6..1cbd8c51 100644 --- a/src/modules/sensors/Ina226/Ina226.cpp +++ b/src/modules/sensors/Ina226/Ina226.cpp @@ -38,7 +38,7 @@ INA226 *instanceIna226(uint8_t ADDR) // учитываем, что библиотека может работать с несколькими линиями на разных пинах, поэтому инициируем библиотеку, если линия ранее не использовалась if (ina226Array.find(ADDR) == ina226Array.end()) { - if (ina226SettingArray.find(ADDR) == ina226SettingArray.end()) + if (ina226SettingArray.find(ADDR) != ina226SettingArray.end()) ina226Array[ADDR] = new INA226(ina226SettingArray[ADDR]->shunt, ina226SettingArray[ADDR]->maxV, (uint8_t)ADDR); else ina226Array[ADDR] = new INA226(0.1f, 0.8f, (uint8_t)ADDR); // Стандартные значения для модуля INA226 (0.1 Ом, 0.8А, адрес 0x40) @@ -66,8 +66,7 @@ public: void doByInterval() { - value.valD = instanceIna226(_addr)->getVoltage(); - regEvent(value.valD, "Ina226voltage"); + regEvent(instanceIna226(_addr)->getVoltage(), "Ina226voltage"); } ~Ina226voltage(){}; @@ -90,8 +89,7 @@ public: } void doByInterval() { - value.valD = instanceIna226(_addr)->getShuntVoltage(); - regEvent(value.valD, "Ina226shuntvoltage"); + regEvent(vinstanceIna226(_addr)->getShuntVoltage(), "Ina226shuntvoltage"); } ~Ina226shuntvoltage(){}; @@ -114,8 +112,7 @@ public: } void doByInterval() { - value.valD = instanceIna226(_addr)->getCurrent(); - regEvent(value.valD, "Ina226curr"); + regEvent(instanceIna226(_addr)->getCurrent(), "Ina226curr"); } ~Ina226curr(){}; @@ -138,8 +135,7 @@ public: } void doByInterval() { - value.valD = instanceIna226(_addr)->getPower(); - regEvent(value.valD, "Ina226power"); // TODO: найти способ понимания ошибки получения данных + regEvent(instanceIna226(_addr)->getPower(), "Ina226power"); // TODO: найти способ понимания ошибки получения данных } ~Ina226Power(){}; diff --git a/src/modules/sensors/Ina226/modinfo.json b/src/modules/sensors/Ina226/modinfo.json index c6b6576d..5a8f7f15 100644 --- a/src/modules/sensors/Ina226/modinfo.json +++ b/src/modules/sensors/Ina226/modinfo.json @@ -122,6 +122,9 @@ "esp32_4mb": [ "https://github.com/GyverLibs/GyverINA" ], + "esp32_4mb3f": [ + "https://github.com/GyverLibs/GyverINA" + ], "esp32cam_4mb": [ "https://github.com/GyverLibs/GyverINA" ], diff --git a/src/modules/sensors/IoTWiegand/modinfo.json b/src/modules/sensors/IoTWiegand/modinfo.json index 34f165a3..f91afe00 100644 --- a/src/modules/sensors/IoTWiegand/modinfo.json +++ b/src/modules/sensors/IoTWiegand/modinfo.json @@ -39,6 +39,9 @@ "esp32_4mb": [ "https://github.com/jpliew/Wiegand-NG-Multi-Bit-Wiegand-Library-for-Arduino" ], + "esp32_4mb3f": [ + "https://github.com/jpliew/Wiegand-NG-Multi-Bit-Wiegand-Library-for-Arduino" + ], "esp32cam_4mb": [ "https://github.com/jpliew/Wiegand-NG-Multi-Bit-Wiegand-Library-for-Arduino" ], diff --git a/src/modules/sensors/Max6675/modinfo.json b/src/modules/sensors/Max6675/modinfo.json index d99c587d..469bbef1 100644 --- a/src/modules/sensors/Max6675/modinfo.json +++ b/src/modules/sensors/Max6675/modinfo.json @@ -41,6 +41,9 @@ "esp32_4mb": [ "adafruit/MAX6675 library" ], + "esp32_4mb3f": [ + "adafruit/MAX6675 library" + ], "esp8266_4mb": [ "adafruit/MAX6675 library" ] diff --git a/src/modules/sensors/Mhz19/modinfo.json b/src/modules/sensors/Mhz19/modinfo.json index 953e43b3..3eacecaf 100644 --- a/src/modules/sensors/Mhz19/modinfo.json +++ b/src/modules/sensors/Mhz19/modinfo.json @@ -79,6 +79,7 @@ "defActive": false, "usedLibs": { "esp32_4mb": [], + "esp32_4mb3f": [], "esp32s2_4mb": [ "plerup/EspSoftwareSerial" ], diff --git a/src/modules/sensors/Ntc/modinfo.json b/src/modules/sensors/Ntc/modinfo.json index d5c2aa4c..6f0b1ce4 100644 --- a/src/modules/sensors/Ntc/modinfo.json +++ b/src/modules/sensors/Ntc/modinfo.json @@ -51,6 +51,7 @@ "defActive": false, "usedLibs": { "esp32_4mb": [], + "esp32_4mb3f": [], "esp32cam_4mb": [], "esp8266_4mb": [], "esp8266_1mb": [], diff --git a/src/modules/sensors/Pzem004t/modinfo.json b/src/modules/sensors/Pzem004t/modinfo.json index 5028d83a..68f6299b 100644 --- a/src/modules/sensors/Pzem004t/modinfo.json +++ b/src/modules/sensors/Pzem004t/modinfo.json @@ -128,6 +128,7 @@ "defActive": true, "usedLibs": { "esp32_4mb": [], + "esp32_4mb3f": [], "esp32cam_4mb": [], "esp8266_4mb": [], "esp8266_1mb": [], diff --git a/src/modules/sensors/RCswitch/modinfo.json b/src/modules/sensors/RCswitch/modinfo.json index ffd93884..5c44ba44 100644 --- a/src/modules/sensors/RCswitch/modinfo.json +++ b/src/modules/sensors/RCswitch/modinfo.json @@ -64,6 +64,9 @@ "esp32_4mb": [ "rc-switch @ ^2.6.4" ], + "esp32_4mb3f": [ + "rc-switch @ ^2.6.4" + ], "esp32cam_4mb": [ "rc-switch @ ^2.6.4" ], diff --git a/src/modules/sensors/RTC/modinfo.json b/src/modules/sensors/RTC/modinfo.json index d9992762..77f24b28 100644 --- a/src/modules/sensors/RTC/modinfo.json +++ b/src/modules/sensors/RTC/modinfo.json @@ -62,6 +62,9 @@ "esp32_4mb": [ "https://github.com/tremaru/iarduino_RTC" ], + "esp32_4mb3f": [ + "https://github.com/tremaru/iarduino_RTC" + ], "esp32cam_4mb": [ "https://github.com/tremaru/iarduino_RTC" ], diff --git a/src/modules/sensors/S8/modinfo.json b/src/modules/sensors/S8/modinfo.json index 55dbe2fe..c4ac2fe9 100644 --- a/src/modules/sensors/S8/modinfo.json +++ b/src/modules/sensors/S8/modinfo.json @@ -36,6 +36,7 @@ "defActive": true, "usedLibs": { "esp32_4mb": [], + "esp32_4mb3f": [], "esp8266_4mb": [] } } \ No newline at end of file diff --git a/src/modules/sensors/Scd40/modinfo.json b/src/modules/sensors/Scd40/modinfo.json index cef07681..9e29e654 100644 --- a/src/modules/sensors/Scd40/modinfo.json +++ b/src/modules/sensors/Scd40/modinfo.json @@ -74,6 +74,10 @@ "Sensirion I2C SCD4x @0.4.0", "Sensirion Core @0.6.0" ], + "esp32_4mb3f": [ + "Sensirion I2C SCD4x @0.4.0", + "Sensirion Core @0.6.0" + ], "esp32cam_4mb": [ "Sensirion I2C SCD4x @0.4.0", "Sensirion Core @0.6.0" diff --git a/src/modules/sensors/Sds011/modinfo.json b/src/modules/sensors/Sds011/modinfo.json index f8a41fdb..3026e56e 100644 --- a/src/modules/sensors/Sds011/modinfo.json +++ b/src/modules/sensors/Sds011/modinfo.json @@ -69,6 +69,9 @@ "esp32_4mb": [ "Nova Fitness Sds dust sensors library@1.5.1" ], + "esp32_4mb3f": [ + "Nova Fitness Sds dust sensors library@1.5.1" + ], "esp32cam_4mb": [ "Nova Fitness Sds dust sensors library@1.5.1" ], diff --git a/src/modules/sensors/Sgp30/modinfo.json b/src/modules/sensors/Sgp30/modinfo.json index ec2ad09d..b3da3628 100644 --- a/src/modules/sensors/Sgp30/modinfo.json +++ b/src/modules/sensors/Sgp30/modinfo.json @@ -51,6 +51,9 @@ "esp32_4mb": [ "sparkfun/SparkFun SGP30 Arduino Library@^1.0.5" ], + "esp32_4mb3f": [ + "sparkfun/SparkFun SGP30 Arduino Library@^1.0.5" + ], "esp32cam_4mb": [ "sparkfun/SparkFun SGP30 Arduino Library@^1.0.5" ], diff --git a/src/modules/sensors/Sht20/modinfo.json b/src/modules/sensors/Sht20/modinfo.json index 5051007c..443b91b7 100644 --- a/src/modules/sensors/Sht20/modinfo.json +++ b/src/modules/sensors/Sht20/modinfo.json @@ -52,6 +52,9 @@ "esp32_4mb": [ "robtillaart/SHT2x@^0.1.1" ], + "esp32_4mb3f": [ + "robtillaart/SHT2x@^0.1.1" + ], "esp8266_4mb": [ "robtillaart/SHT2x@^0.1.1" ], diff --git a/src/modules/sensors/Sht30/modinfo.json b/src/modules/sensors/Sht30/modinfo.json index fccb48d6..5cbedff1 100644 --- a/src/modules/sensors/Sht30/modinfo.json +++ b/src/modules/sensors/Sht30/modinfo.json @@ -52,6 +52,9 @@ "esp32_4mb": [ "WEMOS SHT3x@1.0.0" ], + "esp32_4mb3f": [ + "WEMOS SHT3x@1.0.0" + ], "esp32cam_4mb": [ "WEMOS SHT3x@1.0.0" ], diff --git a/src/modules/sensors/Sonar/modinfo.json b/src/modules/sensors/Sonar/modinfo.json index 94487829..eaaeed5c 100644 --- a/src/modules/sensors/Sonar/modinfo.json +++ b/src/modules/sensors/Sonar/modinfo.json @@ -38,6 +38,7 @@ "defActive": true, "usedLibs": { "esp32_4mb": [], + "esp32_4mb3f": [], "esp32cam_4mb": [], "esp8266_4mb": [], "esp8266_1mb": [], diff --git a/src/modules/sensors/UART/modinfo.json b/src/modules/sensors/UART/modinfo.json index 9ab0f506..6eaa0e1c 100644 --- a/src/modules/sensors/UART/modinfo.json +++ b/src/modules/sensors/UART/modinfo.json @@ -77,6 +77,9 @@ "esp32_4mb": [ "plerup/EspSoftwareSerial" ], + "esp32_4mb3f": [ + "plerup/EspSoftwareSerial" + ], "esp32cam_4mb": [ "plerup/EspSoftwareSerial" ], diff --git a/src/modules/sensors/ld2410/modinfo.json b/src/modules/sensors/ld2410/modinfo.json index f9e4a314..298079f1 100644 --- a/src/modules/sensors/ld2410/modinfo.json +++ b/src/modules/sensors/ld2410/modinfo.json @@ -87,6 +87,9 @@ "usedLibs": { "esp32_4mb": [ "ncmreynolds/ld2410@^0.1.3" + ], + "esp32_4mb3f": [ + "ncmreynolds/ld2410@^0.1.3" ] } } \ No newline at end of file diff --git a/src/modules/virtual/Cron/modinfo.json b/src/modules/virtual/Cron/modinfo.json index 07ceb83f..6ba9d543 100644 --- a/src/modules/virtual/Cron/modinfo.json +++ b/src/modules/virtual/Cron/modinfo.json @@ -50,6 +50,7 @@ "defActive": true, "usedLibs": { "esp32_4mb": [], + "esp32_4mb3f": [], "esp32cam_4mb": [], "esp32_16mb": [], "esp32s2_4mb": [], diff --git a/src/modules/virtual/GoogleSheet/modinfo.json b/src/modules/virtual/GoogleSheet/modinfo.json index 5e7865f7..afb8f42e 100644 --- a/src/modules/virtual/GoogleSheet/modinfo.json +++ b/src/modules/virtual/GoogleSheet/modinfo.json @@ -59,6 +59,7 @@ "defActive": false, "usedLibs": { "esp32_4mb": [], + "esp32_4mb3f": [], "esp32cam_4mb": [], "esp32s2_4mb": [], "esp8266_4mb": [] diff --git a/src/modules/virtual/Loging/modinfo.json b/src/modules/virtual/Loging/modinfo.json index a3e50cbb..442637cb 100644 --- a/src/modules/virtual/Loging/modinfo.json +++ b/src/modules/virtual/Loging/modinfo.json @@ -51,6 +51,7 @@ "defActive": true, "usedLibs": { "esp32_4mb": [], + "esp32_4mb3f": [], "esp32cam_4mb": [], "esp32_16mb": [], "esp32s2_4mb": [], diff --git a/src/modules/virtual/LogingDaily/modinfo.json b/src/modules/virtual/LogingDaily/modinfo.json index 13176ebb..f04fd0af 100644 --- a/src/modules/virtual/LogingDaily/modinfo.json +++ b/src/modules/virtual/LogingDaily/modinfo.json @@ -44,6 +44,7 @@ "defActive": true, "usedLibs": { "esp32_4mb": [], + "esp32_4mb3f": [], "esp32cam_4mb": [], "esp32_16mb": [], "esp32s2_4mb": [], diff --git a/src/modules/virtual/Timer/modinfo.json b/src/modules/virtual/Timer/modinfo.json index 993b68f7..7882540a 100644 --- a/src/modules/virtual/Timer/modinfo.json +++ b/src/modules/virtual/Timer/modinfo.json @@ -74,6 +74,7 @@ "defActive": true, "usedLibs": { "esp32_4mb": [], + "esp32_4mb3f": [], "esp32cam_4mb": [], "esp32_16mb": [], "esp32s2_4mb": [], diff --git a/src/modules/virtual/VButton/modinfo.json b/src/modules/virtual/VButton/modinfo.json index 82b69dae..c38cd289 100644 --- a/src/modules/virtual/VButton/modinfo.json +++ b/src/modules/virtual/VButton/modinfo.json @@ -36,6 +36,7 @@ "defActive": true, "usedLibs": { "esp32_4mb": [], + "esp32_4mb3f": [], "esp32cam_4mb": [], "esp32_16mb": [], "esp32s2_4mb": [], diff --git a/src/modules/virtual/Variable/modinfo.json b/src/modules/virtual/Variable/modinfo.json index f5f14605..b155b0f9 100644 --- a/src/modules/virtual/Variable/modinfo.json +++ b/src/modules/virtual/Variable/modinfo.json @@ -96,6 +96,7 @@ "defActive": true, "usedLibs": { "esp32_4mb": [], + "esp32_4mb3f": [], "esp32cam_4mb": [], "esp32_16mb": [], "esp32s2_4mb": [], diff --git a/src/modules/virtual/VariableColor/modinfo.json b/src/modules/virtual/VariableColor/modinfo.json index 3bd3db9e..d3aa7769 100644 --- a/src/modules/virtual/VariableColor/modinfo.json +++ b/src/modules/virtual/VariableColor/modinfo.json @@ -35,6 +35,7 @@ "defActive": true, "usedLibs": { "esp32_4mb": [], + "esp32_4mb3f": [], "esp32cam_4mb": [], "esp32_16mb": [], "esp32s2_4mb": [], diff --git a/src/modules/virtual/Weather/modinfo.json b/src/modules/virtual/Weather/modinfo.json index a95ccd2f..e40f1127 100644 --- a/src/modules/virtual/Weather/modinfo.json +++ b/src/modules/virtual/Weather/modinfo.json @@ -40,6 +40,7 @@ "defActive": false, "usedLibs": { "esp32_4mb": [], + "esp32_4mb3f": [], "esp32cam_4mb": [], "esp32_16mb": [], "esp32s2_4mb": [], diff --git a/src/modules/virtual/owmWeather/modinfo.json b/src/modules/virtual/owmWeather/modinfo.json index e425d9fc..62eb7c2c 100644 --- a/src/modules/virtual/owmWeather/modinfo.json +++ b/src/modules/virtual/owmWeather/modinfo.json @@ -68,6 +68,7 @@ "usedLibs": { "esp32_4mb": [], + "esp32_4mb3f": [], "esp32s2_4mb": [], "esp32_16mb": [], "esp8266_4mb": [],