@@ -267,7 +267,7 @@ Check [`EthernetWebServer Library Issue: Support for STM32F Series`](https://git
267
267
268
268
## Prerequisites
269
269
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 )
271
271
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 )
272
272
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 )
273
273
4 . For built-in LAN8742A or LAN8720 Ethernet:
@@ -979,7 +979,7 @@ void handleRoot()
979
979
{
980
980
digitalWrite(led, 1);
981
981
982
- #define BUFFER_SIZE 400
982
+ #define BUFFER_SIZE 512
983
983
984
984
char temp[ BUFFER_SIZE] ;
985
985
int sec = millis() / 1000;
@@ -1032,21 +1032,25 @@ void handleNotFound()
1032
1032
digitalWrite(led, 0);
1033
1033
}
1034
1034
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
1040
1036
1041
1037
void drawGraph()
1042
1038
{
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
+
1046
1052
char temp[ 70] ;
1047
1053
1048
- out += initHeader;
1049
-
1050
1054
int y = rand() % 130;
1051
1055
1052
1056
for (int x = 10; x < 300; x += 10)
@@ -1056,37 +1060,25 @@ void drawGraph()
1056
1060
out += temp;
1057
1061
y = y2;
1058
1062
}
1059
- out += "</g >\n</svg >\n";
1063
+
1064
+ out += F("</g >\n</svg >\n");
1060
1065
1061
- server.send(200, "image/svg+xml", fromEWString(out));
1062
- }
1066
+ ET_LOGDEBUG1(F("String Len = "), out.length());
1063
1067
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);
1075
1071
1076
- for (int x = 10; x < 300; x += 10)
1072
+ previousStrLen = out.length() + 48;
1073
+
1074
+ out.reserve(previousStrLen);
1075
+ }
1076
+ else
1077
1077
{
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);
1082
1079
}
1083
- out += "</g >\n</svg >\n";
1084
-
1085
- server.send(200, "image/svg+xml", out);
1086
1080
}
1087
1081
1088
- #endif
1089
-
1090
1082
void setup()
1091
1083
{
1092
1084
pinMode(led, OUTPUT);
@@ -1375,7 +1367,7 @@ Following is debug terminal output and screen shot when running example [Advance
1375
1367
1376
1368
```
1377
1369
Start AdvancedWebServer on NUCLEO_F767ZI, using LAN8742A Ethernet & STM32Ethernet Library
1378
- EthernetWebServer_STM32 v1.3.0
1370
+ EthernetWebServer_STM32 v1.3.1
1379
1371
HTTP EthernetWebServer is @ IP : 192.168.2.117
1380
1372
EthernetWebServer::handleClient: New Client
1381
1373
method: GET
@@ -1499,7 +1491,7 @@ The following is debug terminal output when running example [WebClientRepeating]
1499
1491
1500
1492
```
1501
1493
Start WebClientRepeating on NUCLEO_F767ZI, using ENC28J60 & EthernetENC Library
1502
- EthernetWebServer_STM32 v1.3.0
1494
+ EthernetWebServer_STM32 v1.3.1
1503
1495
[ETHERNET_WEBSERVER] Board : NUCLEO_F767ZI , setCsPin: 10
1504
1496
[ETHERNET_WEBSERVER] Default SPI pinout:
1505
1497
[ETHERNET_WEBSERVER] MOSI: 11
@@ -1574,7 +1566,7 @@ The following is debug terminal output when running example [UdpNTPClient](examp
1574
1566
1575
1567
```
1576
1568
Start UdpNTPClient on NUCLEO_F767ZI, using W5x00 & Ethernet2 Library
1577
- EthernetWebServer_STM32 v1.3.0
1569
+ EthernetWebServer_STM32 v1.3.1
1578
1570
[ETHERNET_WEBSERVER] Board : NUCLEO_F767ZI , setCsPin: 10
1579
1571
[ETHERNET_WEBSERVER] Default SPI pinout:
1580
1572
[ETHERNET_WEBSERVER] MOSI: 11
@@ -1598,7 +1590,7 @@ The terminal output of **STM32F7 Nucleo-144 NUCLEO_F767ZI with LAN8742A Ethernet
1598
1590
1599
1591
```
1600
1592
Starting SimpleWebSocket on NUCLEO_F767ZI with LAN8742A Ethernet & STM32Ethernet Library
1601
- EthernetWebServer_STM32 v1.3.0
1593
+ EthernetWebServer_STM32 v1.3.1
1602
1594
[ETHERNET_WEBSERVER] =========================
1603
1595
[ETHERNET_WEBSERVER] Default SPI pinout:
1604
1596
[ETHERNET_WEBSERVER] MOSI: 11
@@ -1643,7 +1635,7 @@ The terminal output of **STM32F7 Nucleo-144 NUCLEO_F767ZI with W5x00 & Ethernet3
1643
1635
1644
1636
```
1645
1637
Starting SimpleWebSocket on NUCLEO_F767ZI with W5x00 & Ethernet3 Library
1646
- EthernetWebServer_STM32 v1.3.0
1638
+ EthernetWebServer_STM32 v1.3.1
1647
1639
[ETHERNET_WEBSERVER] =========== USE_ETHERNET3 ===========
1648
1640
[ETHERNET_WEBSERVER] Default SPI pinout:
1649
1641
[ETHERNET_WEBSERVER] MOSI: 11
@@ -1695,7 +1687,7 @@ The terminal output of **STM32F7 Nucleo-144 NUCLEO_F767ZI with LAN8742A Ethernet
1695
1687
1696
1688
```
1697
1689
Starting SimpleHTTPExample on NUCLEO_F767ZI with LAN8742A Ethernet & STM32Ethernet Library
1698
- EthernetWebServer_STM32 v1.3.0
1690
+ EthernetWebServer_STM32 v1.3.1
1699
1691
[ETHERNET_WEBSERVER] =========================
1700
1692
[ETHERNET_WEBSERVER] Default SPI pinout:
1701
1693
[ETHERNET_WEBSERVER] MOSI: 11
@@ -1768,7 +1760,7 @@ The terminal output of **STM32F7 Nucleo-144 NUCLEO_F767ZI with LAN8742A Ethernet
1768
1760
1769
1761
```
1770
1762
Start MQTTClient_Auth on NUCLEO_F767ZI with LAN8742A Ethernet & STM32Ethernet Library
1771
- EthernetWebServer_STM32 v1.3.0
1763
+ EthernetWebServer_STM32 v1.3.1
1772
1764
[ETHERNET_WEBSERVER] =========================
1773
1765
[ETHERNET_WEBSERVER] Default SPI pinout:
1774
1766
[ETHERNET_WEBSERVER] MOSI: 11
@@ -1807,7 +1799,7 @@ The terminal output of **STM32F7 Nucleo-144 NUCLEO_F767ZI with ENC28J60 & Ethern
1807
1799
1808
1800
```
1809
1801
Start MQTTClient_Auth on NUCLEO_F767ZI with ENC28J60 & EthernetENC Library
1810
- EthernetWebServer_STM32 v1.3.0
1802
+ EthernetWebServer_STM32 v1.3.1
1811
1803
[ETHERNET_WEBSERVER] =========== USE_ETHERNET_ENC ===========
1812
1804
[ETHERNET_WEBSERVER] Default SPI pinout:
1813
1805
[ETHERNET_WEBSERVER] MOSI: 11
@@ -1846,7 +1838,7 @@ The terminal output of **STM32F7 Nucleo-144 NUCLEO_F767ZI with W5x00 & Ethernet2
1846
1838
1847
1839
```
1848
1840
Start MQTTClient_Auth on NUCLEO_F767ZI with W5x00 & Ethernet2 Library
1849
- EthernetWebServer_STM32 v1.3.0
1841
+ EthernetWebServer_STM32 v1.3.1
1850
1842
[ETHERNET_WEBSERVER] =========== USE_ETHERNET2 ===========
1851
1843
[ETHERNET_WEBSERVER] Default SPI pinout:
1852
1844
[ETHERNET_WEBSERVER] MOSI: 11
@@ -1880,7 +1872,7 @@ The terminal output of **STM32F4 BLACK_F407VE with LAN8720 Ethernet and STM32Eth
1880
1872
1881
1873
```
1882
1874
Starting SimpleWebSocket_LAN8720 on BLACK_F407VE with LAN8720 Ethernet & STM32Ethernet Library
1883
- EthernetWebServer_STM32 v1.3.0
1875
+ EthernetWebServer_STM32 v1.3.1
1884
1876
Using mac index = 6
1885
1877
Connected! IP address: 192.168.2.138
1886
1878
starting WebSocket client
@@ -1905,7 +1897,7 @@ The terminal output of **BLACK_F407VE using LAN8720 Ethernet and STM32Ethernet L
1905
1897
1906
1898
```
1907
1899
Start WebClient_LAN8720 on BLACK_F407VE, using LAN8720 Ethernet & STM32Ethernet Library
1908
- EthernetWebServer_STM32 v1.3.0
1900
+ EthernetWebServer_STM32 v1.3.1
1909
1901
You're connected to the network, IP = 192.168.2.139
1910
1902
1911
1903
Starting connection to server...
@@ -1978,9 +1970,9 @@ Following is debug terminal output and screen shot when running example [Advance
1978
1970
1979
1971
```
1980
1972
Start 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
+ ......... .......... .......... .......... .......... .......... .......... ..........
1984
1976
```
1985
1977
1986
1978
---
0 commit comments