Skip to content

Commit df50206

Browse files
committed
better advanced_settings.h layout
1 parent c337041 commit df50206

File tree

7 files changed

+104
-76
lines changed

7 files changed

+104
-76
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,8 @@ In the next step, add individual Modbus devices. Adding and configuring Modbus d
224224
* download **Device Template** from the **[Loxone Library](https://library.loxone.com/)** (there are already hundreds of templates for various Modbus devices)
225225
* manually add your device following this **[official tutorial](https://www.loxone.com/enen/kb/communication-with-modbus/)**.
226226

227-
Please note that the implementation of Modbus RTU (= Loxone Modbus Extension) and Modbus TCP (= Arduino Modbus gateway connected as "Modbus Server") in Loxone is flawed:
228-
* Miniserver can not poll your Modbus sensors faster than 5 seconds. This is a deliberate restriction imposed by Loxone.
227+
Please note that the implementation of Modbus RTU (= Loxone Modbus Extension) and Modbus TCP (= Arduino Modbus gateway connected as "Modbus Server") in Loxone has some restrictions:
228+
* ~~Miniserver can not poll your Modbus sensors faster than 5 seconds. This is a deliberate restriction imposed by Loxone.~~ **Fixed in Loxone Config 14.4.9.25**. Minimum polling-cycle reduced to 1s (except Air-Devices), up to 2 Sensors per Modbus-Server or Extension allow a minimum time of 0.1s.
229229
* Miniserver can not poll multiple Modbus registers at once. If you have multiple sensors on the device, Loxone will send a separate requests for each of them even if you have identical poll intervals for these sensors. This is a design flaw by Loxone.
230230

231231
**Modbus UDP**. If you want to avoid the above mentioned limitations, you can use Modbus UDP as a communication protocol between Loxone and this Arduino Modbus gateway. See [Loxone_ModbusUDP.md](Loxone_ModbusUDP.md) on how to implement Modbus UDP in Loxone with **Virtual UDP output** and **Virtual UDP input**.

arduino-modbus-rtu-tcp-gateway/01-interfaces.ino

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ void maintainDhcp() {
136136
}
137137
#endif /* ENABLE_DHCP */
138138

139-
#ifdef ENABLE_EXTRA_DIAG
139+
#ifdef ENABLE_EXTENDED_WEBUI
140140
void maintainUptime() {
141141
uint32_t milliseconds = millis();
142142
if (last_milliseconds > milliseconds) {
@@ -150,7 +150,7 @@ void maintainUptime() {
150150
//We add the "remaining_seconds", so that we can continue measuring the time passed from the last boot of the device.
151151
seconds = (milliseconds / 1000) + remaining_seconds;
152152
}
153-
#endif /* ENABLE_EXTRA_DIAG */
153+
#endif /* ENABLE_EXTENDED_WEBUI */
154154

155155
bool rollover() {
156156
// synchronize roll-over of run time, data counters and modbus stats to zero, at 0xFFFFFF00
@@ -160,7 +160,7 @@ bool rollover() {
160160
return true;
161161
}
162162
}
163-
#ifdef ENABLE_EXTRA_DIAG
163+
#ifdef ENABLE_EXTENDED_WEBUI
164164
if (seconds > ROLLOVER) {
165165
return true;
166166
}
@@ -169,18 +169,18 @@ bool rollover() {
169169
return true;
170170
}
171171
}
172-
#endif /* ENABLE_EXTRA_DIAG */
172+
#endif /* ENABLE_EXTENDED_WEBUI */
173173
return false;
174174
}
175175

176176
// resets counters to 0: data.errorCnt, data.rtuCnt, data.ethCnt
177177
void resetStats() {
178178
memset(data.errorCnt, 0, sizeof(data.errorCnt));
179-
#ifdef ENABLE_EXTRA_DIAG
179+
#ifdef ENABLE_EXTENDED_WEBUI
180180
memset(data.rtuCnt, 0, sizeof(data.rtuCnt));
181181
memset(data.ethCnt, 0, sizeof(data.ethCnt));
182182
remaining_seconds = -(millis() / 1000);
183-
#endif /* ENABLE_EXTRA_DIAG */
183+
#endif /* ENABLE_EXTENDED_WEBUI */
184184
}
185185

186186
// generate new MAC (bytes 0, 1 and 2 are static, bytes 3, 4 and 5 are generated randomly)

arduino-modbus-rtu-tcp-gateway/02-modbus-tcp.ino

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ uint16_t crc;
4242
void recvUdp() {
4343
uint16_t msgLength = Udp.parsePacket();
4444
if (msgLength) {
45-
#ifdef ENABLE_EXTRA_DIAG
45+
#ifdef ENABLE_EXTENDED_WEBUI
4646
data.ethCnt[DATA_RX] += msgLength;
47-
#endif /* ENABLE_EXTRA_DIAG */
47+
#endif /* ENABLE_EXTENDED_WEBUI */
4848
byte inBuffer[MODBUS_SIZE + 4]; // Modbus TCP frame is 4 bytes longer than Modbus RTU frame
4949
// Modbus TCP/UDP frame: [0][1] transaction ID, [2][3] protocol ID, [4][5] length and [6] unit ID (address)..... no CRC
5050
// Modbus RTU frame: [0] address.....[n-1][n] CRC
@@ -72,19 +72,19 @@ void recvUdp() {
7272
Udp.write(highByte(crc));
7373
}
7474
Udp.endPacket();
75-
#ifdef ENABLE_EXTRA_DIAG
75+
#ifdef ENABLE_EXTENDED_WEBUI
7676
data.ethCnt[DATA_TX] += 5;
7777
if (!data.config.enableRtuOverTcp) data.ethCnt[DATA_TX] += 4;
78-
#endif /* ENABLE_EXTRA_DIAG */
78+
#endif /* ENABLE_EXTENDED_WEBUI */
7979
}
8080
}
8181
}
8282

8383
void recvTcp(EthernetClient &client) {
8484
uint16_t msgLength = client.available();
85-
#ifdef ENABLE_EXTRA_DIAG
85+
#ifdef ENABLE_EXTENDED_WEBUI
8686
data.ethCnt[DATA_RX] += msgLength;
87-
#endif /* ENABLE_EXTRA_DIAG */
87+
#endif /* ENABLE_EXTENDED_WEBUI */
8888
byte inBuffer[MODBUS_SIZE + 4]; // Modbus TCP frame is 4 bytes longer than Modbus RTU frame
8989
// Modbus TCP/UDP frame: [0][1] transaction ID, [2][3] protocol ID, [4][5] length and [6] unit ID (address).....
9090
// Modbus RTU frame: [0] address.....
@@ -114,10 +114,10 @@ void recvTcp(EthernetClient &client) {
114114
outBuffer[i++] = highByte(crc);
115115
}
116116
client.write(outBuffer, i);
117-
#ifdef ENABLE_EXTRA_DIAG
117+
#ifdef ENABLE_EXTENDED_WEBUI
118118
data.ethCnt[DATA_TX] += 5;
119119
if (!data.config.enableRtuOverTcp) data.ethCnt[DATA_TX] += 4;
120-
#endif /* ENABLE_EXTRA_DIAG */
120+
#endif /* ENABLE_EXTENDED_WEBUI */
121121
}
122122
}
123123

arduino-modbus-rtu-tcp-gateway/03-modbus-rtu.ino

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ void sendSerial() {
7070
break;
7171
case 2: // DELAY:
7272
{
73-
#ifdef ENABLE_EXTRA_DIAG
73+
#ifdef ENABLE_EXTENDED_WEBUI
7474
data.rtuCnt[DATA_TX] += myHeader.msgLen;
7575
data.rtuCnt[DATA_TX] += 2;
7676
#endif
@@ -157,9 +157,9 @@ void recvSerial() {
157157
} else {
158158
data.errorCnt[ERROR_RTU]++;
159159
}
160-
#ifdef ENABLE_EXTRA_DIAG
160+
#ifdef ENABLE_EXTENDED_WEBUI
161161
data.rtuCnt[DATA_RX] += rxNdx;
162-
#endif /* ENABLE_EXTRA_DIAG */
162+
#endif /* ENABLE_EXTENDED_WEBUI */
163163
rxNdx = 0;
164164
}
165165
}
@@ -181,10 +181,10 @@ void sendResponse(const byte MBAP[], const byte PDU[], const uint16_t pduLength)
181181
Udp.write(PDU, pduLength - 2); //send without CRC
182182
}
183183
Udp.endPacket();
184-
#ifdef ENABLE_EXTRA_DIAG
184+
#ifdef ENABLE_EXTENDED_WEBUI
185185
data.ethCnt[DATA_TX] += pduLength;
186186
if (!data.config.enableRtuOverTcp) data.ethCnt[DATA_TX] += 4;
187-
#endif /* ENABLE_EXTRA_DIAG */
187+
#endif /* ENABLE_EXTENDED_WEBUI */
188188
} else if (myHeader.requestType & TCP_REQUEST) {
189189
byte sock = myHeader.requestType & TCP_REQUEST_MASK;
190190
EthernetClient client = EthernetClient(sock);
@@ -194,10 +194,10 @@ void sendResponse(const byte MBAP[], const byte PDU[], const uint16_t pduLength)
194194
client.write(MBAP, 6);
195195
client.write(PDU, pduLength - 2); //send without CRC
196196
}
197-
#ifdef ENABLE_EXTRA_DIAG
197+
#ifdef ENABLE_EXTENDED_WEBUI
198198
data.ethCnt[DATA_TX] += pduLength;
199199
if (!data.config.enableRtuOverTcp) data.ethCnt[DATA_TX] += 4;
200-
#endif /* ENABLE_EXTRA_DIAG */
200+
#endif /* ENABLE_EXTENDED_WEBUI */
201201
} // TODO TCP Connection Error
202202
} // else SCAN_REQUEST (no data.ethCnt[DATA_TX], but yes delete request)
203203
deleteRequest();

arduino-modbus-rtu-tcp-gateway/05-pages.ino

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ void contentInfo(ChunkedPrint &chunked) {
260260
// Modbus Status
261261
void contentStatus(ChunkedPrint &chunked) {
262262

263-
#ifdef ENABLE_EXTRA_DIAG
263+
#ifdef ENABLE_EXTENDED_WEBUI
264264
tagLabelDiv(chunked, F("Run Time"));
265265
tagSpan(chunked, JSON_TIME);
266266
tagDivClose(chunked);
@@ -270,7 +270,7 @@ void contentStatus(ChunkedPrint &chunked) {
270270
tagLabelDiv(chunked, F("Ethernet Data"));
271271
tagSpan(chunked, JSON_ETH_DATA);
272272
tagDivClose(chunked);
273-
#endif /* ENABLE_EXTRA_DIAG */
273+
#endif /* ENABLE_EXTENDED_WEBUI */
274274

275275
tagLabelDiv(chunked, F("Modbus RTU Request"));
276276
for (byte i = 0; i <= POST_REQ_LAST - POST_REQ; i++) {
@@ -650,7 +650,7 @@ void stringStats(ChunkedPrint &chunked, const byte stat) {
650650

651651
void jsonVal(ChunkedPrint &chunked, const byte JSONKEY) {
652652
switch (JSONKEY) {
653-
#ifdef ENABLE_EXTRA_DIAG
653+
#ifdef ENABLE_EXTENDED_WEBUI
654654
case JSON_TIME:
655655
chunked.print(seconds / (3600UL * 24L));
656656
chunked.print(F(" days, "));
@@ -686,7 +686,7 @@ void jsonVal(ChunkedPrint &chunked, const byte JSONKEY) {
686686
}
687687
}
688688
break;
689-
#endif /* ENABLE_EXTRA_DIAG */
689+
#endif /* ENABLE_EXTENDED_WEBUI */
690690
case JSON_RESPONSE:
691691
{
692692
for (byte i = 0; i < MAX_RESPONSE_LEN; i++) {
Lines changed: 46 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,53 @@
11
/* Advanced settings, extra functions and default config for Modbus RTU ⇒ Modbus TCP/UDP Gateway
22
*/
33

4+
/****** FUNCTIONALITY ******/
5+
6+
// #define ENABLE_EXTENDED_WEBUI // Enable extended Web UI (additional items and settings), consumes FLASH memory
7+
// uncomment ENABLE_EXTENDED_WEBUI if you have a board with large FLASH memory (Arduino Mega)
8+
9+
// #define ENABLE_DHCP // Enable DHCP (Auto IP settings), consumes a lot of FLASH memory
10+
11+
12+
/****** DEFAULT CONFIGURATION ******/
13+
/*
14+
Arduino loads user settings stored in EEPROM, even if you flash new program to it.
15+
16+
Arduino loads factory defaults if:
17+
1) User clicks "Load default settings" in WebUI (factory reset configuration, keeps MAC)
18+
2) VERSION_MAJOR changes (factory reset configuration AND generates new MAC)
19+
*/
20+
21+
/****** IP Settings ******/
22+
const bool DEFAULT_AUTO_IP = false; // Default Auto IP setting (only used if ENABLE_DHCP)
23+
#define DEFAULT_STATIC_IP \
24+
{ 192, 168, 1, 254 } // Default Static IP
25+
#define DEFAULT_SUBMASK \
26+
{ 255, 255, 255, 0 } // Default Submask
27+
#define DEFAULT_GATEWAY \
28+
{ 192, 168, 1, 1 } // Default Gateway
29+
#define DEFAULT_DNS \
30+
{ 192, 168, 1, 1 } // Default DNS Server (only used if ENABLE_DHCP)
31+
32+
/****** TCP/UDP Settings ******/
33+
const uint16_t DEFAULT_TCP_PORT = 502; // Default Modbus TCP Port
34+
const uint16_t DEFAULT_UDP_PORT = 502; // Default Modbus UDP Port
35+
const uint16_t DEFAULT_WEB_PORT = 80; // Default WebUI Port
36+
const bool DEFAULT_RTU_OVER_TCP = false; // Default Modbus Mode (Modbus TCP or Modbus RTU over TCP)
37+
const uint16_t DEFAULT_TCP_TIMEOUT = 600; // Default Modbus TCP Idle Timeout
38+
39+
/****** RTU Settings ******/
40+
const uint16_t DEFAULT_BAUD_RATE = 96; // Default Baud Rate / 100
41+
const byte DEFAULT_SERIAL_CONFIG = SERIAL_8E1; // Default Data Bits, Parity, Stop bits. Modbus default is 8E1, another frequently used option is 8N2
42+
// for all valid options see https://www.arduino.cc/reference/en/language/functions/communication/serial/begin/
43+
const byte DEFAULT_FRAME_DELAY = 150; // Default Inter-frame Delay
44+
const uint16_t DEFAULT_RESPONSE_TIMEPOUT = 500; // Default Response Timeout
45+
const byte DEFAULT_ATTEMPTS = 3; // Default Attempts
46+
447
/****** ADVANCED SETTINGS ******/
548

649
#define mySerial Serial // define serial port for RS485 interface, for Arduino Mega choose from Serial1, Serial2 or Serial3
7-
// List of baud rates (divided by 100) available in WebUI. Feel free to add your custom baud rate (anything between 3 and 2500)
50+
// List of baud rates (divided by 100) available in WebUI. Feel free to add your custom baud rate (anything between 3 and 2500)
851
const uint16_t BAUD_RATES[] = { 3, 6, 9, 12, 24, 48, 96, 192, 384, 576, 1152 };
952
#define RS485_CONTROL_PIN 6 // Arduino Pin for RS485 Direction control, disable if you have module with hardware flow control
1053
const byte MAX_QUEUE_REQUESTS = 10; // max number of TCP or UDP requests stored in a queue
@@ -20,7 +63,7 @@ const uint16_t SCAN_TIMEOUT = 200; // Timeout (ms) for Modbus scan request
2063

2164
const byte MAC_START[3] = { 0x90, 0xA2, 0xDA }; // MAC range for Gheo SA
2265
const byte ETH_RESET_PIN = 7; // Ethernet shield reset pin (deals with power on reset issue on low quality ethernet shields)
23-
const uint16_t CHECK_ETH_INTERVAL = 2000; // Interval (ms) to check SPI connection with ethernet shield
66+
const uint16_t CHECK_ETH_INTERVAL = 2000; // Interval (ms) to check SPI connection with ethernet shield
2467
const uint16_t ETH_RESET_DELAY = 500; // Delay (ms) during Ethernet start, wait for Ethernet shield to start (reset issue on low quality ethernet shields)
2568
const uint16_t WEB_IDLE_TIMEOUT = 400; // Time (ms) from last client data after which webserver TCP socket could be disconnected, non-blocking.
2669
const uint16_t TCP_DISCON_TIMEOUT = 500; // Timeout (ms) for client DISCON socket command, non-blocking alternative to https://www.arduino.cc/reference/en/libraries/ethernet/client.setconnectiontimeout/
@@ -29,38 +72,4 @@ const byte TCP_RETRANSMISSION_COUNT = 3; // Number of transmission attem
2972
const uint16_t FETCH_INTERVAL = 2000; // Fetch API interval (ms) for the Modbus Status webpage to renew data from JSON served by Arduino
3073

3174
const byte DATA_START = 96; // Start address where config and counters are saved in EEPROM
32-
const byte EEPROM_INTERVAL = 6; // Interval (hours) for saving Modbus statistics to EEPROM (in order to minimize writes to EEPROM)
33-
34-
/****** EXTRA FUNCTIONS ******/
35-
36-
// these do not fit into the limited flash memory of Arduino Uno/Nano, uncomment if you have a board with more memory
37-
// #define ENABLE_DHCP // Enable DHCP (Auto IP settings)
38-
// #define ENABLE_EXTRA_DIAG // Enable Ethernet and Serial byte counter.
39-
40-
/****** DEFAULT FACTORY SETTINGS ******/
41-
42-
/*
43-
Please note that after boot, Arduino loads user settings stored in EEPROM, even if you flash new program to it!
44-
Arduino loads factory defaults if:
45-
1) User clicks "Load default settings" in WebUI (factory reset configuration, keeps MAC)
46-
2) VERSION_MAJOR changes (factory reset configuration AND generates new MAC)
47-
48-
You can change default factory settings bellow, but do not delete (comment out) individual lines!
49-
*/
50-
const config_t DEFAULT_CONFIG = {
51-
{ 192, 168, 1, 254 }, // Static IP
52-
{ 255, 255, 255, 0 }, // Submask
53-
{ 192, 168, 1, 1 }, // Gateway
54-
{ 192, 168, 1, 1 }, // Dns (only used if ENABLE_DHCP)
55-
false, // enableDhcp (only used if ENABLE_DHCP)
56-
502, // Modbus TCP Port
57-
502, // Modbus UDP Port
58-
80, // WebUI Port
59-
false, // Modbus Mode (enableRTU over TCP)
60-
600, // Modbus TCP Idle Timeout
61-
96, // Baud Rate / 100
62-
SERIAL_8E1, // Serial Config (Data Bits, Parity, Stop bits), Modbus RTU default is 8E1, another frequently used option is 8N2
63-
150, // Inter-frame Delay (byte)
64-
500, // Response Timeout
65-
3, // Attempts (byte)
66-
};
75+
const byte EEPROM_INTERVAL = 6; // Interval (hours) for saving Modbus statistics to EEPROM (in order to minimize writes to EEPROM)

arduino-modbus-rtu-tcp-gateway/arduino-modbus-rtu-tcp-gateway.ino

Lines changed: 31 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
v2.4 2021-10-15 Add SW version. Forced factory reset (load defaut settings from sketch) on MAJOR version change.
1313
v3.0 2021-11-07 Improve POST parameters processing, bugfix 404 and 204 error headers.
1414
v3.1 2022-01-28 Code optimization, bugfix DHCP settings.
15-
v3.2 2022-06-04 Reduce program size (so that it fits on Nano), ethernet data counter only available when ENABLE_EXTRA_DIAG.
15+
v3.2 2022-06-04 Reduce program size (so that it fits on Nano), ethernet data counter only available when ENABLE_EXTENDED_WEBUI.
1616
v4.0 2023-01-05 Modbus statistics and error reporting on "Modbus Status" page, add Frame Delay setting for Modbus RTU
1717
Optimize Modbus timeout and attempts, significant reduction of code size
1818
v4.1 2023-01-14 Fetch API, bugfix MAX485
@@ -22,7 +22,7 @@
2222
v6.1 2023-04-12 Code optimization
2323
v7.0 2023-07-21 Manual MAC, better data types
2424
v7.1 2023-08-25 Simplify EEPROM read and write, Tools page
25-
v7.2 2023-XX-XX Disable DHCP renewal fallback, recover after short power loss
25+
v7.2 2023-10-20 Disable DHCP renewal fallback, better advanced_settings.h layout
2626
*/
2727

2828
const byte VERSION[] = { 7, 2 };
@@ -60,6 +60,24 @@ typedef struct {
6060

6161
#include "advanced_settings.h"
6262

63+
const config_t DEFAULT_CONFIG = {
64+
DEFAULT_STATIC_IP,
65+
DEFAULT_SUBMASK,
66+
DEFAULT_GATEWAY,
67+
DEFAULT_DNS,
68+
DEFAULT_AUTO_IP,
69+
DEFAULT_TCP_PORT,
70+
DEFAULT_UDP_PORT,
71+
DEFAULT_WEB_PORT,
72+
DEFAULT_RTU_OVER_TCP,
73+
DEFAULT_TCP_TIMEOUT,
74+
DEFAULT_BAUD_RATE,
75+
DEFAULT_SERIAL_CONFIG,
76+
DEFAULT_FRAME_DELAY,
77+
DEFAULT_RESPONSE_TIMEPOUT,
78+
DEFAULT_ATTEMPTS,
79+
};
80+
6381
enum status_t : byte {
6482
SLAVE_OK, // Slave Responded
6583
SLAVE_ERROR_0X, // Slave Responded with Error (Codes 1~8)
@@ -84,10 +102,10 @@ typedef struct {
84102
byte mac[6]; // MAC Address (initial value is random generated)
85103
config_t config; // configuration values
86104
uint32_t errorCnt[ERROR_LAST]; // array for storing error counters
87-
#ifdef ENABLE_EXTRA_DIAG
105+
#ifdef ENABLE_EXTENDED_WEBUI
88106
uint32_t rtuCnt[DATA_LAST]; // array for storing RTU data counters
89107
uint32_t ethCnt[DATA_LAST]; // array for storing ethernet data counters
90-
#endif /* ENABLE_EXTRA_DIAG */
108+
#endif /* ENABLE_EXTENDED_WEBUI */
91109
} data_t;
92110

93111
data_t data;
@@ -196,15 +214,15 @@ byte responseLen; // stores actual length of the response shown
196214
uint16_t queueDataSize;
197215
byte queueHeadersSize;
198216

199-
#ifdef ENABLE_EXTRA_DIAG
217+
#ifdef ENABLE_EXTENDED_WEBUI
200218
// store uptime seconds (includes seconds counted before millis() overflow)
201219
uint32_t seconds;
202220
// store last millis() so that we can detect millis() overflow
203221
uint32_t last_milliseconds = 0;
204222
// store seconds passed until the moment of the overflow so that we can add them to "seconds" on the next call
205223
int32_t remaining_seconds;
206-
// Data counters (we only use uint32_t in ENABLE_EXTRA_DIAG, to save flash memory)
207-
#endif /* ENABLE_EXTRA_DIAG */
224+
// Data counters (we only use uint32_t in ENABLE_EXTENDED_WEBUI, to save flash memory)
225+
#endif /* ENABLE_EXTENDED_WEBUI */
208226

209227
volatile uint32_t seed1; // seed1 is generated by CreateTrulyRandomSeed()
210228
volatile int8_t nrot;
@@ -244,17 +262,18 @@ void loop() {
244262
updateEeprom();
245263
}
246264

247-
if (CHECK_ETH_INTERVAL > 0 && checkEthTimer.isOver() == true) {
248-
checkEthernet();
249-
}
265+
// could help with freeze after power loss reported by some users, not enabled yet
266+
// if (CHECK_ETH_INTERVAL > 0 && checkEthTimer.isOver() == true) {
267+
// checkEthernet();
268+
// }
250269

251270
if (rollover()) {
252271
resetStats();
253272
updateEeprom();
254273
}
255-
#ifdef ENABLE_EXTRA_DIAG
274+
#ifdef ENABLE_EXTENDED_WEBUI
256275
maintainUptime(); // maintain uptime in case of millis() overflow
257-
#endif /* ENABLE_EXTRA_DIAG */
276+
#endif /* ENABLE_EXTENDED_WEBUI */
258277
#ifdef ENABLE_DHCP
259278
maintainDhcp();
260279
#endif /* ENABLE_DHCP */

0 commit comments

Comments
 (0)