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

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