Multiple files created #81

JustinWhitaker opened this Issue Oct 18, 2011 · 21 comments


None yet
3 participants

I get multiple files on my SD card after running the OpenLog_Test_Sketch. I have loaded the v2.51 firmware onto the OpenLog to be sure that is up to date, and I have run the test sketch from an arduino mega 2560 and an arduino pro mini 328 5V, and get the same results with both combinations. I'm using the 9600bps and the testAmt = 4 settings in the sketch and this last time I got 48 files with all the test data. The OpenLog and the SD card are from Sparkfun, just purchased last week. It's a 1GB SD card that I formatted with SDFormatter V3.1 downloaded from, using the default settings.

I did see one other closed issue with a similar problem in which reloading the firmware solved the problem, but that didn't seem to help me. Any suggestions?

Thanks in advance,


nseidle commented Oct 19, 2011

Hah! I love issues like this - I'm really not sure what would cause this :)

Are you sure you have the config file set correctly to start up in New Log mode (See: If you have the config.txt file set to Command Mode then you might be sending a bunch of text to the command prompt that could maybe cause a bunch of new files to be created. It's a stretch.

Before running the test sketch, do you get normal logging operation? That is to say, when you power up the unit do you get the expected 12<?

I have tried the config file exactly like the default (9600,26,3,0) and I
have tried no config file at all and let OpenLog create it itself. I have
also tried different baud rates with the same result.

I do get that command prompt, so I believe that I am in logging mode. I can
put it in to the command mode and go through all the menus and everything
fine. I've tried resetting the log file numbering system, and I've tried
doing the emergency reset feature to make sure that all the settings are

I think I may have found something that might be a clue though. Because I
thought I've tried everything else, I thought maybe it's something with the
SD card itself. I pulled the SD card out of my cell phone (a sprint HTC
EVO) and put it in the OpenLog and it logged correctly...all the data in one
file! It's an 8GB card with 838MB of data on it. Why would that card work
and the 1GB blank one not work? Is there a different way I can format the
card and make it work?


On Wed, Oct 19, 2011 at 9:03 AM, Nathan Seidle <>wrote:

Hah! I love issues like this - I'm really not sure what would cause this :)

Are you sure you have the config file set correctly to start up in New Log
mode (See: If you
have the config.txt file set to Command Mode then you might be sending a
bunch of text to the command prompt that could maybe cause a bunch of new
files to be created. It's a stretch.

Before running the test sketch, do you get normal logging operation? That
is to say, when you power up the unit do you get the expected 12<?

Reply to this email directly or view it on GitHub:


nseidle commented Oct 21, 2011

I too have used the SD formatting program - I can't imagine that's the issue. Is there a way I can send you another 1GB card? If the replacement card works then I'd like to get the problem card to see what might be wrong with it.

Sure, that would be fine. I'll send my address directly to your email. What settings do I use to format the new card? I've changed the settings on the SD formatter since I first downloaded it, so I don't know what the default settings are anymore. Or should I use the Win 7 formatter with some certain settings?


nseidle commented Oct 25, 2011

The card swap is in the works.

I often use Windows to do a basic FAT16 or FAT32 format. Win7 works as well. I don't have access to the SD formatter (have you got a good link?). Google brings up a windows update that doesn't help.

Here is where I got the SD Formatter:

Thanks for your help!

So, I am obviously doing something wrong because the new card gives the same results. I formatted it with Windows 7 this time and I still get multiple files. I also tried removing the partition on the card and sticking the card in my phone and let it get formatted there since the card out of my phone seemed to work fine, but got the same results. I used it with the sketch that I originally got it for and it logs fine with the small amount of data that I am sending (only a count and lat/long data on the press of a microswitch), so I will just use it for now. Any other suggestions I might try?


nseidle commented Nov 7, 2011

Something fishy is going on :)

You might have a power issue. If you power OpenLog with nothing but VCC and GND (preferably from a battery or known good 5V+ source) what happens? You should see the status LED turn on for a second, then turn off indicating the unit is going to sleep.

If you do see the LED go out and you do not get multiple log files, then connect your Arduino/sketch TX pin to the OpenLog RX pin. You should see the status LED illuminate as it periodically receives data.

Could your sketch be sending something funny to OpenLog? Please post sketch somewhere where I can have a peek.

I've usually powered it from the Arduino Mega itself, and it does just as you describe...the blue light comes on for a second then goes off. I did just try powering it from a 9V battery and it does exactly the same thing. Without any other wires connected, just the VCC and GND, I get one log file that is empty when I remove the card and check it in my computer. There is a new empty log file for everytime I power it up and the blue light comes on.

I tried connecting the wire from my arduino mega TX0 pin to the OpenLog RX pin while still powering it from the battery, and then pushing the reset button on the arduino, and I got nothing. Shouldn't it have logged data like that? Or does it not work when the data coming in is not from the same power source that the OpenLog is connected to?

Anyway, I went back to powering it from the arduino and I get the blue light once I power it up, then when I press the reset button to start the sketch over again, I get the same results...the blue light stays solid for awhile, then it's intermittent with the blue light and the yellow light. I'm guessing that every time I see the yellow light it's creating a new file because when I look at the files on the card, there is usually one file at the beginning that has quite a bit of data in it, then there are a whole bunch that just have a line or two, so it seems to coincide with when the yellow light starts blinking.

I'm not sure where I could post the sketch, but I can try to figure it out if you'd like. It's the sketch that is in the folder that I downloaded from this site, in the "OpenLog_Test_Sketch" directory. I have downloaded it fresh many times and the only thing that I ever change is the baud rate by commenting out one of them and un-commenting another (I've tried several of them), and the number of tests (I've tried mainly 4 or 10 with the different baud rates).

I've tried re-uploading the firmware also, not sure if that was the right thing to do, but I figured it was worth a try. What board do you use to upload the new firmware? I've tried most of the boards that have 328 at the end of them and none of them seemed to make a difference.

Thanks for your patience with this one...I probably would have given up awhile ago if you weren't so willing to help.


nseidle commented Nov 9, 2011

I'm happy to help! Sorry you're having so many problems. I'm willing to help as long as you want to play "usability guinea pig". When you get tired of this, by all means tap out.

"I tried connecting the wire from ..."
This will not immediately work because you need to connect GND between your systems. But other than that, it sounds like the OpenLog is working as expected.

To try to replicate your issue, I broke out a mega2560 (this is the first time I've hooked one up :-O) and hooked up:
VCC to VIN on Mega
RX to TX0 on Mega

Using the card you sent me, I ran the OpenLog_Test_Sketch. I got LOG00304.TXT with gobledy gook because your config file has the baud set to 9600bps. Re-uploading the Test_Sketch configured to 9600bps, I get one big 109kb log file with the expected characters in it. So I can't replicate your issue yet. I need to pull a fresh OpenLog from stock to be absolutely sure.

To load firmware onto OpenLog is a bit of a challenge. Here is the link to the page that will explain some:
Although I need to update this page badly. I'll try to spend the morning cleaning up the wiki.

The only thing I was doing differently was I was using 5V on the mega to VCC on the OpenLog, instead of Vin on the mega to VCC on the OpenLog. I tried it with using Vin and I get the same results.

I've tried many different things on the OpenLog like reloading the v2.51 software and even older versions. Is there a way to sort of completely start over with the OpenLog? I don't know much about this part of it, but can I restore the whole chip to its original state, or is that what the v2.51 sketch is for? Or is there a way to redo the bootloader or clear the EEPROM?


nseidle commented Mar 23, 2012

Unable to recreate. Closing issue. Please re-open if you find a similar problem.

nseidle closed this Mar 23, 2012

I have a similar problem. I made the mistake of powering the board off of 3.3v but "talking" to it with 5v serial. Could that be the cause of the issue?


nseidle commented Feb 18, 2013

Powering the device at 3.3V with 5V serial shouldn't pose a problem.

What firmware are you using? What baud rate is the OpenLog set at and which baud rate is the test sketch running at?

nseidle reopened this Feb 18, 2013

The OpenLog & sketch are set to run at 9600 baud. I have since changed it so that it is powered by 5V.
The OpenLog config contents are:

I am interfacing using Wire.h on pins 2 & 3 on an Uno.

I will try running the same script on another OpenLog which I have verified works with a different Arduino (Pro-Mini 3.3v).


nseidle commented Feb 20, 2013

Hi! Why are you using Wire.h? SoftwareSerial library might be what you mean? Pins 2 and 3 are fine if you are using software serial.

Please fully describe what is going wrong. You power the unit, send serial to it, and when viewing the logs on the SD card what do you see?

I take that back, I am using the SoftwareSerial library with pins 6 & 7. Wire was something else.

When I power the device (12 V off of 8xAA, into the Uno) I see the Openlog give a solid blink with its blue led, followed by a rapid flutter of the blue led. Sometimes I get a few more blue led flutters or spurts, but then it repeats itself with the solid blink followed by a rapid flutter. It looks like the the second yellow led gives a short blink immediately before the solid blue blinks.

I had only the config.txt file inside the 1GB micro sd card before running the test. After about a minute of running the device created 55 text files, most of which contain one line of text:
"12605, 24.3799972534, 39.2803192138, 21701, 2470, 0, 0 0, 0, 0.0 0, 0, 0.0 0.0 "
This is what they should have (ie, data). A few contain gibberish, never more than a line. Some contain nothing.

Thank you for your time.


nseidle commented Feb 20, 2013

The plot thickens. Sounds like OpenLog is doing what it is sort of supposed to. Let's figure out the version of firmware you are running. From a direct terminal connection to openlog hit ctrl+z three times to get the command prompt then the ? command will give you the version # of the firmware your openlog has.

If your system was passing ctrl+z to the unit multiple times it might generate multiple log files, but this is unlikely. I'm leaning towards it being older firmware or a very weird hardware issue. Hardware is usually make or break tho. The unit is working... Sorry for all the hassle! I am happy to swap you a new unit and trouble shoot your unit here at SparkFun if you need it.

I separated the OpenLog from the other components on the board and tested it separately. I used a modified version of OpenLog_CommandTest to get the version number. It gave me 63. (I also happened to notice that you wrote it!)

My current setup is just the Arduino Uno with 5 cables connected to the OpenLog (5V Vcc, GND, RX, TX, Pin 2). I set it up to run OpenLog_Test_Sketch to see if that works. It gave me similar results (ie, corrupted files, files without content, etc), and I ran it on the original sketch, which also gives me the same results as before.

If I could get another OpenLog that would be great. I've used them a few times in the past and haven't had any problems. I do not have another OpenLog now that I can use to compare in place. The other one I have is permanently affixed to a circuit board with an Arduino Pro-Mini.


nseidle commented Apr 9, 2013

You got 63 as the version number? Where did you find that? Normal version numbers would be in the v3.0 to v3.2 currently. You can find it by hitting ctrl+z three times then typing ? at the prompt.

Shoot me an email and we'll see if we can get you a replacement/test unit.


nseidle commented Jul 16, 2013

Closing again. If you still have problems, let us know!

nseidle closed this Jul 16, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment