Go Down

Topic: Is it possible to list number of logs? (Read 208 times) previous topic - next topic

0miker0

I have a small custom board that has a SAMD21G processor, microSD card and a few sensors that logs results with a timestamp. Right now I can create the log file, log the sensor data, delete the log file view SD card details. Displaying all the log values on the little Oled display is not helpful but I was wondering it it is possible to view the number of logs in the .csv file? I could store the number of logs in flash on the processor but view the number on the sd card inside the .csv file would be nice if possible.

chucktodd

I have a small custom board that has a SAMD21G processor, microSD card and a few sensors that logs results with a timestamp. Right now I can create the log file, log the sensor data, delete the log file view SD card details. Displaying all the log values on the little Oled display is not helpful but I was wondering it it is possible to view the number of logs in the .csv file? I could store the number of logs in flash on the processor but view the number on the sd card inside the .csv file would be nice if possible.
You have a couple of options:
  • Maintain a current count of log entries in a variable.
  • Scan through the log file counting entries.
  • Structure the log file such that each entry is EXACTLY the same length.
    Then just calculate the number of entries =  file.fileSize()/recordLength;


If you maintain a count, you will have to initialize the value every boot cycle.

I would recommend not storing a 'count'.  I would scan and display the 'current' entry count.

Chuck.
Currently building mega http server 90% done, the Last 10% is killing me.

Go Up