Arduino memory availability monitoring and email sending
Hello!
As part of the realization of my debug monitoring function on my connected beehive project with sending emails via an Ethernet shield and Arduino Mega I noticed this:
14: 10: 38.500 -> Correct assembly and card present
14: 10: 40.937 -> Number of tests requested: 2
14: 10: 40.937 -> <span style="text-decoration: underline;">2784</span> = free memory before email
14: 10: 40.971 -> Hi, it's Hive N ° 2 to give you my IP address.
.....
then once the sending of this first email is done:
14: 10: 42.124 -><span style="text-decoration: underline;"> 2155</span> = memory after sending the 1st email
14: 10: 42.090 -> resp code = 0
14: 10: 42.124 -> Message sent!
then just after sending a second email:
14: 10: 42.328 -> <span style="text-decoration: underline;">2053</span> = free memory before sending second email
14: 10: 42.367 -> Hi, it's Hive # 2, I just adjusted the time on the clock
14: 10: 43.556 -> resp code = 0
14: 10: 43.590 -> <span style="text-decoration: underline;">1940</span> = memory after sending the second email
14: 10: 43.590 -> Message sent!
14: 10: 43.590 -> we just readjusted the clock!
14: 10: 43.624 -> Free memory: <span style="text-decoration: underline;">2242</span>
And after the free memory of the Arduino remains at 2242, however before sending the 2 emails it was 2784. A loss of 542 bytes ...
Has anyone tracked this problem and found the origin of it?
Thank you
PS to know the available memory I use the function: freeMemory ();