-->
Page 1 of 2

Custom C code - Debugging help needed

PostPosted: Fri Oct 02, 2015 5:27 pm
by tomte76
Hi,

can anybody help me debugging my application? I use esphttpclient and in my small test application everything works fine. Now I added some more i2c sensors and also an i2c display. And I set up 3 os_timers to do things like reading the sensors, updating the display and sending data using http(s) to an external server. While reading and sending the data worked before in the test-app, now the module always crashes while sending the data and I cannot figure out the reason for it. The free heap seems not to be the problem as I can track it down until it goes into the connect callback and the heap looks ok. The crash occours on the same position if I switch from https to http. So using SSL also seems not to be the issue. The request never reaches the web-server, it does not show up in the logs there. So I assume it crashes anywhere in the connect procedure. Can anybody point me in the right direction how I can get more information on what went wrong in detail? I am using esp-open-sdk and SDK-1.3.0.

Thank you.

Re: Custom C code - Debugging help needed

PostPosted: Fri Oct 02, 2015 7:26 pm
by xtal
I had problems with nodemcu and have disabled parts of my web page to try to isolate the problem.
my heap shows 12000+ but if I add 1 more line of html code -- not enough memory ,, and have had crashes while running , again not enough memory.

Re: Custom C code - Debugging help needed

PostPosted: Sat Oct 03, 2015 11:06 am
by tomte76
I meanwhile figured out, that it is a watchdog reset, not a crash. But I don*t really understand how I can prevent it from triggering the watchdog. Sending the data using httpclient mostly consists of callbacks triggering each other. So how can I achieve to insert some timeslots for the system to feed the watchdog?

Re: Custom C code - Debugging help needed

PostPosted: Sat Oct 03, 2015 12:06 pm
by tomte76
The problem seems to be related to the use of global variables like I was used to on the AVR platform. What would be the right procedure to share data in different os_timers?