What is the practical impact of the web server module in ESPHome?

The documentation for the web server module in ESPHome states that

enabling this component will take up a lot of memory and can lead to problems, especially on the ESP8266

In practice, does this mean that

  • the device may simply not work if all of the memory is taken when trying to enable the module
  • or: the device will work if the module is enabled and there is enough memory
  • or: the device may behave erratically

I added the module to a test Sonoff Basic and I do not see any problems. What I am trying to understand is whether the issues mentioned in the documentation are predictable (it works or it does not work) or not (the same device may sometimes work, and sometimes not, depending on things outside our control).

I enabled the web server on an ESP8266 and used that to drive a string of WS2812b’s. If I had a single light entity, a button, some status sensors for the WiFi and connected, etc everything worked fine. The program used close to 60% of the available program memory. I then started creating virtual light segments within the physical light component. The more and more I added, especially with effects, the more program memory was used. Eventually I reached a point where all of the lights showed up in HA, but the web server could not show all of them or couldn’t show a toggle button for all or or even their status. The web server only partially rendered. While all the lights worked, the web server showed erratic behavior because the memory was full.

1 Like

I have quite a few Esp Home modules and all have the fallback web interface. (if that is what you are referring to?) These range from sonoff basic through nodemcu esp8266 devices and esp32 devices. I have never experienced any issues with performance. Enlighten me if my assumption is wrong and I will test it and report back here!

No, he is referring to https://esphome.io/components/web_server.html

That’s excellent information. Thanks.

Really it is about being aware of the amount of memory and programming memory that enabling the web server utilizes. Depending on the ESP8266 devices memory or even clock enabling the web server while doing other things, for example 20+ lighting effects on an addressable light, you could run out of program memory or run the device out of RAM under normal operation with the web server enabled.

Yeah sure I think he understands that. The question was more about what actually happens when you do run out of memory. Whole system instability or just the web server?

Squirtbrnr provided the answer.

Depending on the device, lockups, reboots etc… Some devices are more unpredictable… It’s hard to pin down really.

1 Like

Thanks wasn’t aware of that - Out of touch as they say!

This sounds actually like a well known bug (not related to memory) in 1.14 and should be already fixed in 1.15 beta or 1.16 dev

nope, I experienced this issue back in 1.13 and if I remember, 1.12 as well. Light partitions were added in 1.11 but I didn’t start using ESPHome until 1.12. Not sure how long the web server has been around. The fact of the matter is the ESP8266 is short on memory. I’ve never experienced this with an ESP32 with the same or more light definitions.

I have an ESP32 with 2 physical lights defined and 9 partitions defined (11 total) plus a button and smaller light, WiFi status sensors, and a couple other sensors. I’ve never had an issue with this ESP32 regardless what version of ESPHome I used (1.12 and 1.13). If I compile the same code for an ESP8266, I have to remove the effects from all of the lights just to compile the code within the memory space limits. Then when the web server starts up, only some of the lights show up and not all of them have the toggle button next to it and the web server just stops rendering.

I only recently updated to 1.14 (maybe a month ago) so it’s not a bug introduced by 1.14.