2 Replies Latest reply on Jul 9, 2015 8:52 AM by PepeHoernchen

    Writing to SD card fails after some time


      I'm working on a project which involves an Intel Galileo, two temperature sensors, and I want to write the data from the sensors to a .txt file on the SD card, about every 2 seconds. So when I upload the Arduino sketch and start it, this all works fine - but after about 15 minutes it stops working, no more data is written to the SD card. When I watch the whole process on the Arduino serial monitor, it shows that after these 15 minutes the file on the SD card cannot be opened anymore.



      Still, it can't be the file size, because when I start the whole sketch again, it continues writing to that file - again up to approximately 15 minutes in - without deleting any of the old data. When I do the writing less often, so every 5 seconds instead of every 2, it takes correspondingly longer until it just stops.



      Also, when I try the "SD.begin()" command, it returns false - but creating files and writing to the card then works fine!



      Can anyone help me? I already tried a lot, including updating the firmware, checking the Linux image on the SD card (which looks fine) etc. etc.... I appreciate every idea!

        • 1. Re: Writing to SD card fails after some time

          Just a short update: I did some trouble shooting, trying the setup with an Arduino Uno (without SD card), and found that the problem might be the I2C connection: While the Galileo is only able to read 950 values from one sensor connected via I2C, and then just prints out false values, my Arduino Uno never stops reading the sensors correctly.

          Does anyone have an idea what might be the problem here? Is there something wrong with combining the Wire library with the Galileo?

          • 2. Re: Writing to SD card fails after some time

            Ok, so here's an update: I tracked the problem down to the Wire library, it looks like some kind of buffer is overflowing when you call the Wire.begin() function regularly. I wasn't quite able to change that, so I just made some changes in the library that I got with the temperature sensors (Adafruit MCP9808), so that I simply don't need the begin-function more than once or twice. It's not the most beautiful solution, but good enough for me... Especially if you consider my need to stop the headaches I got

            1 of 1 people found this helpful