PreRelease+bin. Persistant&Config mgmt done+fixes

This commit is contained in:
2021-12-26 01:41:56 +03:00
parent 184abef5a4
commit 12fe7ea71e
25 changed files with 42070 additions and 42001 deletions

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -245,52 +245,93 @@ bool systemConfig::isValidSysConf()
if (stream->write(EEPROM_signature[i])); if (stream->write(EEPROM_signature[i]));
stream->close(); stream->close();
setETAG(""); setETAG("");
setSerialDebuglevel(7);
setUdpDebuglevel(7);
return true; return true;
} }
/// systemConfigFlags systemConfig::getConfigFlags()
{
systemConfigFlags flags;
flags.configFlags32bit=0;
flags.serialDebugLevel=7;
flags.udpDebugLevel=7;
if (stream && isValidSysConf())
{
openStream('r');
stream->seek(offsetof(systemConfigData,configFlags));
stream->readBytes((uint8_t *) &flags,sizeof (flags));
stream->close();
}
return flags;
}
bool systemConfig::setConfigFlags(systemConfigFlags flags)
{
if (!stream || !isValidSysConf()) return false;
openStream('r');
stream->seek(offsetof(systemConfigData,configFlags));
int bytes = stream->write((uint8_t *) &flags, sizeof (flags));
stream->close();
return bytes;
}
bool systemConfig::getSaveSuccedConfig() bool systemConfig::getSaveSuccedConfig()
{ {
return false; systemConfigFlags flags = getConfigFlags();
return !flags.notSaveSuccedConfig;
} }
bool systemConfig::setSaveSuccedConfig(bool) bool systemConfig::setSaveSuccedConfig(bool flag)
{ {
return false; systemConfigFlags flags = getConfigFlags();
flags.notSaveSuccedConfig=!flag;
return setConfigFlags(flags);
} }
/// bool systemConfig::getLoadHTTPConfig()
{
systemConfigFlags flags = getConfigFlags();
return !flags.notGetConfigFromHTTP;
}
bool systemConfig::setLoadHTTPConfig(bool load)
{
systemConfigFlags flags = getConfigFlags();
flags.notGetConfigFromHTTP=!load;
return setConfigFlags(flags);
}
bool systemConfig::setSerialDebuglevel(short level) bool systemConfig::setSerialDebuglevel(short level)
{ {
return false; systemConfigFlags flags = getConfigFlags();
flags.serialDebugLevel=level;
return setConfigFlags(flags);
} }
bool systemConfig::setUdpDebuglevel(short level) bool systemConfig::setUdpDebuglevel(short level)
{ {
return false; systemConfigFlags flags = getConfigFlags();
flags.udpDebugLevel=level;
return setConfigFlags(flags);
} }
uint8_t systemConfig::getSerialDebuglevel() uint8_t systemConfig::getSerialDebuglevel()
{ {
return 7; systemConfigFlags flags = getConfigFlags();
return flags.serialDebugLevel;
} }
uint8_t systemConfig::getUdpDebuglevel() uint8_t systemConfig::getUdpDebuglevel()
{ {
return 7; systemConfigFlags flags = getConfigFlags();
} return flags.udpDebugLevel;
//
bool systemConfig::setLoadHTTPConfig(bool load)
{
return false;
}
bool systemConfig::getLoadHTTPConfig()
{
return false;
} }
String systemConfig::getETAG() String systemConfig::getETAG()

View File

@@ -61,5 +61,8 @@ class systemConfig {
bool saveETAG(); bool saveETAG();
bool loadETAG(); bool loadETAG();
systemConfigFlags getConfigFlags();
bool setConfigFlags(systemConfigFlags flags);
//bool Save(); //bool Save();
}; };

View File

@@ -1056,7 +1056,10 @@ if (status2Send) cmd.saveItem(this,status2Send);
//debugSerial<<F("sts:")<<status2Send<<endl; //debugSerial<<F("sts:")<<status2Send<<endl;
if (driver) //New style modular code if (driver) //New style modular code
{
res = driver->Ctrl(cmd, subItem, toExecute); res = driver->Ctrl(cmd, subItem, toExecute);
//if (res==-1) status2Send=0; ///////not working
}
else else
{ {
switch (itemType) { switch (itemType) {

View File

@@ -343,7 +343,13 @@ uint16_t httpHandler(Client& client, String request, uint8_t method, long conten
if (! result) return 404; if (! result) return 404;
return result; return result;
} }
else else if (method == HTTP_POST && request.startsWith(F("/config.json")))
{
sysConf.setLoadHTTPConfig(false);
infoSerial<<(F("Config changed locally, portal disabled"))<<endl;
sysConf.setETAG("");
return 0;
}
#endif #endif
return 0; //Unknown return 0; //Unknown
} }
@@ -574,21 +580,34 @@ lan_status lanLoop() {
case LIBS_INITIALIZED: case LIBS_INITIALIZED:
statusLED.set(ledRED|ledGREEN|((configLoaded)?ledBLINK:0)); statusLED.set(ledRED|ledGREEN|((configLoaded)?ledBLINK:0));
if (configLocked) return LIBS_INITIALIZED; if (configLocked) return LIBS_INITIALIZED;
if (sysConf.getLoadHTTPConfig())
{
if (!configOk)
{
if (loadConfigFromHttp()==200) lanStatus = IP_READY_CONFIG_LOADED_CONNECTING_TO_BROKER;
else if (configLoaded) {
infoSerial<<F("Continue with previously loaded config")<<endl;
lanStatus = IP_READY_CONFIG_LOADED_CONNECTING_TO_BROKER;
}
if (!configOk) else if (Ethernet.localIP()) lanStatus = DO_READ_RE_CONFIG;
{
if (loadConfigFromHttp()) lanStatus = IP_READY_CONFIG_LOADED_CONNECTING_TO_BROKER; else lanStatus = DO_REINIT; //Load from NVRAM
else if (configLoaded) { }
infoSerial<<F("Continue with previously loaded config")<<endl; else
lanStatus = IP_READY_CONFIG_LOADED_CONNECTING_TO_BROKER; {
} infoSerial<<F("Config is valid")<<endl;
else lanStatus = READ_RE_CONFIG; //Load from NVRAM lanStatus = IP_READY_CONFIG_LOADED_CONNECTING_TO_BROKER;
} }
else } else
{ {
infoSerial<<F("Config is valid")<<endl; if (configLoaded)
lanStatus = IP_READY_CONFIG_LOADED_CONNECTING_TO_BROKER; lanStatus = IP_READY_CONFIG_LOADED_CONNECTING_TO_BROKER;
} else
lanStatus = DO_READ_RE_CONFIG;
infoSerial<<F("Loading config from portal disabled. use get ON to enable")<<endl;
}
break; break;
case IP_READY_CONFIG_LOADED_CONNECTING_TO_BROKER: case IP_READY_CONFIG_LOADED_CONNECTING_TO_BROKER:
@@ -625,6 +644,7 @@ lan_status lanLoop() {
case DO_REINIT: // Pause and re-init LAN case DO_REINIT: // Pause and re-init LAN
//if (mqttClient.connected()) mqttClient.disconnect(); // Hmm hungs then cable disconnected //if (mqttClient.connected()) mqttClient.disconnect(); // Hmm hungs then cable disconnected
// problem here - if no sockets - DHCP will failed. finally (())
timerLanCheckTime = millis();// + 5000; timerLanCheckTime = millis();// + 5000;
lanStatus = REINIT; lanStatus = REINIT;
statusLED.set(ledRED|((configLoaded)?ledBLINK:0)); statusLED.set(ledRED|((configLoaded)?ledBLINK:0));
@@ -652,13 +672,22 @@ lan_status lanLoop() {
lanStatus = IP_READY_CONFIG_LOADED_CONNECTING_TO_BROKER;//2; lanStatus = IP_READY_CONFIG_LOADED_CONNECTING_TO_BROKER;//2;
break; break;
case DO_READ_RE_CONFIG: // Pause and re-read EEPROM
timerLanCheckTime = millis();
lanStatus = READ_RE_CONFIG;
//statusLED.set(ledRED|((configLoaded)?ledBLINK:0));
break;
case READ_RE_CONFIG: // Restore config from FLASH, re-init LAN case READ_RE_CONFIG: // Restore config from FLASH, re-init LAN
debugSerial<<F("Restoring config from EEPROM")<<endl; if (isTimeOver(timerLanCheckTime,millis(),TIMEOUT_REINIT))
if (loadConfigFromEEPROM()) lanStatus = IP_READY_CONFIG_LOADED_CONNECTING_TO_BROKER;//2; {
else { debugSerial<<F("Restoring config from EEPROM")<<endl;
//timerLanCheckTime = millis();// + 5000; if (loadConfigFromEEPROM()) lanStatus = IP_READY_CONFIG_LOADED_CONNECTING_TO_BROKER;//2;
lanStatus = DO_REINIT;//-10; else {
} //timerLanCheckTime = millis();// + 5000;
lanStatus = DO_REINIT;//-10;
}
}
break; break;
case DO_NOTHING: case DO_NOTHING:
@@ -841,7 +870,7 @@ void ip_ready_config_loaded_connecting_to_broker() {
if (!mqttArr || ((n = aJson.getArraySize(mqttArr)) < 2)) //At least device name and broker IP must be configured if (!mqttArr || ((n = aJson.getArraySize(mqttArr)) < 2)) //At least device name and broker IP must be configured
{ {
errorSerial<<F("At least device name and broker IP must be configured")<<endl; errorSerial<<F("At least device name and broker IP must be configured")<<endl;
lanStatus = READ_RE_CONFIG; lanStatus = DO_READ_RE_CONFIG;
return; return;
} }
@@ -1262,6 +1291,8 @@ setupSyslog();
switch (it.itemType) { switch (it.itemType) {
case CH_THERMO: case CH_THERMO:
if (cmd<1) it.setCmd(CMD_OFF); if (cmd<1) it.setCmd(CMD_OFF);
it.setFlag(SEND_COMMAND);
if (it.itemVal) it.setFlag(SEND_PARAMETERS);
pinMode(pin, OUTPUT); pinMode(pin, OUTPUT);
digitalWrite(pin, false); //Initially, all thermostates are LOW (OFF for electho heaters, open for water NO) digitalWrite(pin, false); //Initially, all thermostates are LOW (OFF for electho heaters, open for water NO)
debugSerial<<F("Thermo:")<<pin<<F("=LOW")<<F(";"); debugSerial<<F("Thermo:")<<pin<<F("=LOW")<<F(";");
@@ -1290,7 +1321,6 @@ setupSyslog();
printConfigSummary(); printConfigSummary();
configLoaded=true; configLoaded=true;
if (sysConf.getSaveSuccedConfig()) cmdFunctionSave(0,NULL);
ethClient.stop(); //Refresh MQTT connection ethClient.stop(); //Refresh MQTT connection
configLocked--; configLocked--;
} }
@@ -1547,23 +1577,29 @@ if (arg_cnt>1)
if (lanStatus>=HAVE_IP_ADDRESS) if (lanStatus>=HAVE_IP_ADDRESS)
{ {
configOk=false;
lanStatus=LIBS_INITIALIZED;
return 200;
}
errorSerial<<F("No IP adress")<<endl;
return 500;
/*
if (loadConfigFromHttp(arg_cnt, args)) int retCode=loadConfigFromHttp();
if (retCode==200)
{ {
lanStatus =IP_READY_CONFIG_LOADED_CONNECTING_TO_BROKER; lanStatus =IP_READY_CONFIG_LOADED_CONNECTING_TO_BROKER;
return 200; return 200;
} }
else if (retCode == -1)
{
debugSerial<<F("Releasing socket and retry")<<endl;
configOk=false;
lanStatus=LIBS_INITIALIZED;
ethClient.stop(); // Release MQTT socket
return 201;
}
// Not Loaded // Not Loaded
if (configLoaded) lanStatus =IP_READY_CONFIG_LOADED_CONNECTING_TO_BROKER; if (configLoaded) lanStatus =IP_READY_CONFIG_LOADED_CONNECTING_TO_BROKER;
else lanStatus = READ_RE_CONFIG; else lanStatus = DO_READ_RE_CONFIG;
return 500; */ return retCode;
}
errorSerial<<F("No IP adress")<<endl;
return 500;
} }
void printBool(bool arg) { (arg) ? infoSerial<<F("+") : infoSerial<<F("-"); } void printBool(bool arg) { (arg) ? infoSerial<<F("+") : infoSerial<<F("-"); }
@@ -1580,7 +1616,7 @@ void headerHandlerProc(String header)
} }
} }
bool loadConfigFromHttp() int loadConfigFromHttp()
{ {
//macAddress * mac = sysConf.getMAC(); //macAddress * mac = sysConf.getMAC();
int responseStatusCode = 0; int responseStatusCode = 0;
@@ -1625,14 +1661,13 @@ if (!sysConf.getServer(configServer,sizeof(configServer)))
// FILE is the return STREAM type of the HTTPClient // FILE is the return STREAM type of the HTTPClient
configStream = hclient.getURI(URI,NULL,get_header); configStream = hclient.getURI(URI,NULL,get_header);
responseStatusCode = hclient.getLastReturnCode(); responseStatusCode = hclient.getLastReturnCode();
debugSerial<<F("http retcode ")<<responseStatusCode<<endl;delay(100); //debugSerial<<F("http retcode ")<<responseStatusCode<<endl;delay(100);
//wdt_en(); //wdt_en();
if (configStream != NULL) { if (configStream != NULL) {
if (responseStatusCode == 200) { if (responseStatusCode == 200) {
infoSerial<<F("got Config\n"); delay(500); infoSerial<<F("got Config\n"); delay(500);
char c;
aJsonFileStream as = aJsonFileStream(configStream); aJsonFileStream as = aJsonFileStream(configStream);
noInterrupts(); noInterrupts();
cleanConf(); cleanConf();
@@ -1644,30 +1679,33 @@ if (!sysConf.getServer(configServer,sizeof(configServer)))
{ {
sysConf.setETAG(""); sysConf.setETAG("");
errorSerial<<F("Config parsing failed\n"); errorSerial<<F("Config parsing failed\n");
return false; return 0;
} }
else { else {
applyConfig(); applyConfig();
if (configLoaded && sysConf.getSaveSuccedConfig()) cmdFunctionSave(0,NULL);
infoSerial<<F("Done.\n"); infoSerial<<F("Done.\n");
return true; return 200;
} }
} }
else if (responseStatusCode == 304) else if (responseStatusCode == 304)
{ {
errorSerial<<F("Config not changed\n"); infoSerial<<F("Config not changed\n");
return false; hclient.closeStream(configStream);
return responseStatusCode;
} }
else else
{ {
errorSerial<<F("ERROR: Server returned "); errorSerial<<F("ERROR: Server returned ");
hclient.closeStream(configStream);
errorSerial<<responseStatusCode<<endl; errorSerial<<responseStatusCode<<endl;
return false; return responseStatusCode;
} }
} else { } else {
debugSerial<<F("failed to connect\n"); debugSerial<<F("failed to connect\n");
return false; return -1;
} }
#endif #endif
#if defined(__SAM3X8E__) || defined(ARDUINO_ARCH_STM32) || defined (NRF5) //|| defined(ARDUINO_ARCH_AVR)//|| defined(ARDUINO_ARCH_ESP32) //|| defined(ARDUINO_ARCH_ESP8266) #if defined(__SAM3X8E__) || defined(ARDUINO_ARCH_STM32) || defined (NRF5) //|| defined(ARDUINO_ARCH_AVR)//|| defined(ARDUINO_ARCH_ESP32) //|| defined(ARDUINO_ARCH_ESP8266)
@@ -1713,32 +1751,33 @@ if (!sysConf.getServer(configServer,sizeof(configServer)))
if (!root) { if (!root) {
errorSerial<<F("Config parsing failed\n"); errorSerial<<F("Config parsing failed\n");
sysConf.setETAG(""); sysConf.setETAG("");
return false; return 0;
} }
else { else {
debugSerial<<F("Parsed. Free:")<<freeRam()<<endl; debugSerial<<F("Parsed. Free:")<<freeRam()<<endl;
//debugSerial<<response; //debugSerial<<response;
applyConfig(); applyConfig();
infoSerial<<F("Done.\n"); infoSerial<<F("Done.\n");
return true; if (configLoaded && sysConf.getSaveSuccedConfig()) cmdFunctionSave(0,NULL);
return 200;
} }
} }
else if (responseStatusCode == 304) else if (responseStatusCode == 304)
{ {
errorSerial<<F("Config not changed\n"); errorSerial<<F("Config not changed\n");
htclient.stop(); htclient.stop();
return false; return responseStatusCode;
} }
else { else {
errorSerial<<F("Config retrieving failed\n"); errorSerial<<F("Config retrieving failed\n");
htclient.stop(); htclient.stop();
return false; return responseStatusCode;
} }
} }
else else
{ {
errorSerial<<F("Connect failed\n"); errorSerial<<F("Connect failed\n");
return false; return -1;
} }
#endif #endif
@@ -1784,36 +1823,36 @@ if (!sysConf.getServer(configServer,sizeof(configServer)))
} else } else
{ {
httpClient.end(); httpClient.end();
return false; return -1;
} }
if (!root) { if (!root) {
sysConf.setETAG(""); sysConf.setETAG("");
errorSerial<<F("Config parsing failed\n"); errorSerial<<F("Config parsing failed\n");
return false; return 0;
} else { } else {
applyConfig(); applyConfig();
if (configLoaded && sysConf.getSaveSuccedConfig()) cmdFunctionSave(0,NULL);
infoSerial<<F("Done.\n"); infoSerial<<F("Done.\n");
return true; return 200;
} }
} }
else if (responseStatusCode == HTTP_CODE_NOT_MODIFIED) else if (responseStatusCode == HTTP_CODE_NOT_MODIFIED)
{ {
httpClient.end(); httpClient.end();
errorSerial<<F("Config not changed\n"); errorSerial<<F("Config not changed\n");
return false; return responseStatusCode;
} }
else else
{ {
httpClient.end(); httpClient.end();
errorSerial<<F("Config retrieving failed\n"); errorSerial<<F("Config retrieving failed\n");
return false; return responseStatusCode;
} }
} else } else
{ {
errorSerial.printf("[HTTP] GET... failed, error: %s\n", httpClient.errorToString(responseStatusCode).c_str()); errorSerial.printf("[HTTP] GET... failed, error: %s\n", httpClient.errorToString(responseStatusCode).c_str());
httpClient.end(); httpClient.end();
return false; return responseStatusCode;
} }
#endif #endif
} }
@@ -1890,11 +1929,11 @@ void setup_main() {
if(SPIFFS.begin()) if(SPIFFS.begin())
#endif #endif
{ {
debugSerial<<("SPIFFS Initialize....ok")<<endl; debugSerialPort.println("SPIFFS Initialize....ok");
} }
else else
{ {
debugSerial<<("SPIFFS Initialization...failed")<<endl; debugSerialPort.println("SPIFFS Initialization...failed");
} }
#endif #endif
#else #else
@@ -1909,7 +1948,7 @@ void setup_main() {
if (!sysConf.isValidSysConf()) if (!sysConf.isValidSysConf())
{ {
infoSerial<<F("No valid EEPROM data")<<endl; debugSerialPort.println(F("No valid EEPROM data. Initializing."));
sysConf.clear(); sysConf.clear();
} }
// scan_i2c_bus(); // scan_i2c_bus();

View File

@@ -213,6 +213,7 @@ enum lan_status {
DO_RECONNECT = 12, DO_RECONNECT = 12,
RECONNECT = 13, RECONNECT = 13,
READ_RE_CONFIG = 14, READ_RE_CONFIG = 14,
DO_READ_RE_CONFIG = 15,
DO_NOTHING = -15 DO_NOTHING = -15
}; };
@@ -266,7 +267,7 @@ void saveFlash(short n, IPAddress& ip);
int ipLoadFromFlash(short n, IPAddress &ip); int ipLoadFromFlash(short n, IPAddress &ip);
*/ */
bool loadConfigFromHttp(); int loadConfigFromHttp();
void preTransmission(); void preTransmission();

View File

@@ -53,6 +53,7 @@ void out_AC::InsertData(byte data[], size_t size){
char s_mode[10]; char s_mode[10];
set_tmp = data[B_SET_TMP]+16; set_tmp = data[B_SET_TMP]+16;
if (set_tmp>40 || set_tmp<16) return;
cur_tmp = data[B_CUR_TMP]; cur_tmp = data[B_CUR_TMP];
mode = data[B_MODE]; mode = data[B_MODE];
fan_spd = data[B_FAN_SPD]; fan_spd = data[B_FAN_SPD];
@@ -250,8 +251,8 @@ if (cause!=POLLING_SLOW) return 0;
debugSerial.println ("Polling"); debugSerial.println ("Polling");
SendData(qstn, sizeof(qstn)/sizeof(byte)); //Опрос кондиционера SendData(qstn, sizeof(qstn)/sizeof(byte)); //Опрос кондиционера
} }
delay(100); ///delay(100);
if(AC_Serial.available() > 0){ if(AC_Serial.available() >= 37){ //was 0
AC_Serial.readBytes(data, 37); AC_Serial.readBytes(data, 37);
while(AC_Serial.available()){ while(AC_Serial.available()){
delay(2); delay(2);
@@ -282,13 +283,14 @@ int out_AC::Ctrl(itemCmd cmd, char* subItem , bool toExecute)
switch(suffixCode) switch(suffixCode)
{ {
case S_SET: case S_SET:
//case S_ESET:
set_tmp = cmd.getInt(); set_tmp = cmd.getInt();
if (set_tmp >= 10 && set_tmp <= 30) if (set_tmp >= 16 && set_tmp <= 40)
{ {
//if (set_tmp>40 || set_tmp<16) set_temp=21;
data[B_SET_TMP] = set_tmp -16; data[B_SET_TMP] = set_tmp -16;
publishTopic(item->itemArr->name,(long) set_tmp,"/set"); publishTopic(item->itemArr->name,(long) set_tmp,"/set");
} }
else return -1;
break; break;
case S_CMD: case S_CMD:

View File

@@ -70,7 +70,7 @@
#define WIFI_TIMEOUT 60000UL #define WIFI_TIMEOUT 60000UL
#define TIMEOUT_RECONNECT 10000UL #define TIMEOUT_RECONNECT 10000UL
#define TIMEOUT_REINIT 5000UL #define TIMEOUT_REINIT 5000UL
#define TIMEOUT_RETAIN 5000UL #define TIMEOUT_RETAIN 8000UL
#define INTERVAL_1W 5000UL #define INTERVAL_1W 5000UL
#define PERIOD_THERMOSTAT_FAILED (600 * 1000UL)>>8 #define PERIOD_THERMOSTAT_FAILED (600 * 1000UL)>>8

View File

@@ -5,7 +5,7 @@
#define MAXFLASHSTR 32 #define MAXFLASHSTR 32
#define PWDFLASHSTR 16 #define PWDFLASHSTR 16
#define EEPROM_SIGNATURE "LHC0" #define EEPROM_SIGNATURE "LHC1"
#define EEPROM_SIGNATURE_LENGTH 4 #define EEPROM_SIGNATURE_LENGTH 4
//#define EEPROM_offsetJSON IFLASH_PAGE_SIZE //#define EEPROM_offsetJSON IFLASH_PAGE_SIZE
@@ -18,20 +18,26 @@ const char EEPROM_signature[] = EEPROM_SIGNATURE;
typedef uint8_t macAddress[6]; typedef uint8_t macAddress[6];
#pragma pack(push, 1) #pragma pack(push, 1)
typedef union
{
uint32_t configFlags32bit;
struct
{
uint8_t serialDebugLevel:3;
uint8_t notGetConfigFromHTTP:1;
uint8_t udpDebugLevel:3;
uint8_t notSaveSuccedConfig:1;
uint8_t spare2;
uint16_t sysConfigHash;
};
} systemConfigFlags;
typedef struct typedef struct
{ {
char signature[4]; char signature[4];
macAddress mac; //6 bytes macAddress mac; //6 bytes
union { uint16_t spare; //2 bytes
uint16_t configFlags; systemConfigFlags configFlags; //4 bytes
struct
{
uint8_t serialDebugLevel:4;
uint8_t syslogDebugLevel:4;
uint8_t notGetConfigFromHTTP:1;
uint8_t saveToFlash:1;
};
};
uint32_t ip; uint32_t ip;
uint32_t dns; uint32_t dns;
uint32_t gw; uint32_t gw;
@@ -41,7 +47,5 @@ const char EEPROM_signature[] = EEPROM_SIGNATURE;
flashpwd MQTTpwd; flashpwd MQTTpwd;
flashpwd OTApwd; flashpwd OTApwd;
flashstr ETAG; flashstr ETAG;
uint16_t sysConfigHash;
} systemConfigData; } systemConfigData;
#pragma (pop) #pragma (pop)

View File

@@ -359,7 +359,7 @@ lib_deps =
Adafruit Unified Sensor Adafruit Unified Sensor
DHT sensor library DHT sensor library
https://github.com/arcao/Syslog.git https://github.com/arcao/Syslog.git
;Streaming Streaming
;;ClosedCube HDC1080 ;;ClosedCube HDC1080
;;SparkFun CCS811 Arduino Library@~1.0.7 ;;SparkFun CCS811 Arduino Library@~1.0.7
;Adafruit NeoPixel ;Adafruit NeoPixel
@@ -566,7 +566,7 @@ platform = atmelavr
board = megaatmega2560 board = megaatmega2560
monitor_baud = 115200 monitor_baud = 115200
framework = arduino framework = arduino
upload_port = net:192.168.88.2:23000 ;upload_port = net:192.168.88.2:23000
build_flags = !python get_build_flags.py mega2560-5100 build_flags = !python get_build_flags.py mega2560-5100
lib_ignore = lib_ignore =
;DS2482_OneWire //UNCOMMENT for software 1-wire driver ;DS2482_OneWire //UNCOMMENT for software 1-wire driver
@@ -620,8 +620,8 @@ framework = arduino
board = due board = due
monitor_baud = 115200 monitor_baud = 115200
build_flags = !python get_build_flags.py lighthub21 build_flags = !python get_build_flags.py lighthub21
upload_command = /opt/local/sbin/arduinoOTA -address 192.168.11.172 -port 80 -username arduino -password password -b -upload /sketch -sketch $SOURCE ;sleep 6 upload_command = arduinoOTA -address 192.168.11.172 -port 80 -username arduino -password password -b -upload /sketch -sketch $SOURCE ;sleep 6
;upload_command = arduinoOTA -address 192.168.88.45 -port 80 -username arduino -password password -b -upload /sketch -sketch $SOURCE;sleep 6
upload_protocol = custom upload_protocol = custom
lib_ignore = lib_ignore =
;DS2482_OneWire //UNCOMMENT for software 1-wire driver ;DS2482_OneWire //UNCOMMENT for software 1-wire driver