diff --git a/compilerProfile.json b/compilerProfile.json
index a3aa59f4..7c17d771 100644
--- a/compilerProfile.json
+++ b/compilerProfile.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",
@@ -146,6 +154,10 @@
}
],
"sensors": [
+ {
+ "path": "src/modules/exec/Pcf8591",
+ "active": false
+ },
{
"path": "src/modules/sensors/A02Distance",
"active": true
diff --git a/data_full/build/bundle.css.gz b/data_full/build/bundle.css.gz
index d7558d9b..29ab1fa8 100644
Binary files a/data_full/build/bundle.css.gz and b/data_full/build/bundle.css.gz differ
diff --git a/data_full/build/bundle.js.gz b/data_full/build/bundle.js.gz
index 63218540..24f6ab8b 100644
Binary files a/data_full/build/bundle.js.gz and b/data_full/build/bundle.js.gz differ
diff --git a/data_full/index.html b/data_full/index.html
index 4dc7d628..bbcd166f 100644
--- a/data_full/index.html
+++ b/data_full/index.html
@@ -4,12 +4,12 @@
-
IoT Manager 4.5.4
+ IoT Manager 4.5.5
-
+
-
+
diff --git a/data_svelte/build/bundle.css.gz b/data_svelte/build/bundle.css.gz
index d7558d9b..29ab1fa8 100644
Binary files a/data_svelte/build/bundle.css.gz and b/data_svelte/build/bundle.css.gz differ
diff --git a/data_svelte/build/bundle.js.gz b/data_svelte/build/bundle.js.gz
index 63218540..24f6ab8b 100644
Binary files a/data_svelte/build/bundle.js.gz and b/data_svelte/build/bundle.js.gz differ
diff --git a/data_svelte/flashProfile.json b/data_svelte/flashProfile.json
index bc38fdf5..825be6e6 100644
--- a/data_svelte/flashProfile.json
+++ b/data_svelte/flashProfile.json
@@ -48,6 +48,10 @@
}
],
"sensors": [
+ {
+ "path": "src/modules/exec/Pcf8591",
+ "active": false
+ },
{
"path": "src/modules/sensors/A02Distance",
"active": true
diff --git a/data_svelte/index.html b/data_svelte/index.html
index 4dc7d628..bbcd166f 100644
--- a/data_svelte/index.html
+++ b/data_svelte/index.html
@@ -4,12 +4,12 @@
- IoT Manager 4.5.4
+ IoT Manager 4.5.5
-
+
-
+
diff --git a/include/Const.h b/include/Const.h
index 2865cd60..09cc7d34 100644
--- a/include/Const.h
+++ b/include/Const.h
@@ -2,7 +2,7 @@
#include "BuildTime.h"
// Версия прошивки
-#define FIRMWARE_VERSION 454
+#define FIRMWARE_VERSION 455
#ifdef esp8266_1mb_ota
#define FIRMWARE_NAME "esp8266_1mb_ota"
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 a3aa59f4..7c17d771 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",
@@ -146,6 +154,10 @@
}
],
"sensors": [
+ {
+ "path": "src/modules/exec/Pcf8591",
+ "active": false
+ },
{
"path": "src/modules/sensors/A02Distance",
"active": true
diff --git a/platformio.ini b/platformio.ini
index 15dbd04f..10eae1e1 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}
@@ -587,6 +608,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/Pcf8574.cpp b/src/modules/exec/Pcf8574/Pcf8574.cpp
index f7b5454a..cba9282e 100644
--- a/src/modules/exec/Pcf8574/Pcf8574.cpp
+++ b/src/modules/exec/Pcf8574/Pcf8574.cpp
@@ -1,28 +1,23 @@
#include "Global.h"
#include "classes/IoTItem.h"
#include "classes/IoTGpio.h"
-
#include
#include
-#define PCF8574_I2CADDR_DEFAULT 0x20 ///< DS3502 default I2C address
+#define PCF8574_I2CADDR_DEFAULT 0x20 ///< DS3502 стандартный I2C адрес
class Adafruit_PCF8574_mod {
public:
- Adafruit_PCF8574_mod() {};
+ Adafruit_PCF8574_mod() : _pinConfig(0xFF) {}; // По умолчанию все пины настроены как входы
+
bool begin(uint8_t i2c_address = PCF8574_I2CADDR_DEFAULT, TwoWire *wire = &Wire) {
i2c_dev = new Adafruit_I2CDevice(i2c_address, wire);
-
- if (!i2c_dev->begin()) {
- return false;
- }
-
- return true;
+ return i2c_dev->begin();
}
bool digitalWriteByte(uint8_t d) {
_writebuf = d;
- return i2c_dev->write(&_writebuf, 1);
+ return updateRegister();
}
uint8_t digitalReadByte(void) {
@@ -32,20 +27,20 @@ class Adafruit_PCF8574_mod {
bool digitalWrite(int pinnum, bool val) {
if (val) {
- _writebuf |= 1 << pinnum;
+ _writebuf |= (1 << pinnum);
} else {
_writebuf &= ~(1 << pinnum);
}
- return i2c_dev->write(&_writebuf, 1);
+ return updateRegister(); // Обновляем регистр после изменения состояния пина
}
bool pinMode(int pinnum, uint8_t val) {
if ((val == INPUT) || (val == INPUT_PULLUP)) {
- _writebuf |= 1 << pinnum;
+ _pinConfig |= (1 << pinnum);
} else {
- _writebuf &= ~(1 << pinnum);
+ _pinConfig &= ~(1 << pinnum);
}
- return i2c_dev->write(&_writebuf, 1);
+ return updateRegister(); // Обновляем регистр после изменения конфигурации пина
}
bool digitalRead(int pinnum) {
@@ -55,6 +50,12 @@ class Adafruit_PCF8574_mod {
private:
uint8_t _readbuf = 0, _writebuf = 0;
+ uint8_t _pinConfig; // Конфигурация пинов (вход/выход)
+
+ bool updateRegister() {
+ uint8_t outputValue = (_writebuf & ~_pinConfig) | (_pinConfig);
+ return i2c_dev->write(&outputValue, 1); // Отправляем обновленное значение регистра на устройство
+ }
Adafruit_I2CDevice *i2c_dev;
};
@@ -66,7 +67,7 @@ class Pcf8574Driver : public IoTGpio {
public:
Pcf8574Driver(int index, String addr) : IoTGpio(index) {
if (!_pcf.begin(hexStringToUint8(addr), &Wire)) {
- Serial.println("PCF8574 Init Error.");
+ Serial.println("Ошибка инициализации PCF8574."); // Переводим на русский
}
}
@@ -85,11 +86,8 @@ class Pcf8574Driver : public IoTGpio {
void digitalInvert(int pin) {
_pcf.digitalWrite(pin, 1 - _pcf.digitalRead(pin));
}
-
- ~Pcf8574Driver() {};
};
-
class Pcf8574 : public IoTItem {
private:
Pcf8574Driver* _driver;
@@ -108,7 +106,7 @@ class Pcf8574 : public IoTItem {
int index;
jsonRead(parameters, "index", index);
if (index > 4) {
- Serial.println("Pcf8574 wrong index. Must be 0 - 4");
+ Serial.println("Неправильный индекс Pcf8574. Должен быть 0 - 4."); // Переводим на русский
return;
}
@@ -122,14 +120,13 @@ class Pcf8574 : public IoTItem {
}
}
- //возвращает ссылку на экземпляр класса Pcf8574Driver
IoTGpio* getGpioDriver() {
return _driver;
}
~Pcf8574() {
delete _driver;
- };
+ }
};
void* getAPI_Pcf8574(String subtype, String param) {
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/Pcf8591/Pcf8591.cpp b/src/modules/exec/Pcf8591/Pcf8591.cpp
new file mode 100644
index 00000000..ff7d45bc
--- /dev/null
+++ b/src/modules/exec/Pcf8591/Pcf8591.cpp
@@ -0,0 +1,71 @@
+#include "Global.h"
+#include "classes/IoTItem.h"
+
+#include "Wire.h"
+#include
+
+// Make sure that this is set to the value in volts of VCC
+#define ADC_REFERENCE_VOLTAGE 3.3
+
+class Pcf8591 : public IoTItem {
+ int _pin;
+ bool _isRaw;
+ bool _isInited = false;
+ Adafruit_PCF8591 pcf = Adafruit_PCF8591();
+
+ public:
+ Pcf8591(String parameters) : IoTItem(parameters) {
+ String tmp;
+ jsonRead(parameters, "pin", tmp);
+ _pin = tmp.toInt();
+
+ jsonRead(parameters, "mode", tmp);
+ _isRaw = tmp == "raw";
+
+ if (!pcf.begin()) {
+ Serial.println("# Adafruit PCF8591 not found!");
+ _isInited = false;
+ } else
+
+ _isInited = true;
+
+ Serial.println("# Adafruit PCF8591 found");
+
+ pcf.enableDAC(true);
+
+ Serial.println("AIN0, AIN1, AIN2, AIN3");
+
+ }
+
+ uint8_t dac_counter = 0;
+
+ void doByInterval() {
+
+ // Make a triangle wave on the DAC output
+ pcf.analogWrite(dac_counter++);
+
+ if (_isInited) {
+ if (_isRaw)
+ value.valD = pcf.analogRead(_pin); // Чтение АЦП нулевого канала (Вольты)
+ else
+ value.valD = (int_to_volts(pcf.analogRead(_pin), 8, ADC_REFERENCE_VOLTAGE));
+ regEvent(value.valD, "PCF8591");
+ }
+
+}
+
+ float int_to_volts(uint16_t dac_value, uint8_t bits, float logic_level) {
+ return (((float)dac_value / ((1 << bits) - 1)) * logic_level);
+
+ }
+
+ ~Pcf8591(){};
+};
+
+void *getAPI_Pcf8591(String subtype, String param) {
+ if (subtype == F("Pcf8591")) {
+ return new Pcf8591(param);
+ } else {
+ return nullptr;
+ }
+}
diff --git a/src/modules/exec/Pcf8591/modinfo.json b/src/modules/exec/Pcf8591/modinfo.json
new file mode 100644
index 00000000..c3bef508
--- /dev/null
+++ b/src/modules/exec/Pcf8591/modinfo.json
@@ -0,0 +1,75 @@
+{
+ "menuSection": "sensors",
+ "configItem": [
+ {
+ "global": 0,
+ "name": "Расширитель портов PCF8591",
+ "type": "Reading",
+ "subtype": "Pcf8591",
+ "id": "Pcf85",
+ "widget": "anydataVlt",
+ "page": "PCF8591",
+ "descr": "PCF_0",
+ "pin": "0",
+ "mode": "volt",
+ "map": "1,255,1,100",
+ "plus": 0,
+ "multiply": 1,
+ "round": 2,
+ "int": 7
+ }
+ ],
+ "about": {
+ "authorName": "Serghei Crasnicov",
+ "authorContact": "https://t.me/Serghei63",
+ "authorGit": "https://github.com/Serghei63",
+ "specialThanks": "",
+ "moduleName": "Pcf8591",
+ "moduleVersion": "1.0",
+ "usedRam": {
+ "esp32_4mb": 15,
+ "esp8266_4mb": 15
+ },
+ "title": "Расширитель 4-х аналоговых портов PCF8591",
+ "moduleDesc": "Позволяет получить относительную величину напряжения на понижающем трансформаторе.",
+ "propInfo": {
+ "pin": "Номер AN, к которому подключен датчик. Допускается 0, 1, 2, 3",
+ "mode": "Режим работы. volt - вывод в вольтах , raw - значения от 0 до 255",
+ "int": "Количество секунд между опросами датчика."
+ }
+ },
+ "defActive": false,
+ "usedLibs": {
+
+ "esp32_4mb": [
+ "https://github.com/adafruit/Adafruit_PCF8591"
+ ],
+ "esp32_16mb": [
+ "https://github.com/adafruit/Adafruit_PCF8591"
+ ],
+ "esp8266_4mb": [
+ "https://github.com/adafruit/Adafruit_PCF8591"
+ ],
+ "esp8266_16mb": [
+ "https://github.com/adafruit/Adafruit_PCF8591"
+ ],
+ "esp8266_1mb": [
+ "https://github.com/adafruit/Adafruit_PCF8591"
+ ],
+ "esp8266_1mb_ota": [
+ "https://github.com/adafruit/Adafruit_PCF8591"
+ ],
+ "esp8285_1mb": [
+ "https://github.com/adafruit/Adafruit_PCF8591"
+ ],
+ "esp8285_1mb_ota": [
+ "https://github.com/adafruit/Adafruit_PCF8591"
+ ],
+ "esp8266_2mb": [
+ "https://github.com/adafruit/Adafruit_PCF8591"
+ ],
+ "esp8266_2mb_ota": [
+ "https://github.com/adafruit/Adafruit_PCF8591"
+ ]
+ }
+}
\ No newline at end of file
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/Weather.cpp b/src/modules/virtual/Weather/Weather.cpp
index 9cadadeb..b173593f 100644
--- a/src/modules/virtual/Weather/Weather.cpp
+++ b/src/modules/virtual/Weather/Weather.cpp
@@ -3,7 +3,7 @@
#include
long prevWeatherMillis = millis() - 60001;
-StaticJsonDocument Weatherdoc;
+//StaticJsonDocument Weatherdoc;
extern IoTGpio IoTgpio;
class Weather : public IoTItem
@@ -12,9 +12,9 @@ private:
String _location;
String _param;
// long interval;
-
+ DynamicJsonDocument Weatherdoc;
public:
- Weather(String parameters) : IoTItem(parameters)
+ Weather(String parameters) : Weatherdoc(1024), IoTItem(parameters)
{
_location = jsonReadStr(parameters, "location");
_param = jsonReadStr(parameters, "param");
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 2a4c8af0..520e0761 100644
--- a/src/modules/virtual/owmWeather/modinfo.json
+++ b/src/modules/virtual/owmWeather/modinfo.json
@@ -54,7 +54,7 @@
"param": "Тип текущего Item: temp - температура, humidity - влажность, pressure - давление, speed - скорость ветра, deg - направление ветра, all - процент облачности, sunrise - рассвет, sunset - закат, description - Погодные условия, icon - код иконки, name - город. Если оставить пустым пудет искать и публиковать при изменении в Items с именами wea_temp и т.д. wea_...",
"int": "Интервал запроса погоды в минутах",
"API_key": "API ключ",
- "сity": "Название города, через запятую можно уочнить код страны. Наример Moscow или Moscow,ru или Москва. Если город не задан будут использоваться координаты. OWM рекомендует координаты",
+ "city": "Название города, через запятую можно уочнить код страны. Наример Moscow или Moscow,ru или Москва. Если город не задан будут использоваться координаты. OWM рекомендует координаты",
"lon": "Долгота, при использовании координат, будет автоматически выбран ближайший город",
"lat": "Широта, при использовании координат, будет автоматически выбран ближайший город",
"lang": "Язык используемый в ответах OpenWetaherMap",
@@ -64,6 +64,7 @@
"defActive": false,
"usedLibs": {
"esp32_4mb": [],
+ "esp32_4mb3f": [],
"esp32s2_4mb": [],
"esp32_16mb": []
}
diff --git a/src/modules/virtual/owmWeather/owmWeather.cpp b/src/modules/virtual/owmWeather/owmWeather.cpp
index 44785e7d..90699baf 100644
--- a/src/modules/virtual/owmWeather/owmWeather.cpp
+++ b/src/modules/virtual/owmWeather/owmWeather.cpp
@@ -4,7 +4,7 @@
#include "NTP.h"
// long prevWeatherMillis = millis() - 60001;
// TODO Зачем так много???
-StaticJsonDocument Weatherdoc1;
+// StaticJsonDocument Weatherdoc1;
extern IoTGpio IoTgpio;
class owmWeather : public IoTItem
@@ -21,17 +21,19 @@ private:
String _lon = "";
String _lang = "";
bool _debug = false;
+ DynamicJsonDocument Weatherdoc1;
public:
- owmWeather(String parameters) : IoTItem(parameters)
+ owmWeather(String parameters) : Weatherdoc1(1024), IoTItem(parameters)
{
_API_key = jsonReadStr(parameters, "API_key");
// _ID_sity = jsonReadStr(parameters, "ID_sity");
- _city = jsonReadStr(parameters, "city");
- _lon = jsonReadStr(parameters, "lon");
- _lat = jsonReadStr(parameters, "lat");
- _lang = jsonReadStr(parameters, "lang");
- _param = jsonReadStr(parameters, "param");
+ if (!jsonRead(parameters, "city", _city))
+ _city = "";
+ jsonRead(parameters, "lon", _lon);
+ jsonRead(parameters, "lat", _lat);
+ jsonRead(parameters, "lang", _lang);
+ jsonRead(parameters, "param", _param);
jsonRead(parameters, "debug", _debug);
long interval;
jsonRead(parameters, F("int"), interval); // в минутах
@@ -79,7 +81,8 @@ public:
payload = http.getString();
deserializeJson(Weatherdoc1, payload);
- ret += payload;
+ // ret += payload;
+ SerialPrint("i", "Weatherdoc1", "memoryUsage: " + String(Weatherdoc1.memoryUsage()));
}
}
else
@@ -181,7 +184,7 @@ public:
}
// проверяем если пришедшее значение отличается от предыдущего регистрируем событие
- static void publishNew(String root, String param)
+ void publishNew(String root, String param)
{
IoTItem *tmp = findIoTItem("wea_" + param);
if (!tmp)