@@ -267,7 +267,7 @@ Check [`EthernetWebServer Library Issue: Support for STM32F Series`](https://git
267267
268268## Prerequisites
269269
270- 1 . [ ` Arduino IDE 1.8.18 + ` for Arduino] ( https://www. arduino.cc/en/Main/Software )
270+ 1 . [ ` Arduino IDE 1.8.19 + ` for Arduino] ( https://github.com/ arduino/Arduino ) . [ ![ GitHub release ] ( https://img.shields.io/github/release/arduino/Arduino.svg )] ( https://github.com/arduino/Arduino/releases/latest )
271271 2 . [ ` Arduino Core for STM32 v2.2.0+ ` ] ( https://github.com/stm32duino/Arduino_Core_STM32 ) for STM32 boards. [ ![ GitHub release] ( https://img.shields.io/github/release/stm32duino/Arduino_Core_STM32.svg )] ( https://github.com/stm32duino/Arduino_Core_STM32/releases/latest )
272272 3 . [ ` Functional-VLPP library v1.0.2+ ` ] ( https://github.com/khoih-prog/functional-vlpp ) to use server's lambda function. To install. check [ ![ arduino-library-badge] ( https://www.ardu-badge.com/badge/Functional-Vlpp.svg? )] ( https://www.ardu-badge.com/Functional-Vlpp )
273273 4 . For built-in LAN8742A or LAN8720 Ethernet:
@@ -979,7 +979,7 @@ void handleRoot()
979979{
980980 digitalWrite(led, 1);
981981
982- #define BUFFER_SIZE 400
982+ #define BUFFER_SIZE 512
983983
984984 char temp[ BUFFER_SIZE] ;
985985 int sec = millis() / 1000;
@@ -1032,21 +1032,25 @@ void handleNotFound()
10321032 digitalWrite(led, 0);
10331033}
10341034
1035- #if (defined(ETHERNET_WEBSERVER_STM32_VERSION_INT) && (ETHERNET_WEBSERVER_STM32_VERSION_INT >= 1003000))
1036-
1037- EWString initHeader = "<svg xmlns=\" http://www.w3.org/2000/svg\ " version=\" 1.1\" width=\" 310\" height=\" 150\" >\n" \
1038- "<rect width=\" 310\" height=\" 150\" fill=\" rgb(250, 230, 210)\" stroke-width=\" 3\" stroke=\" rgb(0, 0, 0)\" />\n" \
1039- "<g stroke=\" blue\" >\n";
1035+ #define ORIGINAL_STR_LEN 2048
10401036
10411037void drawGraph()
10421038{
1043- EWString out;
1044-
1045- out.reserve(3000);
1039+ static String out;
1040+ static uint16_t previousStrLen = ORIGINAL_STR_LEN;
1041+
1042+ if (out.length() == 0)
1043+ {
1044+ ET_LOGWARN1(F("String Len = 0, extend to"), ORIGINAL_STR_LEN);
1045+ out.reserve(ORIGINAL_STR_LEN);
1046+ }
1047+
1048+ out = F( "<svg xmlns=\" http://www.w3.org/2000/svg\ " version=\" 1.1\" width=\" 310\" height=\" 150\" >\n" \
1049+ "<rect width=\" 310\" height=\" 150\" fill=\" rgb(250, 230, 210)\" stroke-width=\" 3\" stroke=\" rgb(0, 0, 0)\" />\n" \
1050+ "<g stroke=\" blue\" >\n");
1051+
10461052 char temp[ 70] ;
10471053
1048- out += initHeader;
1049-
10501054 int y = rand() % 130;
10511055
10521056 for (int x = 10; x < 300; x += 10)
@@ -1056,37 +1060,25 @@ void drawGraph()
10561060 out += temp;
10571061 y = y2;
10581062 }
1059- out += "</g >\n</svg >\n";
1063+
1064+ out += F("</g >\n</svg >\n");
10601065
1061- server.send(200, "image/svg+xml", fromEWString(out));
1062- }
1066+ ET_LOGDEBUG1(F("String Len = "), out.length());
10631067
1064- #else
1065-
1066- void drawGraph()
1067- {
1068- String out;
1069- out.reserve(3000);
1070- char temp[ 70] ;
1071- out += "<svg xmlns=\" http://www.w3.org/2000/svg\ " version=\" 1.1\" width=\" 310\" height=\" 150\" >\n";
1072- out += "<rect width=\" 310\" height=\" 150\" fill=\" rgb(250, 230, 210)\" stroke-width=\" 1\" stroke=\" rgb(0, 0, 0)\" />\n";
1073- out += "<g stroke=\" black\" >\n";
1074- int y = rand() % 130;
1068+ if (out.length() > previousStrLen)
1069+ {
1070+ ET_LOGERROR3(F("String Len > "), previousStrLen, F(", extend to"), out.length() + 48);
10751071
1076- for (int x = 10; x < 300; x += 10)
1072+ previousStrLen = out.length() + 48;
1073+
1074+ out.reserve(previousStrLen);
1075+ }
1076+ else
10771077 {
1078- int y2 = rand() % 130;
1079- sprintf(temp, "<line x1=\" %d\" y1=\" %d\" x2=\" %d\" y2=\" %d\" stroke-width=\" 1\" />\n", x, 140 - y, x + 10, 140 - y2);
1080- out += temp;
1081- y = y2;
1078+ server.send(200, "image/svg+xml", out);
10821079 }
1083- out += "</g >\n</svg >\n";
1084-
1085- server.send(200, "image/svg+xml", out);
10861080}
10871081
1088- #endif
1089-
10901082void setup()
10911083{
10921084 pinMode(led, OUTPUT);
@@ -1375,7 +1367,7 @@ Following is debug terminal output and screen shot when running example [Advance
13751367
13761368```
13771369Start AdvancedWebServer on NUCLEO_F767ZI, using LAN8742A Ethernet & STM32Ethernet Library
1378- EthernetWebServer_STM32 v1.3.0
1370+ EthernetWebServer_STM32 v1.3.1
13791371HTTP EthernetWebServer is @ IP : 192.168.2.117
13801372EthernetWebServer::handleClient: New Client
13811373method: GET
@@ -1499,7 +1491,7 @@ The following is debug terminal output when running example [WebClientRepeating]
14991491
15001492```
15011493Start WebClientRepeating on NUCLEO_F767ZI, using ENC28J60 & EthernetENC Library
1502- EthernetWebServer_STM32 v1.3.0
1494+ EthernetWebServer_STM32 v1.3.1
15031495[ETHERNET_WEBSERVER] Board : NUCLEO_F767ZI , setCsPin: 10
15041496[ETHERNET_WEBSERVER] Default SPI pinout:
15051497[ETHERNET_WEBSERVER] MOSI: 11
@@ -1574,7 +1566,7 @@ The following is debug terminal output when running example [UdpNTPClient](examp
15741566
15751567```
15761568Start UdpNTPClient on NUCLEO_F767ZI, using W5x00 & Ethernet2 Library
1577- EthernetWebServer_STM32 v1.3.0
1569+ EthernetWebServer_STM32 v1.3.1
15781570[ETHERNET_WEBSERVER] Board : NUCLEO_F767ZI , setCsPin: 10
15791571[ETHERNET_WEBSERVER] Default SPI pinout:
15801572[ETHERNET_WEBSERVER] MOSI: 11
@@ -1598,7 +1590,7 @@ The terminal output of **STM32F7 Nucleo-144 NUCLEO_F767ZI with LAN8742A Ethernet
15981590
15991591```
16001592Starting SimpleWebSocket on NUCLEO_F767ZI with LAN8742A Ethernet & STM32Ethernet Library
1601- EthernetWebServer_STM32 v1.3.0
1593+ EthernetWebServer_STM32 v1.3.1
16021594[ETHERNET_WEBSERVER] =========================
16031595[ETHERNET_WEBSERVER] Default SPI pinout:
16041596[ETHERNET_WEBSERVER] MOSI: 11
@@ -1643,7 +1635,7 @@ The terminal output of **STM32F7 Nucleo-144 NUCLEO_F767ZI with W5x00 & Ethernet3
16431635
16441636```
16451637Starting SimpleWebSocket on NUCLEO_F767ZI with W5x00 & Ethernet3 Library
1646- EthernetWebServer_STM32 v1.3.0
1638+ EthernetWebServer_STM32 v1.3.1
16471639[ETHERNET_WEBSERVER] =========== USE_ETHERNET3 ===========
16481640[ETHERNET_WEBSERVER] Default SPI pinout:
16491641[ETHERNET_WEBSERVER] MOSI: 11
@@ -1695,7 +1687,7 @@ The terminal output of **STM32F7 Nucleo-144 NUCLEO_F767ZI with LAN8742A Ethernet
16951687
16961688```
16971689Starting SimpleHTTPExample on NUCLEO_F767ZI with LAN8742A Ethernet & STM32Ethernet Library
1698- EthernetWebServer_STM32 v1.3.0
1690+ EthernetWebServer_STM32 v1.3.1
16991691[ETHERNET_WEBSERVER] =========================
17001692[ETHERNET_WEBSERVER] Default SPI pinout:
17011693[ETHERNET_WEBSERVER] MOSI: 11
@@ -1768,7 +1760,7 @@ The terminal output of **STM32F7 Nucleo-144 NUCLEO_F767ZI with LAN8742A Ethernet
17681760
17691761```
17701762Start MQTTClient_Auth on NUCLEO_F767ZI with LAN8742A Ethernet & STM32Ethernet Library
1771- EthernetWebServer_STM32 v1.3.0
1763+ EthernetWebServer_STM32 v1.3.1
17721764[ETHERNET_WEBSERVER] =========================
17731765[ETHERNET_WEBSERVER] Default SPI pinout:
17741766[ETHERNET_WEBSERVER] MOSI: 11
@@ -1807,7 +1799,7 @@ The terminal output of **STM32F7 Nucleo-144 NUCLEO_F767ZI with ENC28J60 & Ethern
18071799
18081800```
18091801Start MQTTClient_Auth on NUCLEO_F767ZI with ENC28J60 & EthernetENC Library
1810- EthernetWebServer_STM32 v1.3.0
1802+ EthernetWebServer_STM32 v1.3.1
18111803[ETHERNET_WEBSERVER] =========== USE_ETHERNET_ENC ===========
18121804[ETHERNET_WEBSERVER] Default SPI pinout:
18131805[ETHERNET_WEBSERVER] MOSI: 11
@@ -1846,7 +1838,7 @@ The terminal output of **STM32F7 Nucleo-144 NUCLEO_F767ZI with W5x00 & Ethernet2
18461838
18471839```
18481840Start MQTTClient_Auth on NUCLEO_F767ZI with W5x00 & Ethernet2 Library
1849- EthernetWebServer_STM32 v1.3.0
1841+ EthernetWebServer_STM32 v1.3.1
18501842[ETHERNET_WEBSERVER] =========== USE_ETHERNET2 ===========
18511843[ETHERNET_WEBSERVER] Default SPI pinout:
18521844[ETHERNET_WEBSERVER] MOSI: 11
@@ -1880,7 +1872,7 @@ The terminal output of **STM32F4 BLACK_F407VE with LAN8720 Ethernet and STM32Eth
18801872
18811873```
18821874Starting SimpleWebSocket_LAN8720 on BLACK_F407VE with LAN8720 Ethernet & STM32Ethernet Library
1883- EthernetWebServer_STM32 v1.3.0
1875+ EthernetWebServer_STM32 v1.3.1
18841876Using mac index = 6
18851877Connected! IP address: 192.168.2.138
18861878starting WebSocket client
@@ -1905,7 +1897,7 @@ The terminal output of **BLACK_F407VE using LAN8720 Ethernet and STM32Ethernet L
19051897
19061898```
19071899Start WebClient_LAN8720 on BLACK_F407VE, using LAN8720 Ethernet & STM32Ethernet Library
1908- EthernetWebServer_STM32 v1.3.0
1900+ EthernetWebServer_STM32 v1.3.1
19091901You're connected to the network, IP = 192.168.2.139
19101902
19111903Starting connection to server...
@@ -1978,9 +1970,9 @@ Following is debug terminal output and screen shot when running example [Advance
19781970
19791971```
19801972Start AdvancedWebServer_LAN8720 on BLACK_F407VE, using LAN8720 Ethernet & STM32Ethernet Library
1981- EthernetWebServer_STM32 v1.3.0
1982- HTTP EthernetWebServer is @ IP : 192.168.2.138
1983-
1973+ EthernetWebServer_STM32 v1.3.1
1974+ .[EWS] String Len = 0, extend to 2048
1975+ ......... .......... .......... .......... .......... .......... .......... ..........
19841976```
19851977
19861978---
0 commit comments