Hello,
I'm getting lost in a "glass of water"... I lost 4 hours trying to debug it.
I made a litte sketch which I want to use as irrigation system for my home.
Im using an arduino uno compatible board with ethernet shield.
My goal and components:
acquire dht22 temp/hum sensor every 10 seconds
acquire soil resistance with analog input with a couple of metal rods and pullup res every 10 seconds.
a Ds1307 as clock input and verify when switch on/off the pump every 1 second
append all the data in a log file into the SD every 10 MINUTES
webserver (still to merge from another sketch I already made)
so I grabbed a bit of looping code from another project to keep the code simple to read
but I cannot write the LOG file into the SD card. I don't know why.
If I use the example sketch from arduino examples, it WORKS well, no problems at all.
In my sketch instead, it fails opening the file in the sd (error opening datalog.txt)
I tried a bit to insert some delay, but no success.
Are you certain you are not running out of SRAM? SD.open() will fail if not enough SRAM available. Here is a link to a post on another thread that has the code I use to check SRAM.
YEAAAAAA!!!! THANKS!!!!!!! program was running out of memory... I putted 571 chars in my serial.print calls under F(). I
Now I Have still more than 800 byte of free mem..
And the program runs!!!!!!!
Ok.. now the webserver .. Hope to have some free space with the ethernet library call..