Arduino uno and esp communicating on hardware serial at the baud rate of 9600 work perfectly and suddenly freeze and do not work until the uno is reset.
I am taking data from server through esp and sending it to the arduino and back to the esp which posts it back to a URL.
Level Shifting using resistors for esps Rx and TX is connected without ant boost to the UNO.
Is there a way out?Kindly Help!
People suggest using mega. But that is not an option, I am using it on my own circcuit using Atmega 328P AU.
(deleted)
spycatcher2k:
Print the free memory to Serial from the UNO, Most cases of this I've seen are usually down to memory management.
Thanks for the suggestion Sir.
Is this whay you are talking about ? Arduino Playground - HomePage
I will definitely try this.
By the way, compilation gives the following storage space info:
Sketch uses 9,050 bytes (28%) of program storage space. Maximum is 32,256 bytes.
Global variables use 579 bytes (28%) of dynamic memory, leaving 1,469 bytes for local variables. Maximum is 2,048 bytes.
(deleted)
spycatcher2k:
Erm . . I'm a Mrs.
Oh my bad. I am making changes to it Ma'am. The free ram function returns 1391 and I am making changes to the code reducing String usage and limiting array bounds. Is there any thing else I should do?
int freeRam () {
extern int __heap_start, *__brkval;
int v;
return (int) &v - (__brkval == 0 ? (int) &__heap_start : (int) __brkval);
}
void loop(){
// remaining code..
Serial.println(freeRam());
}
(deleted)
spycatcher2k:
Add it to your existing code and have it print every minute - this will show if itsa memory overflow issue.
Actually I am telling you a 5 minutes analysis, every time I am communicating I am printing this value.
This is the result may be it increases over an hour or so. I'll keep posting results.
MrJkComedy:
Arduino uno and esp communicating on hardware serial at the baud rate of 9600 work perfectly and suddenly freeze and do not work until the uno is reset.
Where is the code that exhibits that behaviour?
...R