mirror of
https://github.com/lumapu/ahoy.git
synced 2025-05-11 16:06:38 +02:00
ESP8266 v0.4.16
* request only one inverter per loop (https://github.com/grindylow/ahoy/issues/53#issuecomment-1147042489) * mqtt loop interval calculated by # of inverters and inverter request interval * limit maximum number of retries * added feature request #62 (readable names for channels) * improved setup page, added javascript to hide / show channel fields ** IMORTANT: memory layout change, all configuration will be lost, except WiFI **
This commit is contained in:
parent
b995cc0a93
commit
f148c41a1f
13 changed files with 260 additions and 117 deletions
|
@ -267,6 +267,7 @@ void Main::saveValues(bool webSend = true) {
|
|||
memset(mDeviceName, 0, DEVNAME_LEN);
|
||||
mWeb->arg("device").toCharArray(mDeviceName, DEVNAME_LEN);
|
||||
mEep->write(ADDR_DEVNAME, mDeviceName, DEVNAME_LEN);
|
||||
mEep->commit();
|
||||
|
||||
|
||||
updateCrc();
|
||||
|
@ -288,6 +289,7 @@ void Main::updateCrc(void) {
|
|||
crc = buildEEpCrc(ADDR_START, ADDR_WIFI_CRC);
|
||||
//Serial.println("new CRC: " + String(crc, HEX));
|
||||
mEep->write(ADDR_WIFI_CRC, crc);
|
||||
mEep->commit();
|
||||
}
|
||||
|
||||
|
||||
|
@ -435,7 +437,10 @@ void Main::sendNTPpacket(IPAddress& address) {
|
|||
String Main::getDateTimeStr(time_t t) {
|
||||
//DPRINTLN(F("Main::getDateTimeStr"));
|
||||
char str[20] = {0};
|
||||
sprintf(str, "%04d-%02d-%02d %02d:%02d:%02d", year(t), month(t), day(t), hour(t), minute(t), second(t));
|
||||
if(0 == t)
|
||||
sprintf(str, "n/a");
|
||||
else
|
||||
sprintf(str, "%04d-%02d-%02d %02d:%02d:%02d", year(t), month(t), day(t), hour(t), minute(t), second(t));
|
||||
return String(str);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue