Hello! is there anyone who may help me in code reducing?
I'm running out of memory with my arduino uno.
It compiles correctly, at about 29000 bytes but I cannot upload code into the board, as I encounter immediately a syncronization error soon and I run out of memory..
I'm using a ds1307, SD, ethernet and a dht22 temp sensor libraries..
this is the whole code..
www.thepiper.eu/files/irrighettox.ino
I have only had a very brief look at your code. It seems to be collecting data and then sending it somewhere via a weblink.
Would it be possible to send the data in abbreviated form to a PC and leave it to the PC to use it or restructure it for onward transmission? That way you could remove most of the web code from the Arduino.
Alternatively invest in a bigger Arduino. If you value your time that may be the be the cheapest option.
You can compress setting the RTC by setting all fields at once.
remove all float operations ( you can do the math in tents of degree and win 2-3K)
float hum_Soil =0; // resistenza terreno
float hum_Soil_target = 0.30; // Umidità desiderata. Sopra questa soglia chiudo acqua anche se non è passato un minuto.
you measure the voltage 0..5.0V and compare that to 0.30
you can also take the raw analogRead 0..1023 and compare that to 62 (if my math is right) ==> no float needed.
wow I was running out of memory during setup cycle..
I solved the problem by declaring subnet and gateway as globals..
don't know why.. but it seems that if I didn't declade them, the ethernet library was using addictional memory to assign by itself?!.
I used a "microwebserver" to show the status of the data by browser..
wow Rob!! I'll use immediately all of your ideas.
Thanks at all!!