Trying out the sample sketch that reads lines from the GPS and logs them to the SD card. Couldn’t tell from its serial output if it was working in my office, so putting it outside for a bit to make sure it has a chance to receive some real GPS data. (It may have been working anyway, and just not displaying any diagnostic text; we’ll find out.)
OK, there was no data in any of the “GPSLOGxx.TXT” files produced – just empty files. So I still can’t tell if any GPS data was received. Let’s look back at the script. It looks OK.
Ugh. Now looking at the Eagle schematic for the GPS/datalogger shield. It looks like pins 10-13 (not just pin 10) are reserved for use by the SD card interface. So, we couldn’t use pin 11 as the on/off signal after all. We’ll have to go back to pin 0 or 1 (although they didn’t work before) or else use one of the analog pins in digital mode. Where is my chart of the analog pin assignments? Ah, back in the blog on 7/27. Damn, all the analog pins are in use. Guess we’ll have to try digital pins D0 & D1 again…
Great… That didn’t work, and, looking at the Arduino schematic, it seems that those same two pins (D0 & D1) are used for the main serial I/O… Which explains why they didn’t work before.
So basically, there are not enough pins on the Arduino to simultaneously use the LCD, GPS and SD card unless we completely turn off the diagnostic serial interface. That will make things pretty difficult to debug…
I suppose we could just wire the GPS power pin constantly to ground, that way it will be on all the time… Yeah, that’s the ticket. With that done, now initializing the SD card no longer messes up the GPS output. Whew.
Commented in the code to create the file. Great, now the upload is failing. Could be a file-size issue; we’re over 30K. I could try a different bootloader, but first let me see if shrinking the image fixes the problem.
Took out Turf-Tec name/address from file header. Size: 30,328. Still having problem.
Took out custom glyph stuff. Size: 30,068. Still no work.
Took out some other stuff. Now 29,972. Still no luck.
Let’s retry uploading version v0.5. That worked. It is 23,332 bytes.
Took create-file back out, now we’re at 24,948 in v0.6. That uploads, but a bunch of stuff is missing.
Added custom glyphs back in. Now at 25,236 bytes.
Added empty create_file() function. Still at 25,236.
Added a println() in. Now at 25,286.
OK, #if’d out the serial diagnostic code. Now at 24,066.
OK, added create_file() code back in (except for serial stuff) – now 29,056. No fit!
#if’d out serial initialization. Code size now at 28,766. Still no! (At this point, we are no longer using serial I/O at all, so we could go back to using pin 0 or 1 to turn on GPS instead. But, no matter…)
Took out meat of checksum-verification. Now 26,824.
OK, it loads and says the file was created. Let’s check the SD card to make sure.
Yep, it worked; created TURF-T00.CSV with a file header.
Commented out some more stuff. Now 28,256. Still fitting.
OK, added all the SD code in. Now 29,108 bytes. Probably not going to fit now.
Removed some more stuff. Fitting now. Doing an outdoor test.
Great… After fixing a couple of minor output formatting issues, all is good now.
I changed the Discard pushbutton to say “CLEAR” on the screen (instead of “DISC”) and to always reset the last measured Gmax value to 0.
Here is an example output file produced:
DAY,TIME, GMAX VALUE ,LONGITUDE,LATITUDE
Ah, there’s an extra comma at the end of each data line – fixed that.
Note the latitude and longitude are now decimal degrees only (no minutes or seconds), which allows the coordinates to be directly copy-and-pasted from Excel (or notepad) into Google Maps or Google Earth to verify the location.
Last thing I did before bed: Made a video of a demo run.