I've been developing yet another weather data logging station, for my own use (but I might eventually post my data publicly). After fits and starts it's now working pretty well, except for one thing.
I have it write weather readings once a minute to a MicroSD card inserted into an SPI-based breakout board I got on eBay a while back. It's been working fine at that.
Once or twice a day I remove the mSD card and insert it into my PC to transfer the data (which I currently store in Excel). I can usually do this in well under a minute, so as to not lose any readings. I have to remember to reset the station for it to recognize the re-inserted card, or otherwise it won't write future readings to it. No bigee, if slightly annoying.
But sometimes I'm not able to do this in under a minute, so I lose a reading or two. Not a huge problem since weather generally doesn't change that quickly, but for the hell of it I added some code to save readings in an array when a card isn't available to be written to, and then write all of them when the card is available again.
The problem with this is that if I reset the station, it loses these temporarily saved readings. So I have to find another way of recognizing when a card that was removed has been reinserted. This would also solve the minor annoyance of having the reset the station even when I can reinsert the card in under a minute.
Any ideas? Neither the standard SD library nor the somewhat more robust SDfile library seem to have obvious ways of recognizing when a card has been inserted, removed or re-inserted. But I'm no expert on either.
Eventually this will be less of an issue as I'm adding WiFi capabilities to this station via an ESP8266 board, that will upload readings to some remote DB. But for now, everything's local. Plus, even when it has WiFi uploading capabilities, I'm still going to want to store readings locally, on an mSD card, in case I lose my internet connection or something on the server or ESP8266 stops working.
Btw, as an aside, I'm thinking of getting a Raspberry Pi and setting it up as a LAMP (Linuxm Apache, MySQL & PHP/Perl/Python) server. Would that work, assuming I can figure out the HTML, PHP & SQL code (I've worked with all three in the past)?