hi,
so i have been developing a sketch that works as an ethernet client and posts some data to a WSGI apache server that stors it in a MySQL database...
for the last few weeks (feels like months) i have been fighting with the stability of the sketch (as it seems many others have as well).
normally i could post to my server for an unpredictable amount of time then the sketch would just freeze!! uggh..
however last night i made a seemingly minor change and eureka! its been stable all night. even at 3 http requests per second!!
so heres what i did:
Problematic code:
client.println(outBuffer);
client.println("Host: www.arduino.cc");
client.println("User-Agent: arduino-ethernet");
client.println("Connection: close");
client.println();
Seemingly ok code:
#define httpHeader "\nHost: www.arduino.cc\nUser-Agent: arduino-ethernet\nConnection: close\n"
strcat(outBuffer,httpHeader);
client.println(outBuffer);
so why the dramatic difference?? anyone got any ideas? im not 100% confident that i fixed anything but so far my tests are promising. also as a note, i am using the Seedstudio Ethernet Shield V1.0 with the Wiznet 5100 on an Arduino mega 2560.
thanks.