mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-31 12:29:14 +03:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0b5d7236aa | ||
|
|
bce8723ecf | ||
|
|
b7fcedb6c3 | ||
|
|
54cb92d2bb | ||
|
|
6902d57be2 |
@@ -19,7 +19,7 @@
|
|||||||
0;bmp280;tmpid;anydataTemp;Сенсоры;Температура;1;c[1]
|
0;bmp280;tmpid;anydataTemp;Сенсоры;Температура;1;c[1]
|
||||||
0;bmp280;prsid;anydataPress;Сенсоры;Давление;3;c[1];addr[0x76];int[10]*
|
0;bmp280;prsid;anydataPress;Сенсоры;Давление;3;c[1];addr[0x76];int[10]*
|
||||||
0;ccs811;ppmid;anydataPpm;Сенсоры;Содержание#CO2;1;c[1]
|
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;impuls-out;impid;na;na;na;order;gpio*
|
||||||
0;count-down;cntid;anydata;Таймер;Обратный#отчет;order*
|
0;count-down;cntid;anydata;Таймер;Обратный#отчет;order*
|
||||||
0;inoutput;txtid;anydata;Вывод;Вывод#uart;order*
|
0;inoutput;txtid;anydata;Вывод;Вывод#uart;order*
|
||||||
|
|||||||
Binary file not shown.
@@ -43,7 +43,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "h4",
|
"type": "h4",
|
||||||
"title": "Версия файловой системы: 275"
|
"title": "Версия файловой системы: 276"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "h4",
|
"type": "h4",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#define FIRMWARE_VERSION 275
|
#define FIRMWARE_VERSION 276
|
||||||
|
|
||||||
#ifdef esp8266_4mb
|
#ifdef esp8266_4mb
|
||||||
#define FIRMWARE_NAME "esp8266_4mb"
|
#define FIRMWARE_NAME "esp8266_4mb"
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ void addItem2(int num) {
|
|||||||
if (seachingLine.indexOf("gpio") != -1) {
|
if (seachingLine.indexOf("gpio") != -1) {
|
||||||
seachingLine.replace("gpio", "pin[" + String(getFreePinAll()) + "]");
|
seachingLine.replace("gpio", "pin[" + String(getFreePinAll()) + "]");
|
||||||
}
|
}
|
||||||
|
|
||||||
addFile(DEVICE_CONFIG_FILE, seachingLine);
|
addFile(DEVICE_CONFIG_FILE, seachingLine);
|
||||||
Serial.println(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};
|
uint8_t pins[] = {0, 12, 13, 14, 15, 16, 1, 2, 3, 4, 5};
|
||||||
#endif
|
#endif
|
||||||
#ifdef ESP32
|
#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
|
#endif
|
||||||
uint8_t array_sz = sizeof(pins) / sizeof(pins[0]);
|
uint8_t array_sz = sizeof(pins) / sizeof(pins[0]);
|
||||||
uint8_t i = getNewElementNumber("pins.txt");
|
uint8_t i = getNewElementNumber("pins.txt");
|
||||||
@@ -145,7 +145,12 @@ uint8_t getFreePinAll() {
|
|||||||
|
|
||||||
bool isPinExist(unsigned int num) {
|
bool isPinExist(unsigned int num) {
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
|
#ifdef ESP8266
|
||||||
unsigned int pins[] = {0, 1, 2, 3, 4, 5, 9, 10, 12, 13, 14, 15, 16};
|
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]);
|
uint8_t array_sz = sizeof(pins) / sizeof(pins[0]);
|
||||||
for (uint8_t i = 0; i < array_sz; i++) {
|
for (uint8_t i = 0; i < array_sz; i++) {
|
||||||
if (pins[i] == num) ret = true;
|
if (pins[i] == num) ret = true;
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
#include "Upgrade.h"
|
|
||||||
|
|
||||||
#include "FileSystem.h"
|
|
||||||
|
|
||||||
#include "Class/NotAsync.h"
|
#include "Class/NotAsync.h"
|
||||||
|
#include "FileSystem.h"
|
||||||
|
#include "Upgrade.h"
|
||||||
#ifdef ESP8266
|
#ifdef ESP8266
|
||||||
#include "ESP8266.h"
|
#include "ESP8266.h"
|
||||||
#else
|
#else
|
||||||
@@ -45,12 +43,10 @@ void getLastVersion() {
|
|||||||
#endif
|
#endif
|
||||||
if (tmp == "error") {
|
if (tmp == "error") {
|
||||||
lastVersion = -1;
|
lastVersion = -1;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
lastVersion = tmp.toInt();
|
lastVersion = tmp.toInt();
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
lastVersion = -2;
|
lastVersion = -2;
|
||||||
}
|
}
|
||||||
jsonWriteInt(configSetupJson, "last_version", lastVersion);
|
jsonWriteInt(configSetupJson, "last_version", lastVersion);
|
||||||
@@ -97,7 +93,7 @@ bool upgradeFS() {
|
|||||||
Serial.printf("Start upgrade %s, please wait...", FS_NAME);
|
Serial.printf("Start upgrade %s, please wait...", FS_NAME);
|
||||||
#ifdef ESP8266
|
#ifdef ESP8266
|
||||||
ESPhttpUpdate.rebootOnUpdate(false);
|
ESPhttpUpdate.rebootOnUpdate(false);
|
||||||
t_httpUpdate_return retFS = ESPhttpUpdate.updateSpiffs(wifiClient, serverIP + F("/projects/iotmanager/esp8266/") + FS_NAME + "/"+ FS_NAME+ ".bin");
|
t_httpUpdate_return retFS = ESPhttpUpdate.updateSpiffs(wifiClient, serverIP + F("/projects/iotmanager/esp8266/littlefs/littlefs.bin"));
|
||||||
#else
|
#else
|
||||||
httpUpdate.rebootOnUpdate(false);
|
httpUpdate.rebootOnUpdate(false);
|
||||||
HTTPUpdateResult retFS = httpUpdate.updateSpiffs(wifiClient, serverIP + F("/projects/iotmanager/esp32/littlefs/spiffs.bin"));
|
HTTPUpdateResult retFS = httpUpdate.updateSpiffs(wifiClient, serverIP + F("/projects/iotmanager/esp32/littlefs/spiffs.bin"));
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
SensorAnalog::SensorAnalog(String key, unsigned long interval, unsigned int adcPin, int map1, int map2, int map3, int map4, float c) {
|
SensorAnalog::SensorAnalog(String key, unsigned long interval, unsigned int adcPin, int map1, int map2, int map3, int map4, float c) {
|
||||||
_interval = interval * 1000;
|
_interval = interval * 1000;
|
||||||
_key = key;
|
_key = key;
|
||||||
_adcPin = _adcPin;
|
_adcPin = adcPin;
|
||||||
|
|
||||||
_map1 = map1;
|
_map1 = map1;
|
||||||
_map2 = map2;
|
_map2 = map2;
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ SensorCcs811::SensorCcs811(const paramsCcs811& paramsPpm, const paramsCcs811& pa
|
|||||||
|
|
||||||
ccs811 = new Adafruit_CCS811();
|
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() {}
|
SensorCcs811::~SensorCcs811() {}
|
||||||
|
|||||||
11
src/main.cpp
11
src/main.cpp
@@ -19,17 +19,17 @@
|
|||||||
#include "Utils/Timings.h"
|
#include "Utils/Timings.h"
|
||||||
#include "Utils/WebUtils.h"
|
#include "Utils/WebUtils.h"
|
||||||
#include "items/ButtonInClass.h"
|
#include "items/ButtonInClass.h"
|
||||||
#include "items/vSensorUptime.h"
|
|
||||||
#include "items/vCountDown.h"
|
#include "items/vCountDown.h"
|
||||||
#include "items/vImpulsOut.h"
|
#include "items/vImpulsOut.h"
|
||||||
#include "items/vLogging.h"
|
#include "items/vLogging.h"
|
||||||
#include "items/vSensorAnalog.h"
|
#include "items/vSensorAnalog.h"
|
||||||
#include "items/vSensorBme280.h"
|
#include "items/vSensorBme280.h"
|
||||||
#include "items/vSensorBmp280.h"
|
#include "items/vSensorBmp280.h"
|
||||||
|
#include "items/vSensorCcs811.h"
|
||||||
#include "items/vSensorDallas.h"
|
#include "items/vSensorDallas.h"
|
||||||
#include "items/vSensorDht.h"
|
#include "items/vSensorDht.h"
|
||||||
#include "items/vSensorUltrasonic.h"
|
#include "items/vSensorUltrasonic.h"
|
||||||
#include "items/vSensorCcs811.h"
|
#include "items/vSensorUptime.h"
|
||||||
|
|
||||||
void not_async_actions();
|
void not_async_actions();
|
||||||
|
|
||||||
@@ -160,9 +160,14 @@ void loop() {
|
|||||||
mySensorBmp280->at(i).loop();
|
mySensorBmp280->at(i).loop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (mySensorCcs811 != nullptr) {
|
if (mySensorCcs811 != nullptr) {
|
||||||
for (unsigned int i = 0; i < mySensorCcs811->size(); i++) {
|
for (unsigned int i = 0; i < mySensorCcs811->size(); i++) {
|
||||||
mySensorCcs811->at(i).loop();
|
mySensorCcs811->at(i).loop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (mySensorUptime != nullptr) {
|
||||||
|
for (unsigned int i = 0; i < mySensorUptime->size(); i++) {
|
||||||
|
mySensorUptime->at(i).loop();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user