Closed salasidis closed 2 years ago
Can you also update the src files to your repo, then make the PR again to reduce the number of PRs?
Also merge to the RSMOD
branch first to test. Then will merge to the main
branch after everything is OK.
Don't know how to resolve the conflicts - it says has conflicts, and use command line to resolve. I need to merge your changes first, and then will d a new pull request, and the example files should be the only thing different
It's very good now. I'll scan thru and merge soon.
I guess I don't have to confirm a pull request - I thought I hadn't completed it.
Thanks for the walkthrough - I was missing having to download the files locally, and then upload them into my repository. There were actually no conflicts after doing that.
The new examples somehow don't auto-refresh the graph. Can you check why with the new code ?
I specifically eliminated the auto refresh, by removing the meta tag on the web html. Just to make the output cleaner - single pass. Can manually refresh if required.
To demo the larger graph, also change the examples to
strcat(cStr, "<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" width=\"1810\" height=\"150\">\n");
strcat(cStr, "<rect width=\"1810\" height=\"150\" fill=\"rgb(250, 230, 210)\" stroke-width=\"2\" stroke=\"rgb(0, 0, 0)\" />\n");
from
strcat(cStr, "<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" width=\"310\" height=\"150\">\n");
strcat(cStr, "<rect width=\"310\" height=\"150\" fill=\"rgb(250, 230, 210)\" stroke-width=\"2\" stroke=\"rgb(0, 0, 0)\" />\n");
OK, I still prefer put it back to demo the HEAP
is still very good after many times running
<meta http-equiv='refresh' content='5'/>\
So far so good. Everybody will love your new powerful enhancement.
Will certainly spread to many other Async libraries, at least mine.
Merging now. Will create a new version soon after some minor changes and enhancements (favicon example, etc.)
If you have time, please create similar powerful PRs for many other AsyncWebserver libraries of mine.
Best Regards,
I unfortunately have no other boards to run or test on, but if I need to use another lower cost board, I will be sure to port this to it as well (presumably the source is very similar between all of them).
One important thing to note however, without the memory mapped SDRAM, other boards would only get half the benefit, as the initial string will have to reside in the regular heap space. So in the second example (with the C string), I think the heap required would be in the order of 50k-60k instead of 12k (but still better than 111k)
One important thing to note however, without the memory mapped SDRAM, other boards would only get half the benefit, as the initial string will have to reside in the regular heap space. So in the second example (with the C string), I think the heap required would be in the order of 50k-60k instead of 12k (but still better than 111k)
Certainly, everybody must know this, at least not 2x
or 3x
like before
I unfortunately have no other boards to run or test on, but if I need to use another lower cost board, I will be sure to port this to it as well (presumably the source is very similar between all of them).
You can start with very cheap boards, such as (according to priority : power, cost, popularity, availability, etc.)
RP2040W
using built-in WiFi
=> AsyncWebServer_RP2040WWT32_ETH01
using built-in Etherrnet LAN8720
=> AsyncWebServer_WT32_ETH01ESP8266
using Ethernet W5x00 or ENC28J60
=> AsyncWebServer_EthernetSTM32F7 / F4
using built-in LAN8742A or LAN8720
=> AsyncWebServer_STM32Teensy 4.1
using QNEthernet
=> AsyncWebServer_Teensy41So far so good
Start Async_AdvancedWebServer_MemoryIssues_Send_CString on PORTENTA_H7_M7 with Ethernet using Portenta_Ethernet Library
Portenta_H7_AsyncTCP v1.4.0
Portenta_H7_AsyncWebServer v1.3.0
Using mac index = 18
Connected! IP address: 192.168.2.123
HTTP EthernetWebServer is @ IP : 192.168.2.123
HEAP DATA - Pre Create Arduino String Cur heap: 8458 Res Size: 451680 Max heap: 8472
.HEAP DATA - Pre Send Cur heap: 9634 Res Size: 451680 Max heap: 10196
Out String Length=31259
HEAP DATA - Post Send Cur heap: 9734 Res Size: 451680 Max heap: 12847
HEAP DATA - Pre Send Cur heap: 9634 Res Size: 451680 Max heap: 12847
Out String Length=31279
HEAP DATA - Post Send Cur heap: 9734 Res Size: 451680 Max heap: 12847
.HEAP DATA - Pre Send Cur heap: 9634 Res Size: 451680 Max heap: 12847
Out String Length=31231
HEAP DATA - Post Send Cur heap: 9734 Res Size: 451680 Max heap: 12847
.HEAP DATA - Pre Send Cur heap: 9634 Res Size: 451680 Max heap: 12847
Out String Length=31239
HEAP DATA - Post Send Cur heap: 9734 Res Size: 451680 Max heap: 12847
HEAP DATA - Pre Send Cur heap: 9634 Res Size: 451680 Max heap: 12847
Out String Length=31259
HEAP DATA - Post Send Cur heap: 9734 Res Size: 451680 Max heap: 12847
.HEAP DATA - Pre Send Cur heap: 9634 Res Size: 451680 Max heap: 12847
Out String Length=31249
HEAP DATA - Post Send Cur heap: 9734 Res Size: 451680 Max heap: 12847
HEAP DATA - Pre Send Cur heap: 9634 Res Size: 451680 Max heap: 12847
Out String Length=31200
HEAP DATA - Post Send Cur heap: 9734 Res Size: 451680 Max heap: 12847
.
Start Async_AdvancedWebServer_MemoryIssues_SendArduinoString on PORTENTA_H7_M7 with Ethernet using Portenta_Ethernet Library
Portenta_H7_AsyncTCP v1.4.0
Portenta_H7_AsyncWebServer v1.3.0
Using mac index = 15
Connected! IP address: 192.168.2.123
HTTP EthernetWebServer is @ IP : 192.168.2.123
HEAP DATA - Pre Create Arduino String Cur heap: 7434 Res Size: 452048 Max heap: 7448
.HEAP DATA - Pre Send Cur heap: 48611 Res Size: 452048 Max heap: 48611
Out String Length=31259
HEAP DATA - Post Send Cur heap: 79009 Res Size: 452048 Max heap: 111347
.HEAP DATA - Pre Send Cur heap: 48611 Res Size: 452048 Max heap: 111347
Out String Length=31279
HEAP DATA - Post Send Cur heap: 79029 Res Size: 452048 Max heap: 111387
HEAP DATA - Pre Send Cur heap: 48611 Res Size: 452048 Max heap: 111387
Out String Length=31231
HEAP DATA - Post Send Cur heap: 78981 Res Size: 452048 Max heap: 111387
.HEAP DATA - Pre Send Cur heap: 48611 Res Size: 452048 Max heap: 111387
Out String Length=31239
HEAP DATA - Post Send Cur heap: 78989 Res Size: 452048 Max heap: 111387
HEAP DATA - Pre Send Cur heap: 48611 Res Size: 452048 Max heap: 111387
Out String Length=31259
HEAP DATA - Post Send Cur heap: 79009 Res Size: 452048 Max heap: 111387
.HEAP DATA - Pre Send Cur heap: 48611 Res Size: 452048 Max heap: 111387
Out String Length=31249
HEAP DATA - Post Send Cur heap: 78999 Res Size: 452048 Max heap: 111387
Can you, if having time, make a new example using CString, but not in SDRAM. This will be used in many other boards without SDRAM access.
Can do - will be going out to dinner soon, so I will do it later today, or tomorrow
No worry, I have to go too.
Hi @salasidis
The new Portenta_H7_AsyncWebServer v1.4.0 has just been published. Your contribution is noted in Contributions and Thanks
Also check Important Note from v1.4.0
CString
in optional SDRAM
to save heap to send very large data
. Check request->send(200, textPlainStr, jsonChartDataCharStr); - Without using String Class - to save heap #8
Do not update src files, as they do not include khoih changes already made