I am not sure how to deal with uploading data from and SD via GPRS and still capture data to while its doing that. I have no idea where to start. My first idea is to store it on on the EEPROM and then shuffle it over when its done. I have not looked into it that much but I feel like there is going to have to be a lot of testing with a 4KB limit. Another thought is maybe use dual memory cards, is it hard to transfer files between two memory cards? im not sure how that would work on a single bus. I feel like this issue has had to have come up before with other people. any examples or tips would be appreciated.
Another thought is maybe use dual memory cards,
How would that help? You still have a need to write and read at the same time.
is it hard to transfer files between two memory cards?
Never tried, but it really should be pretty simple. Although I don't think it will solve your problem.
What, exactly, is the Arduino doing? Reading data from a GPS I got. Apparently storing that data on an SD card, too. Where are you uploading to? How long does that take? What triggers that to happen? How often? Does the data get deleted after being uploaded?
You could hold a couple of sentences in memory while that data currently in the file is copied elsewhere, and then store those buffered sentences to a new file, if the data deleted after uploading. If it isn't, you can append the buffered sentences to the existing file.
The trouble with appending the data to the file is that it increases the time needed to upload the data. Eventually, you will reach a point where there is simply not enough memory to buffer new GPS data while the stored data is re-uploaded.
Data is coming in randomly from sensors such as temp and humidity. It is stored to a file on the an SD card. Ideally it would upload files periodically like every 5-15 minutes on a gprs modem. The gprs modem can get very slow sometimes so I would imagine it taking 20 seconds or so to facilitate the upload. During those 20 seconds, it would be nice to store 100s of readings.
During those 20 seconds, it would be nice to store 100s of readings.
I would think that starting a new output file each time an upload occurred would solve that problem.
On the other hand, storing 100s of readings in 20 seconds sounds impractical anyway.
I'm not sure if you can have multiple files open on the SD card at the same time. If you can, then creating a new file each time an upload is required, and uploading the contents of the old one, would work. If not, I don't see how you will be able to record anything while the upload is occurring. Storing "100s of readings" anywhere but on the SD card is not going to be practical.
One answer would be to have two arduinos. One to deal with the sensors and the other to deal with sending the data by GPRS.
The second arduino would indicate to the first arduino whether it is busy (sending) or not.
The first arduino reads the sensor. If the second arduino is not busy, the first arduino sends
the data to it by serial connection an the second arduino stores it in its data file on SD.
If the second arduino is busy, the first arduino stores the data in its data file and re-transmits it
to the second arduino when the second arduino isn't busy any more, in between sensor reads.