Replies: 13 comments 33 replies
-
Can you please attach the crash logs, decoded ? |
Beta Was this translation helpful? Give feedback.
-
You also point to an old version |
Beta Was this translation helpful? Give feedback.
-
The changes are listed in the release notes: https://github.com/mathieucarbou/ESPAsyncWebServer/releases The api has been cleaned up a little, for example, On ESP32, you also do not need to use the Again, the deprecation warnings when compiling will tell you that. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Now that it is basically running with the latest EspAsyncWebserver version and Arduino 3, I would like to come back to my general questions. Since users of my project have recently increasingly reported that the ESP crashes when they use the WebUI, especially if the WebUI is regularly open or more than one client is connected, I have just made a few more tests. And I can sometimes provoke a crash if, for example, I open several tabs in the browser (>6). This also fits with the specification of SSE where a maximum number of 6 client connections is defined. I don't think that users have more than 6 clients open, but I can imagine that connections are not always closed cleanly and this can lead to such crashes even if only 1 or 2 clients are connected at the end. Do you share my concerns here? The second point is the question of the use of AsycTCP vs AsyncTcpSock. I would therefore be pleased to receive tips and advice from you experts |
Beta Was this translation helpful? Give feedback.
-
if it is interesting, here are two examples of crash reports that happen if I open more than 6 connections
———
|
Beta Was this translation helpful? Give feedback.
-
just got a glimpse to your code, @dewenni, nice project indeed. It has ways to improve though. |
Beta Was this translation helpful? Give feedback.
-
@dewenni, |
Beta Was this translation helpful? Give feedback.
-
@dewenni ws implementation looks nice, you could optimize some repetitive string literals into a |
Beta Was this translation helpful? Give feedback.
-
@dewenni I was able to build and flash it. Though have problems connecting it to my WiFi AP. Anyway, after connection I've enabled sim mode as you mentioned, then opened 8 tabs (two browsers, 4 tabs each) - looks like it works. |
Beta Was this translation helpful? Give feedback.
-
Hi @dewenni, Here is what I see from serial log with a bit of debuging added in just few milliseconds heap usage spikes for more than 50k and it's only two clients connected. so it periodically received 10-20k of message data in json's, plus static web resources. Leave alone small text updates, not makes much difference. you run this part VERY frequently, each This is not good design.
Another considerations:
Maybe websocket approach would be better for you because it does not queue, but anyway there are thing that might benefit a lot from simplifying and reducing useless duplicated data transmissions. |
Beta Was this translation helpful? Give feedback.
-
@dewenni you are welcome! Anyway was testing my recent PR, found a small issue by the way. So was for mutual benefit :) As for static content you could use, for example, git commit hash as ETAG or build date-time. See Mathieu's reply for inspiration. IMS (if-modified-since) is implemented only for static content from FS 'cause it takes file modification timestamps. Also forget the term constexpr const char *STR_AUTOMATIC[] = {"Automatik", "Automatic"};
constexpr const char *STR_MANUAL[] = {"Handbetrieb", "Manual"};
typedef struct {
const char *const *AUTOMATIC = STR_AUTOMATIC;
const char *const *MANUAL = STR_MANUAL;
} This is one of the options, but you could avoid If you need this for translations |
Beta Was this translation helpful? Give feedback.
-
short update: @vortigont the advice to use namespace for the const strings is great and was easy to change - thanks! Since I already save the settings that can be made in the webUI in a config.json anyway, I have now written a js function that parses the config.json and also identifies and updates the elementID of the web elements generically based on the json elements. This means that I no longer have to send this ~2kB of data via WS. I could now also include the ETag check. Regarding the general web content (html, js, css) I will probably have to stick to serving the content directly from the normal Flash. I already have the problem with my application that goes out with the Flash. I already use min_spiffs.csv as partition scheme to have as much space as possible for the application. I can't afford to generate the web content again in LittleFS. The next step will be to think about how I can reduce or optimize the transmission of the remaining WS data (2x ≈ 4 kB values read by the connected heating system). |
Beta Was this translation helpful? Give feedback.
-
Hi Mathieu, Hi Community,
first of all I want to thank you for being so active in developing EspAsyncWebserver and all your other Libraries.
Especially EspAsyncWebserver that was not maintained for a long time but even used in so many projects!
I have developed a project that is based on EspAsyncWebserver and can be used to monitor and control an older "Oil Heating System" from Buderus.
The Project can be found here: ESP_Buderus_KM271
The actual version of the projects works fine for me and in my environment. But more and more user are using my Software and in the last time they reporting more and more issues regarding the WebUI and general stability.
For example it seems to be a problem for some users if they open more than one client at the same time.
Because of a feature request for Ethernet Support I am also trying to migrate the project to Arduino 3 and implement support for W5500. I hoped that this migration and also the update to the newest version von EspAsyncWebserver can solve some problems?!
But unfortunately I am struggling to get it running with the latest versions.
Migration to Arduino 3.0.7 works for me, but if I want to upgrade also your EspAsyncWebserver it crashes all the time.
Therefore I wanted to ask you for some help, because I don’t know how to handle this.
In the meantime, I'm also unsure whether what I've programmed is actually OK, or whether your experience tells you that it should be done differently.
In the past I used a Library ESPUI but there was also more and more a limitation of what I can do, and with my need for more web elements, this solution also became unstable when a client connected and all data had to be sent to the client.
In general:
The oil heating system delivers a lot of values that has to send to the web client.
When I decided to build my own solution that is not based on ESPUI-Library, I did some tests with web sockets vs. EventSource+SSE and it seems to me that EventSource+SSE is more stable when I try to send a lot of data to the client.
So my actual solution is based on EventSource+SSE
In the past, I used to send every single value from the ESP to the client. Meanwhile I have changed this and initially send the data in larger JSON packets during a client connect and then only the changes as individual commands. Size of this JSON is from 2048-5120 bytes.
I would therefore be delighted if you could take a look at my project and give me some advice on the following topics:
I have uploaded the branch „arduino3“ in my GitHub repository that can be used for tests, commits or PR
https://github.com/dewenni/ESP_Buderus_KM271/tree/arduino3
If you want to get it up and running, here is a little description
once you have downloaded the software on a ESP32 you should get this log message:
! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !
I (APP-SETUP): > WiFi Mode: AccessPoint <
I (APP-SETUP): 1. connect your device to SSID: ESP-Buderus-km271
I (APP-SETUP): 2. open Browser and go to Address: http://192.168.4.1/
I (APP-SETUP):
! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !
So you can connect to the AP called ESP-Buderus-km271 und then open http://192.168.4.1/
after that you should be able to see the webUI and edit the WiFi credentials
I would then also recommend to set also this options to get a realistic setup with more web elements:
Then press restart at the bottom of the settings page.
So again, I would be really really happy if you could support me here.
Beta Was this translation helpful? Give feedback.
All reactions