new board esp32 3m flash, bugfix modules

This commit is contained in:
Mit4el
2023-10-08 18:19:08 +03:00
parent 0b3289a0ea
commit 164f3be998
86 changed files with 348 additions and 72 deletions

View File

@@ -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",

View File

@@ -65,6 +65,7 @@ class IoTItem {
virtual void setValue(const String& valStr, bool genEvent = true);
String getRoundValue();
void getNetEvent(String& event);
virtual String getMqttExterSub();
// хуки для системных событий (должны начинаться с "on")
virtual void onRegEvent(IoTItem* item);

View File

@@ -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",

View File

@@ -199,6 +199,27 @@ build_src_filter =
+<modules/*.cpp>
${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>
+<classes/*.cpp>
+<utils/*.cpp>
+<modules/*.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 =
+<modules/display/Smi2_m>
+<modules/display/TM16XX>
[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 =
+<modules/virtual/Cron>
+<modules/virtual/Loging>
+<modules/virtual/LogingDaily>
+<modules/virtual/Timer>
+<modules/virtual/Variable>
+<modules/virtual/VariableColor>
+<modules/virtual/VButton>
+<modules/sensors/Acs712>
+<modules/sensors/AhtXX>
+<modules/sensors/AnalogAdc>
+<modules/sensors/Bme280>
+<modules/sensors/Bmp280>
+<modules/sensors/Dht1122>
+<modules/sensors/Ds18b20>
+<modules/sensors/Impulse>
+<modules/sensors/Pzem004t>
+<modules/sensors/RTC>
+<modules/sensors/S8>
+<modules/sensors/Sht20>
+<modules/sensors/Sht30>
+<modules/sensors/Sonar>
+<modules/sensors/UART>
+<modules/exec/ButtonIn>
+<modules/exec/ButtonOut>
+<modules/exec/Buzzer>
+<modules/exec/Enconder>
+<modules/exec/IoTServo>
+<modules/exec/Mcp23017>
+<modules/exec/Mp3>
+<modules/exec/Multitouch>
+<modules/exec/Pcf8574>
+<modules/exec/Pwm32>
+<modules/exec/TelegramLT>
+<modules/display/Lcd2004>
+<modules/display/Smi2_m>
+<modules/display/TM16XX>
[env:esp32cam_4mb_fromitems]
lib_deps =
espressif/esp32-camera @ ^2.0.0

View File

@@ -118,6 +118,15 @@ void mqttSubscribe() {
mqtt.subscribe((mqttPrefix + "/+/+/order/#").c_str());
mqtt.subscribe((mqttPrefix + "/+/+/info").c_str());
}
for (std::list<IoTItem*>::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) {

View File

@@ -185,6 +185,10 @@ void IoTItem::checkIntFromNet() {
}
}
String IoTItem::getMqttExterSub() {
return "";
}
// хуки для системных событий (должны начинаться с "on")
void IoTItem::onRegEvent(IoTItem* item) {}
void IoTItem::onMqttRecive(String& topic, String& msg) {}

View File

@@ -44,6 +44,7 @@
"defActive": false,
"usedLibs": {
"esp32_4mb": [],
"esp32_4mb3f": [],
"esp32cam_4mb": [],
"esp8266_4mb": [],
"esp8266_1mb": [],

View File

@@ -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"

View File

@@ -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"
],

View File

@@ -76,6 +76,9 @@
"esp32_4mb": [
"gyverlibs/GyverOLED @ 1.4"
],
"esp32_4mb3f": [
"gyverlibs/GyverOLED @ 1.4"
],
"esp32_16mb": [
"gyverlibs/GyverOLED @ 1.4"
],

View File

@@ -53,6 +53,7 @@
"defActive": true,
"usedLibs": {
"esp32_4mb": [],
"esp32_4mb3f": [],
"esp32cam_4mb": []
}
}

View File

@@ -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",

View File

@@ -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"
],

View File

@@ -46,6 +46,7 @@
"defActive": true,
"usedLibs": {
"esp32_4mb": [],
"esp32_4mb3f": [],
"esp32cam_4mb": [],
"esp32_16mb": [],
"esp32s2_4mb": [],

View File

@@ -50,6 +50,7 @@
"defActive": true,
"usedLibs": {
"esp32_4mb": [],
"esp32_4mb3f": [],
"esp32cam_4mb": [],
"esp32_16mb": [],
"esp32s2_4mb": [],

View File

@@ -104,6 +104,7 @@
"defActive": true,
"usedLibs": {
"esp32_4mb": [],
"esp32_4mb3f": [],
"esp32cam_4mb": [],
"esp8266_4mb": [],
"esp8266_1mb": [],

View File

@@ -46,6 +46,9 @@
"esp32_4mb": [
"gyverlibs/EncButton @ ^2.0"
],
"esp32_4mb3f": [
"gyverlibs/EncButton @ ^2.0"
],
"esp32cam_4mb": [
"gyverlibs/EncButton @ ^2.0"
],

View File

@@ -35,6 +35,7 @@
"defActive": false,
"usedLibs": {
"esp32_4mb": [],
"esp32_4mb3f": [],
"esp32cam_4mb": [],
"esp32_16mb": [],
"esp32s2_4mb": [],

View File

@@ -50,6 +50,7 @@
"defActive": false,
"usedLibs": {
"esp32_4mb": [],
"esp32_4mb3f": [],
"esp32cam_4mb": [],
"esp32s2_4mb": [],
"esp8266_4mb": [],

View File

@@ -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"
],

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"
],

View File

@@ -44,6 +44,7 @@
"defActive": true,
"usedLibs": {
"esp32_4mb": [],
"esp32_4mb3f": [],
"esp32cam_4mb": [],
"esp8266_4mb": [],
"esp8266_1mb": [],

View File

@@ -50,6 +50,7 @@
"defActive": false,
"usedLibs": {
"esp32_4mb": [],
"esp32_4mb3f": [],
"esp32cam_4mb": []
}
}

View File

@@ -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"
],

View File

@@ -45,6 +45,7 @@
"defActive": true,
"usedLibs": {
"esp32_4mb": [],
"esp32_4mb3f": [],
"esp32cam_4mb": []
}
}

View File

@@ -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"
]

View File

@@ -33,6 +33,7 @@
"defActive": false,
"usedLibs": {
"esp32_4mb": [],
"esp32_4mb3f": [],
"esp32cam_4mb": [],
"esp8266_4mb": []
}

View File

@@ -58,6 +58,9 @@
"esp32_4mb": [
"CTBot @2.1.9"
],
"esp32_4mb3f": [
"CTBot @2.1.9"
],
"esp32cam_4mb": [
"CTBot @2.1.9"
],

View File

@@ -52,6 +52,7 @@
"defActive": true,
"usedLibs": {
"esp32_4mb": [],
"esp32_4mb3f": [],
"esp32cam_4mb": [],
"esp32_16mb": [],
"esp32s2_4mb": [],

View File

@@ -77,6 +77,9 @@
"esp32_4mb": [
"gyverlibs/FastBot"
],
"esp32_4mb3f": [
"gyverlibs/FastBot"
],
"esp32cam_4mb": [
"gyverlibs/FastBot"
],

View File

@@ -152,6 +152,7 @@ class ThermostatPID : public IoTItem
private:
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,16 +239,36 @@ 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;
@@ -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);
}

View File

@@ -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": [],

View File

@@ -42,6 +42,7 @@
"defActive": true,
"usedLibs": {
"esp32_4mb": [],
"esp32_4mb3f": [],
"esp32cam_4mb": [],
"esp32s2_4mb": [],
"esp8266_4mb": [],

View File

@@ -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"
],

View File

@@ -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"
],

View File

@@ -42,6 +42,7 @@
"defActive": true,
"usedLibs": {
"esp32_4mb": [],
"esp32_4mb3f": [],
"esp32cam_4mb": [],
"esp8266_4mb": [],
"esp8266_1mb": [],

View File

@@ -37,6 +37,9 @@
"esp32_4mb": [
"BH1750"
],
"esp32_4mb3f": [
"BH1750"
],
"esp32cam_4mb": [
"BH1750"
],

View File

@@ -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"

View File

@@ -83,6 +83,9 @@
"esp32_4mb": [
"adafruit/Adafruit BME280 Library"
],
"esp32_4mb3f": [
"adafruit/Adafruit BME280 Library"
],
"esp32cam_4mb": [
"adafruit/Adafruit BME280 Library"
],

View File

@@ -55,6 +55,9 @@
"esp32_4mb": [
"adafruit/Adafruit BMP280 Library"
],
"esp32_4mb3f": [
"adafruit/Adafruit BMP280 Library"
],
"esp32cam_4mb": [
"adafruit/Adafruit BMP280 Library"
],

View File

@@ -36,6 +36,7 @@
"defActive": false,
"usedLibs": {
"esp32_4mb": [],
"esp32_4mb3f": [],
"esp32cam_4mb": [],
"esp8266_4mb": [],
"esp8266_1mb": [],

View File

@@ -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"
],

View File

@@ -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"
],

View File

@@ -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"

View File

@@ -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"
],

View File

@@ -76,6 +76,7 @@
"defActive": false,
"usedLibs": {
"esp32_4mb": [],
"esp32_4mb3f": [],
"esp32cam_4mb": [],
"esp32s2_4mb": [],
"esp8266_4mb": [],

View File

@@ -15,7 +15,6 @@ private:
bool dataFromNode = false;
String _topic = "";
bool _isJson;
// bool _addPrefix;
bool _debug;
bool sendOk = false;
@@ -28,13 +27,15 @@ 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);
}
}
char *TimeToString(unsigned long t)
{
static char str[12];
@@ -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<JsonObject>();
@@ -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<IoTValue> &param)
{
if (command == "mqttSubscribe")
{
if (param.size() == 2)
{
if (!param[0].isDecimal && param[1].isDecimal)
{
mqttSubscribeExternal(param[0].valS, (bool)param[0].valD);
}
}
}
return {};
}
*/
~ExternalMQTT(){};
};

View File

@@ -51,6 +51,7 @@
"defActive": false,
"usedLibs": {
"esp32_4mb": [],
"esp32_4mb3f": [],
"esp32s2_4mb": [],
"esp32cam_4mb": [],
"esp8266_4mb": [],

View File

@@ -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"
],

View File

@@ -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"
],

View File

@@ -55,6 +55,9 @@
"esp32_4mb": [
"ClosedCube HDC1080"
],
"esp32_4mb3f": [
"ClosedCube HDC1080"
],
"esp32cam_4mb": [
"ClosedCube HDC1080"
],

View File

@@ -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"
],

View File

@@ -64,6 +64,9 @@
"esp32_4mb": [
"GyverHX711@1.2"
],
"esp32_4mb3f": [
"GyverHX711@1.2"
],
"esp32cam_4mb": [
"GyverHX711@1.2"
],

View File

@@ -41,6 +41,7 @@
"defActive": true,
"usedLibs": {
"esp32_4mb": [],
"esp32_4mb3f": [],
"esp32cam_4mb": [],
"esp8266_4mb": [],
"esp8266_1mb": [],

View File

@@ -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(){};

View File

@@ -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"
],

View File

@@ -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(){};

View File

@@ -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"
],

View File

@@ -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"
],

View File

@@ -41,6 +41,9 @@
"esp32_4mb": [
"adafruit/MAX6675 library"
],
"esp32_4mb3f": [
"adafruit/MAX6675 library"
],
"esp8266_4mb": [
"adafruit/MAX6675 library"
]

View File

@@ -79,6 +79,7 @@
"defActive": false,
"usedLibs": {
"esp32_4mb": [],
"esp32_4mb3f": [],
"esp32s2_4mb": [
"plerup/EspSoftwareSerial"
],

View File

@@ -51,6 +51,7 @@
"defActive": false,
"usedLibs": {
"esp32_4mb": [],
"esp32_4mb3f": [],
"esp32cam_4mb": [],
"esp8266_4mb": [],
"esp8266_1mb": [],

View File

@@ -128,6 +128,7 @@
"defActive": true,
"usedLibs": {
"esp32_4mb": [],
"esp32_4mb3f": [],
"esp32cam_4mb": [],
"esp8266_4mb": [],
"esp8266_1mb": [],

View File

@@ -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"
],

View File

@@ -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"
],

View File

@@ -36,6 +36,7 @@
"defActive": true,
"usedLibs": {
"esp32_4mb": [],
"esp32_4mb3f": [],
"esp8266_4mb": []
}
}

View File

@@ -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"

View File

@@ -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"
],

View File

@@ -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"
],

View File

@@ -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"
],

View File

@@ -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"
],

View File

@@ -38,6 +38,7 @@
"defActive": true,
"usedLibs": {
"esp32_4mb": [],
"esp32_4mb3f": [],
"esp32cam_4mb": [],
"esp8266_4mb": [],
"esp8266_1mb": [],

View File

@@ -77,6 +77,9 @@
"esp32_4mb": [
"plerup/EspSoftwareSerial"
],
"esp32_4mb3f": [
"plerup/EspSoftwareSerial"
],
"esp32cam_4mb": [
"plerup/EspSoftwareSerial"
],

View File

@@ -87,6 +87,9 @@
"usedLibs": {
"esp32_4mb": [
"ncmreynolds/ld2410@^0.1.3"
],
"esp32_4mb3f": [
"ncmreynolds/ld2410@^0.1.3"
]
}
}

View File

@@ -50,6 +50,7 @@
"defActive": true,
"usedLibs": {
"esp32_4mb": [],
"esp32_4mb3f": [],
"esp32cam_4mb": [],
"esp32_16mb": [],
"esp32s2_4mb": [],

View File

@@ -59,6 +59,7 @@
"defActive": false,
"usedLibs": {
"esp32_4mb": [],
"esp32_4mb3f": [],
"esp32cam_4mb": [],
"esp32s2_4mb": [],
"esp8266_4mb": []

View File

@@ -51,6 +51,7 @@
"defActive": true,
"usedLibs": {
"esp32_4mb": [],
"esp32_4mb3f": [],
"esp32cam_4mb": [],
"esp32_16mb": [],
"esp32s2_4mb": [],

View File

@@ -44,6 +44,7 @@
"defActive": true,
"usedLibs": {
"esp32_4mb": [],
"esp32_4mb3f": [],
"esp32cam_4mb": [],
"esp32_16mb": [],
"esp32s2_4mb": [],

View File

@@ -74,6 +74,7 @@
"defActive": true,
"usedLibs": {
"esp32_4mb": [],
"esp32_4mb3f": [],
"esp32cam_4mb": [],
"esp32_16mb": [],
"esp32s2_4mb": [],

View File

@@ -36,6 +36,7 @@
"defActive": true,
"usedLibs": {
"esp32_4mb": [],
"esp32_4mb3f": [],
"esp32cam_4mb": [],
"esp32_16mb": [],
"esp32s2_4mb": [],

View File

@@ -96,6 +96,7 @@
"defActive": true,
"usedLibs": {
"esp32_4mb": [],
"esp32_4mb3f": [],
"esp32cam_4mb": [],
"esp32_16mb": [],
"esp32s2_4mb": [],

View File

@@ -35,6 +35,7 @@
"defActive": true,
"usedLibs": {
"esp32_4mb": [],
"esp32_4mb3f": [],
"esp32cam_4mb": [],
"esp32_16mb": [],
"esp32s2_4mb": [],

View File

@@ -40,6 +40,7 @@
"defActive": false,
"usedLibs": {
"esp32_4mb": [],
"esp32_4mb3f": [],
"esp32cam_4mb": [],
"esp32_16mb": [],
"esp32s2_4mb": [],

View File

@@ -68,6 +68,7 @@
"usedLibs": {
"esp32_4mb": [],
"esp32_4mb3f": [],
"esp32s2_4mb": [],
"esp32_16mb": [],
"esp8266_4mb": [],