Esp8266 crashing after 30 mins

Status
Not open for further replies.

dr pepper

Well-Known Member
Most Helpful Member
I put together a data logger that serves a couple of guages and a google graph to a webpage, it works well, but packs up after an hour or so.
The page still part loads then hangs.
It runs on an esp8266-01, there is a 2200 cap across the power in.
So I programed a wemos d1 with the same code, all settings the same, except the board type.
Programming was done with arduino ide.
The wemos works fine for days, and I think it will probably carry on.
The 8266-01 is setup for 1m flash 64k spiffs, flash type Dio.
I ran the flash confog checker that comes with the ide so I know thats correct.
Bad board maybe?
 
Could it be a memory leak causing the heap size to drop. Try printing out the free memory as it's running - see ESP.getFreeHeap().

Mike.
 
Well I did add that to the webpage, it tells you free memory.
Because its a datalogger it uses the flash (I think), on power up the code determines the free memory, leaves 35kb spare for the esp to run and allocates the rest to the logger.
This sounds like it would cause the problem, but it works fine on a wemos, and the code was adapted from another system that also runs fine.
The site says 29kb is still free, but I havent been able to check that up to the point where it crashes.
I dont use spiffs to create the memory array, I just create a large array, I'm not sure if it goes into ram or flash to be honest.
And if it did the system only takes readings every 10 mins, and it takes a couple of weeks to fill the memory assigned, so a full memory write would be 2 weeks x 10,000, I dont think I'd be around long enough to see it fail.
 
5 mins 3 months, were you saving a lot of data so it was rolling over.
Mine takes 2 weeks to wrap around.
Making me wonder if its 10,000 write cycles per location, or its 10,000 write cycles to any location.
The wemos I'm using is my prototype goto and has been used a lot, it works fine, the esp 01 I used that doesnt work is new unwrapped from its packet 2 days ago.
 
T'other thing to mention is that the esp is 'talking' to an arduino, the arduino sends serial sensor data to the esp, and the esp serves tha data as a chart on a webpage.
The arduino is 5v, and the esp obviously is 3.3, there is just the ground and data line connected, the latter has a 1k in series to shift the level from 5 to 3.3v, it just relies on the built in protection diode in the esp to conduct & drop the voltage.
I guess I could try running it for 24 hours without the datalines connected.
 
Bodged it for now.
I used a esp12 based board, and used espsoftware serial to create a second com port and use it for receiving data from the arduino.
I would like to suss out the issue with the esp 01 though, must be a memory thing, thats the only difrence.
 
5 mins 3 months, were you saving a lot of data so it was rolling over.
I was appending a file on spiffs so I'm not sure how that works. Basically, 3 months at 5 mins is 288 writes per day or ~25,000 writes. The data was an ascii line of about 16 characters.

Mike.
 
The original has been running since the end of septembe and still seems ok.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…