-->
Page 2 of 3

Re: 24 - 48 Hours

PostPosted: Wed Jan 25, 2017 5:04 am
by NullPointer
Well, it is the heap. My one hour of monitoring wasn't enough (looked stable). What is odd is that there are large drops every couple of hours or so.

I am not accumulating data on it, just posting a string every 30 seconds. I am going to make certain I'm not doing something stupid with the variables, I'll report back if I find a module is leaking or more likely I'm not understanding how to make sure the heap can be freed.

Image
http://imgur.com/a/3vB8C

Re: 24 - 48 Hours

PostPosted: Wed Jan 25, 2017 12:25 pm
by NullPointer
Found the issue.

Code: Select all200 POST http://myserver/
{"name": "NodeMCUi", "status": "good", "posts": 36, "sensordata": "22.125,1,3032,21704", "sensordefn": "temperature,switch,voltage,heap", "upsince": 636209247233129853}
200 POST http://myserver/
{"name": "NodeMCUi", "status": "good", "posts": 37, "sensordata": "22.1875,1,3032,21704", "sensordefn": "temperature,switch,voltage,heap", "upsince": 636209247233129853}
HTTP client: Disconnected with error: -11
HTTP client: Connection timeout
HTTP client: Connection timeout
{"name": "NodeMCUi", "status": "good", "posts": 38, "sensordata": "22.125,1,3032,20904", "sensordefn": "temperature,switch,voltage,heap", "upsince": 636209247233129853}
200 POST http://myserver/
{"name": "NodeMCUi", "status": "good", "posts": 39, "sensordata": "22.1875,1,3032,21112", "sensordefn": "temperature,switch,voltage,heap", "upsince": 636209247233129853}
200 POST http://myserver/


If the http module experiences loss of connectivity, the node loses some heap. I was able to verify this with "myserver" logs and also watch it happening via a serial monitor. The third item in "sensordata" JSON above is the heap, repeated disconnection errors from HTTP client seems to be causing the heap loss.

I don't know if switching to the net module instead will help, though I have done. Going to run another long test and see if the same thing happens. I'd post a bug report to GitHub but I see there is already one open from a few days ago on this exact topic.

Re: 24 - 48 Hours

PostPosted: Wed Jan 25, 2017 2:22 pm
by marcelstoer
I'm quite positive that this can be solved once you have a MCVE. I encourage you also to check https://github.com/nodemcu/nodemcu-firmware/issues for know issues with one of your modules.

Re: 24 - 48 Hours

PostPosted: Wed Jan 25, 2017 3:00 pm
by NullPointer
I appreciate that marcelstoer, I'll set up a test of the http module with server connection failure so that it is independently verifiable.