Date stamping on datalogger shield

Adafruit Ethernet, Motor, Proto, Wave, Datalogger, GPS Shields - etc!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
phil1349
 
Posts: 6
Joined: Fri Jan 10, 2014 12:46 pm

Date stamping on datalogger shield

Post by phil1349 »

Hi, I am fairly new to Arduino etc but am slowly getting the hang of it. I also have a data logger shield which I have got working quite successfully except that all files created on the SD card are date stamped "01/01/2000 01:00". All events are correctly date/time stamped so the RTC is working correctly so why not the file stamp ?

It is probably something very simple but I cannot see it.

Phil

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: Date stamping on datalogger shield

Post by adafruit_support_bill »

Here is an example of how to do it: http://forums.adafruit.com/viewtopic.php?f=31&t=17964

phil1349
 
Posts: 6
Joined: Fri Jan 10, 2014 12:46 pm

Re: Date stamping on datalogger shield

Post by phil1349 »

Thanks for the reply but unfortunately, I cannot make this work.

The problem seems to be with the Fat16 library. My SD cards are supplied Fat32 formatted so I re-formatted to Fat16 as per the instructions in the example sketch and while the now Fat16 card can be read & written to OK in the computer, when inserted in the datalogger shield any attempt to write to it gives the correct file name but the contents of the file is garbage.

Why is this ? Can you perhaps suggest alternative code to time and datestamp the file ?

Thanks,

Phil1349

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: Date stamping on datalogger shield

Post by adafruit_support_bill »

It could be a formatting problem. None of the major OS formatters follow the SD standard to the letter. Since FAT16 is a minimal implementation, it does not implement workarounds for all these discrepancies. The author of the library recommends using the SD Association formatter. https://www.sdcard.org/downloads/formatter_4

phil1349
 
Posts: 6
Joined: Fri Jan 10, 2014 12:46 pm

Re: Date stamping on datalogger shield

Post by phil1349 »

Again, thanks for the reply but unfortunately, the formatter did not help.

The formatter does not offer any options such as Fat16/32 or cluster size, any SD card it formats which is Fat16 formatted will default to Fat32.

Surely there must be other methods of accessing the file time/datestamp without using the Fat16 library especially as Fat16 on SD cards seems to be superceded by Fat32 ? I say this because I cannot find a SD card smaller than 8Gb and Fat16 restricts capacity to 4 Gb.

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: Date stamping on datalogger shield

Post by adafruit_support_bill »

The SDFat Library documentation claims to support both Fat16 and Fat32 and shows a timestamp function. I have not tried this myself, but It comes from a very reputable author.
http://www.arconlab.com/lab/Arduino/Lib ... /SdFat.pdf

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino Shields from Adafruit”