Go Down

Topic: Null data is getting written on the SD card for some interval in particular patt (Read 410 times) previous topic - next topic

sanglems

Hi!

I am using Arduino UNO R3, Ethernet shield, RTC and two IR sensors in my system.

After every two seconds sensors data get written on SD card and when the web server is accessed the data from SD card gets written there and gets deleted from the SD card. This is what is requirement.

But i am observing that some times there are blank spaces on the web server and XXXXX to corresponding data in the SD card.

And there is particular pattern for the blank space/ XXXXX i.e
1. From 00:00 till i retrieve in the morning it gives all the readings.
2. After that first retrieval, next all start of the hr e.g 09:00, 10:00, 11:00 etc it gives data for 10-11 continuous minutes.
3. All the start of each minute but not the start of the hour it gives m data till 9 seconds.

rest all data comes as blank.


I tried to format the SD card few times but doesn't seems to be working.

Also since data comes correctly in between and I can access on my serial monitor all the time I think there is no issue with code!(May be I am wrong)

Is there anything I am missing??

Thanks.

PaulS

Quote
Is there anything I am missing??
Your code and some examples of correct and incorrect data.
The art of getting good answers lies in asking good questions.

sanglems

Hi.

Attaching herewith my code and Reading sample. The blank spaces in between is wrong! Need continuous readings like  we can see after 00:00 till I retrieved.

Thanks.

sanglems

#3
Mar 17, 2017, 02:10 am Last Edit: Mar 17, 2017, 02:20 am by sanglems Reason: Attachment is not getting attached!!
Sorry could not attach the readings in last post!

PaulS

Code: [Select]
      myFile.println(String(fourDigitYear) + "-" + String(month) + "-" + String(date) + " " + String(hour) + ":" + String(minute) + ":" + String(second) + ".000" + " " + "," + " " + String("11") + " "  + "," + " " + String("1")+ " " + "," + " " + String(binLevel));

Pissing away resources on the String class just so you can avoid using multiple myFile.print() statements is unbelievable.
The art of getting good answers lies in asking good questions.

sanglems

And do you think that can be the reason??!!
Will try for sure..:D

sanglems

That seems to be working. Though need to be check for longer time.
Thank you so much!!
Is it related to the RAM allocation?? and limit on string length??
Sorry for those questions. I am very new to Arduino n given done code to work on with.
Thanks. :)

PaulS

Quote
Is it related to the RAM allocation?
Yes.

Quote
and limit on string length?
C strings are not a problem. Instances of the String class are.
The art of getting good answers lies in asking good questions.

sanglems


Go Up