Text Files: write, then move to server

Good morning,
I'm getting ready to do an Arduino project with high school students this fall related to scientific ballooning. I want to build a flight computer, but all info on this topic is actually talking about data loggers. This will have other uses as well, so I want to build (and share) something that really works well. Some requirements are perhaps not the most direct way of doing something, but will make it easier to do with kids and will bootstrap some related projects.

Requirements / Use Case:
The Arduino must receive a serial input (the TNC of a ham radio) and write it to a text file. The Arduino (same unit or a second unit) will read the text file and parse it into memory. The Arduino will take action based on those values. It will then take all the current values, compile them, and write it to the text file. The Arduino (or second unit) will then transmit the contents of the text file as a serial output to the TNC for transmission. It would be preferred if the storage device could store at least three text files, in case of errors and for the Arduno to take action based on changes in data by comparing two or more text files. These text files will be processed (received, processed, transmitted) once every 60 seconds.

The goal is to have the balloon receive commands from the ground (such as to initiate an early cutdown) and to transmit critical data (internal temperature, battery condition).

Rather than just throwing something together (like usual...) I would like to carefully craft a solid solution that can become the foundation for future projects. Being a teacher, I don't have much money but I have a bunch of time this summer to work on this. Any ideas or links to other resources would be appreciated.

Thanks,
-- Markus

How big are the text files?

The text files are very small, containing only the values to transmit/receive. So a typical file might look like this:

4/1/2017, 1345, 01, 01, 14, 12.6, 15, 21, 16, A4, B2, 17, 15

They could be larger if something like XML is a better way to work with data.

Thanks,
-- Markus

That shouldn't be a problem. I presume each file is terminated with a cr/lf or some character denoting EOF.

Good catch - yes, each text file would have a termination character. Can also have anything else that someone thinks should be included. (I'm also developing the format of the text file as part of this project, so the file design is wide open.)

  • Markus

Sounds simple enough. Read the serial until EOF, then parse.

Probably should mention this...

I'm good at pounding square pegs into round holes. I'm also pretty good at being able to conceptualize and describe how a system works. But I have never been a programmer beyond what is required to solve a problem.

So if you're suggesting something, it would be great to have links to a resource or sample code. Please don't assume I know something beyond the basics. (And if I do, no offense taken for describing it again - might lead to new ways of thinking about old things!)

-- Markus

I didn't want to seem patronizing. You might want to search for a C example of reading and parsing a CSV (Comma Separated Variable) file. The only example I have here is for my RPi as the master (receiver) and a Mega2560 as the slave (sender).

edit: I have an example for my Mega as the receiver from my GPS module, but not here. Won't have access to it until this evening.