acrandal / GU-Rocketry-ATA-Module

ATA (Alternative To Aluminium) is a 1U cubesat form factor data telemetry and LoRA transmission board for the Gonzaga ASME 10k ft. competition rocket.
GNU General Public License v3.0
4 stars 0 forks source link

SD: Rotate data files on boot #13

Closed acrandal closed 2 years ago

acrandal commented 2 years ago

When the ATA Payload boots, it needs to determine the filename for the next data log file. I could just keep appending to the same file, but I feel that using a different one each time will keep things easier to track when it comes time to process the data.

The current algorithm is that the data files are in the root of the SD card (no directories) and follow the 8.3 file format as:
ATA00000.dat

Each time the device boots, it reads the files one by one, incrementing a counter for the filename number. Once it hits a free number, it uses that for the current logfile. It then creates the log file, writes out a header and begins operations.

The code for the filename search is already in the repo and has been tested on the SD card. Given the number space, it can reboot 99999 times before running out of filenames.

acrandal commented 2 years ago

Demo in repo works on hardware setup. Closing.