mirror of
https://github.com/UtilitechAS/amsreader-firmware.git
synced 2026-04-26 04:07:57 +00:00
Stability adjustments
This commit is contained in:
@@ -559,8 +559,10 @@ void setupHanPort(uint8_t pin, uint32_t baud, uint8_t parityOrdinal, bool invert
|
|||||||
|
|
||||||
#if defined(ESP32)
|
#if defined(ESP32)
|
||||||
hwSerial->begin(baud, serialConfig, -1, -1, invert);
|
hwSerial->begin(baud, serialConfig, -1, -1, invert);
|
||||||
|
hwSerial->setRxBufferSize(768);
|
||||||
#else
|
#else
|
||||||
hwSerial->begin(baud, serialConfig, SERIAL_FULL, 1, invert);
|
hwSerial->begin(baud, serialConfig, SERIAL_FULL, 1, invert);
|
||||||
|
hwSerial->setRxBufferSize(768);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(ESP8266)
|
#if defined(ESP8266)
|
||||||
@@ -705,7 +707,6 @@ bool readHanPort() {
|
|||||||
while(hanSerial->available() && pos == HDLC_FRAME_INCOMPLETE) {
|
while(hanSerial->available() && pos == HDLC_FRAME_INCOMPLETE) {
|
||||||
buf[len++] = hanSerial->read();
|
buf[len++] = hanSerial->read();
|
||||||
pos = HDLC_validate((uint8_t *) buf, len, hc, ×tamp);
|
pos = HDLC_validate((uint8_t *) buf, len, hc, ×tamp);
|
||||||
delay(1);
|
|
||||||
}
|
}
|
||||||
if(len > 0) {
|
if(len > 0) {
|
||||||
if(len >= BUF_SIZE) {
|
if(len >= BUF_SIZE) {
|
||||||
@@ -973,7 +974,9 @@ void WiFi_connect() {
|
|||||||
} else if(dns1.toString().isEmpty()) {
|
} else if(dns1.toString().isEmpty()) {
|
||||||
dns2.fromString("208.67.220.220"); // Add OpenDNS as second by default if nothing is configured
|
dns2.fromString("208.67.220.220"); // Add OpenDNS as second by default if nothing is configured
|
||||||
}
|
}
|
||||||
WiFi.config(ip, gw, sn, dns1, dns2);
|
if(!WiFi.config(ip, gw, sn, dns1, dns2)) {
|
||||||
|
debugE("Static IP configuration is invalid, not using");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
#if defined(ESP32)
|
#if defined(ESP32)
|
||||||
// This trick does not work anymore...
|
// This trick does not work anymore...
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ EntsoeApi::EntsoeApi(RemoteDebug* Debug) {
|
|||||||
|
|
||||||
client.setInsecure();
|
client.setInsecure();
|
||||||
https.setFollowRedirects(HTTPC_STRICT_FOLLOW_REDIRECTS);
|
https.setFollowRedirects(HTTPC_STRICT_FOLLOW_REDIRECTS);
|
||||||
https.setTimeout(5000);
|
https.setTimeout(20000);
|
||||||
|
|
||||||
// Entso-E uses CET/CEST
|
// Entso-E uses CET/CEST
|
||||||
TimeChangeRule CEST = {"CEST", Last, Sun, Mar, 2, 120};
|
TimeChangeRule CEST = {"CEST", Last, Sun, Mar, 2, 120};
|
||||||
@@ -270,7 +270,9 @@ float EntsoeApi::getCurrencyMultiplier(const char* from, const char* to) {
|
|||||||
return 1.00;
|
return 1.00;
|
||||||
|
|
||||||
uint64_t now = millis64();
|
uint64_t now = millis64();
|
||||||
if(lastCurrencyFetch < midnightMillis) {
|
if(now > lastCurrencyFetch && (now - lastCurrencyFetch) < 900000) {
|
||||||
|
lastCurrencyFetch = now;
|
||||||
|
|
||||||
char url[256];
|
char url[256];
|
||||||
DnbCurrParser p;
|
DnbCurrParser p;
|
||||||
|
|
||||||
|
|||||||
BIN
webui2.png
Normal file
BIN
webui2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 168 KiB |
Reference in New Issue
Block a user