diff --git a/data/items/items.txt b/data/items/items.txt index 48ac1334..3cd3c335 100644 --- a/data/items/items.txt +++ b/data/items/items.txt @@ -19,7 +19,7 @@ 0;bmp280;tmpid;anydataTemp;Сенсоры;Температура;1;c[1] 0;bmp280;prsid;anydataPress;Сенсоры;Давление;3;c[1];addr[0x76];int[10]* 0;ccs811;ppmid;anydataPpm;Сенсоры;Содержание#CO2;1;c[1] -0;ccs811;ppbid;anydataPpb;Сенсоры;Содержание#орг#соед;2;c[1];int[10]* +0;ccs811;ppbid;anydataPpb;Сенсоры;Содержание#орг#соед;2;c[1];addr[0x76];int[10]* 0;impuls-out;impid;na;na;na;order;gpio* 0;count-down;cntid;anydata;Таймер;Обратный#отчет;order* 0;inoutput;txtid;anydata;Вывод;Вывод#uart;order* diff --git a/data/set.device.json.gz b/data/set.device.json.gz index bac0b0a9..3a067824 100644 Binary files a/data/set.device.json.gz and b/data/set.device.json.gz differ diff --git a/data_ungzip/set.device.json b/data_ungzip/set.device.json index 8cf55c7b..6b1b055b 100644 --- a/data_ungzip/set.device.json +++ b/data_ungzip/set.device.json @@ -43,7 +43,7 @@ }, { "type": "h4", - "title": "Версия файловой системы: 275" + "title": "Версия файловой системы: 276" }, { "type": "h4", diff --git a/include/Consts.h b/include/Consts.h index 9a0b5bbb..a4bb9c2a 100644 --- a/include/Consts.h +++ b/include/Consts.h @@ -1,6 +1,6 @@ #pragma once -#define FIRMWARE_VERSION 275 +#define FIRMWARE_VERSION 276 #ifdef esp8266_4mb #define FIRMWARE_NAME "esp8266_4mb" diff --git a/platformio.ini b/platformio.ini index bb600258..94ccba46 100644 --- a/platformio.ini +++ b/platformio.ini @@ -11,7 +11,7 @@ ;To choose board please use one of definition: ;esp8266_1mb , esp8266_4mb , esp32_4mb [platformio] -default_envs = esp8266_4mb +default_envs = esp8266_1mb [common_env_data] diff --git a/src/ItemsList.cpp b/src/ItemsList.cpp index 10415c85..6cde0280 100644 --- a/src/ItemsList.cpp +++ b/src/ItemsList.cpp @@ -52,7 +52,7 @@ void addItem2(int num) { if (seachingLine.indexOf("gpio") != -1) { seachingLine.replace("gpio", "pin[" + String(getFreePinAll()) + "]"); } - + addFile(DEVICE_CONFIG_FILE, seachingLine); Serial.println(seachingLine); } @@ -132,7 +132,7 @@ uint8_t getFreePinAll() { uint8_t pins[] = {0, 12, 13, 14, 15, 16, 1, 2, 3, 4, 5}; #endif #ifdef ESP32 - uint8_t pins[] = {0, 12, 13, 14, 15, 16, 1, 2, 3, 4, 5}; + uint8_t pins[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 15, 16, 17, 18, 19, 21, 22, 23, 25, 26, 27, 32, 33, 34, 35, 36, 39}; #endif uint8_t array_sz = sizeof(pins) / sizeof(pins[0]); uint8_t i = getNewElementNumber("pins.txt"); @@ -145,7 +145,12 @@ uint8_t getFreePinAll() { bool isPinExist(unsigned int num) { bool ret = false; +#ifdef ESP8266 unsigned int pins[] = {0, 1, 2, 3, 4, 5, 9, 10, 12, 13, 14, 15, 16}; +#endif +#ifdef ESP32 + unsigned int pins[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 15, 16, 17, 18, 19, 21, 22, 23, 25, 26, 27, 32, 33, 34, 35, 36, 39}; +#endif uint8_t array_sz = sizeof(pins) / sizeof(pins[0]); for (uint8_t i = 0; i < array_sz; i++) { if (pins[i] == num) ret = true; diff --git a/src/items/vSensorAnalog.cpp b/src/items/vSensorAnalog.cpp index ea1ec282..c59bcbbb 100644 --- a/src/items/vSensorAnalog.cpp +++ b/src/items/vSensorAnalog.cpp @@ -7,7 +7,7 @@ SensorAnalog::SensorAnalog(String key, unsigned long interval, unsigned int adcPin, int map1, int map2, int map3, int map4, float c) { _interval = interval * 1000; _key = key; - _adcPin = _adcPin; + _adcPin = adcPin; _map1 = map1; _map2 = map2; diff --git a/src/items/vSensorCcs811.cpp b/src/items/vSensorCcs811.cpp index 97d9eed5..f0d31f86 100644 --- a/src/items/vSensorCcs811.cpp +++ b/src/items/vSensorCcs811.cpp @@ -12,7 +12,7 @@ SensorCcs811::SensorCcs811(const paramsCcs811& paramsPpm, const paramsCcs811& pa ccs811 = new Adafruit_CCS811(); - if (!ccs811->begin()) SerialPrint("E", "Sensor CCS", "Wire not connected"); + if (!ccs811->begin(hexStringToUint8(_paramsPpb.addr))) SerialPrint("E", "Sensor CCS", "Wire not connected"); } SensorCcs811::~SensorCcs811() {} diff --git a/src/main.cpp b/src/main.cpp index a9bf0f88..c120e6ed 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -19,17 +19,17 @@ #include "Utils/Timings.h" #include "Utils/WebUtils.h" #include "items/ButtonInClass.h" -#include "items/vSensorUptime.h" #include "items/vCountDown.h" #include "items/vImpulsOut.h" #include "items/vLogging.h" #include "items/vSensorAnalog.h" #include "items/vSensorBme280.h" #include "items/vSensorBmp280.h" +#include "items/vSensorCcs811.h" #include "items/vSensorDallas.h" #include "items/vSensorDht.h" #include "items/vSensorUltrasonic.h" -#include "items/vSensorCcs811.h" +#include "items/vSensorUptime.h" void not_async_actions(); @@ -160,9 +160,14 @@ void loop() { mySensorBmp280->at(i).loop(); } } - if (mySensorCcs811 != nullptr) { + if (mySensorCcs811 != nullptr) { for (unsigned int i = 0; i < mySensorCcs811->size(); i++) { mySensorCcs811->at(i).loop(); } } + if (mySensorUptime != nullptr) { + for (unsigned int i = 0; i < mySensorUptime->size(); i++) { + mySensorUptime->at(i).loop(); + } + } } \ No newline at end of file