Replies: 3 comments 5 replies
-
Good question! And I do not know the answer. Since ESPAsyncWebServer is used internally to make esphome work, I am not sure that you can replace it with the lib option (which is meant to add additional libraries). But It should be compatible since the API is the same and based on the same original fork. If you happen to see some differences,, please let me know. Also, pay attention that ESPAsyncWebServer is not the only dependency: ESPAsyncWebServer also have some dependencies (e.g. AsyncTCP for ESP32), and the AsyncTCP lib ESPHome is using also misses some bug-fixes. |
Beta Was this translation helpful? Give feedback.
-
Mathieu, thanks for your response. I've found some discussions why they decided to turn off PIO's LDF and specify all dependencies manually instead. Setting It seems it's better to keep it turned off. Fortunately, making it work is simple once you understand that the order of specifying dependencies is crucial! If you disable LDF, you need to declare dependencies before the libraries that rely on them. So, now my working config looks like this: esphome:
platformio_options:
lib_ignore:
- AsyncTCP-esphome
- ESPAsyncWebServer-esphome
libraries:
- FS
- WiFi
- Update
- mathieucarbou/ESPAsyncWebServer @ 3.3.7 Strangely, even after adding those libraries to lib_ignore, they're still being downloaded:
However, they are not mentioned later in Dependency Graph:
In contrast to when they're not added to
As I mentioned, this version compiles and performs significantly better than the original Previously, it was nearly impossible to open the ESPHome's Web server UI on either device because the server would initially send a lot of data, including all sensor information, and continue updating every second. Even if you managed to open it, refreshing the page a few times would inevitably crash the server. Now, after switching to your fork, I haven’t experienced a single crash on the device without Bluetooth, which has more free RAM. However, I still get some crashes on the device with Bluetooth and less available memory, but it’s much more stable overall. Maybe I should tune some parameters you mentioned in the README, like CONFIG_ASYNC_TCP_STACK_SIZE or something similar. I wonder if 70 KB of free RAM is too low... However, it's probably still too early to draw conclusions. I'll continue monitoring the stability and see how it performs over time. |
Beta Was this translation helpful? Give feedback.
-
Maybe because some components are adding them ?
Thanks for your perf tests! These are really encouraging. A lot of things have been improved yes, and I am pretty sure that depending on how ESPHome is using the library, further improvements could be made. Tweaking the stack size will only work if esphome correctly move tasks to execute outside of the |
Beta Was this translation helpful? Give feedback.
-
Hi, thanks for maintaining this library!
I'm wondering what the best way is to integrate it with ESPHome. I noticed some discussions about it, but I couldn't find a clear guide on what’s needed to get it working. Can it serve as a drop-in replacement for ESPAsyncWebServer-esphome?
I spent a few hours wrestling with PIO dependency management, and I think I've finally got it working. I'll share my solution here, but if there's a better approach, I’d love to know!
So I ended up with:
Maybe there is a way to avoid setting
lib_ldf_mode: chain
? I'm unsure what potential downsides might be.Solution that didn't work for me, though it is mentioned in ESPHome documentation as a way to override some libraries:
I haven't thoroughly tested it yet, but it compiles and works so far. Hopefully, it will be more stable than ESPHome's fork.
Beta Was this translation helpful? Give feedback.
All reactions