ESPhttpUpdate memory leak #2905
Labels
component: libraries
type: bug
waiting for feedback
Waiting on additional info. If it's not received, the issue may be closed.
Milestone
Basic Infos
Hardware
Hardware: ESP-12
Core Version: 2.2.0
Description
HI there!
So, I have taken the example "httpUpdate.ino" and pointed the Updater to a php file on our local http server, which shall perform basic version checking and trigger the update if the right conditions are met. The source of the .php file is basically a copy and paste (with minor changes and adding a missing "?>" at the end) of the source example given under "Advanced updater" section of the link below:
http://esp8266.github.io/Arduino/versions/2.2.0/doc/ota_updates/readme.html#http-server
I should probably mention here that connecting to the server, receiving the .bin file as well as performing the update have all been tested and confirmed to work just fine.
To recreate the problem of interest, I have intentionally set both the requested version (in .ino file) and the stored version (in the .php file) the same, such that the device does not proceed to updating the firmware, but rather receives an "HTTP_UPDATE_NO_UPDATES" message on every cycle. All fine up to here!
The full .ino source code can be viewed below. As you can see, I have added a print out to display the available heap size on every iteration of the loop() function. What I can observe from Serial is a rapid drop of the free heap and, without any added loop delays, the device runs out of memory in about 45 seconds. Eventually, the device starts failing to send headers and finally spits out an Exception (29), which I assume simply means that some memory location has been overwritten. What is also interesting is that the drops are not the same in every loop() iteration, but rather occur randomly and are of random size. (as far as I can see)
Is this an issue, or am I missing something out?
Thanks much in advance.
Settings in IDE
Module: NodeMCU 1.0 (ESP-12E Module)
Flash Size: 4M (3M SPIFFS)
CPU Frequency: 80Mhz
Flash Mode: Unsure
Flash Frequency: Unsure
Upload Using: SERIAL
Reset Method: nodemcu
Sketch
The text was updated successfully, but these errors were encountered: