SD writing with an Artemis Openlog?

Hi all,

I have an Artemis Openlog which I’ve interfaced to a NEO-M9N GPS board via QWIIC. I can read the info from the NEO-M9N and display it on my PC screen in a serial monitor after fudging the I2C pinouts. I’m now trying to write that data to the SD card on the Openlog board.

First I tried some of the SD examples but I didn’t get them to work as the SPI pinouts are different on the Openlog board and I was getting errors about MISO and MOSI etc not being defined. I didn’t think I would have to modify library files to assign pinouts - I thought the thing about Arduino was that the legwork has been done and now you just write code and marvel at your success…

I tried the Artemis Openlog example from Github:

https://github.com/sparkfun/OpenLog_Art … Serial.ino

If gave lots of compile errors and won’t even complie. I’ve also tried some of the examples here:

OpenLog_Artemis/Firmware/OpenLog_Artemis/

But still get lots of compile errors.

I’ve written plenty of code before but I’m new to Arduino and especially new to SD writing so I’m at a loss how to make it work. The libraries seem to be a jungle. Has anyone had any success writing to an SD card with the Artemis Openlog? What I want to do is quite simple: press a button on the Openlog board and log the data coming off the GPS board then stop logging on a second press of the button. I can do the rest but the SD stuff has me beat.

Would I be better off getting the older, simpler Qwiic Openlog?

Thanks in advance!

I added an example for you here:

https://github.com/sparkfun/OpenLog_Art … leTest.ino

Gotchas to watch out for:

  • Select SparkFun RedBoard Artemis ATP from the boards list

  • The example shows how to power up the SD card from microSDPowerOn() helper function

  • You’ll need to install Bill Greiman’s SD library: https://github.com/greiman/SdFat-beta to get the example to compile. (Arduino’s built-in SD library is pretty terrible)

  • Any SD card formatted to FAT16 should work. Keep it under 32GB. OLA supports larger cards but let’s no go there for now.

Thanks for that. I downloaded the SDFat_Beta library and deleted the SDFat library I had installed before (ie the non Beta). When I went to the library manager it showed the original SDFat library versions but not the SDFat_Beta version 2.0. Is that odd? I have checked and the original SDFat library files etc are all gone, so I don’t understand why it’s not reading the library.properties file and showing version 2 Beta.

Unfortunately I got compile errors:

Arduino: 1.8.12 (Windows 10), Board: “SparkFun RedBoard Artemis ATP, 921600, SparkFun Variable Loader (Recommended)”

C:\Users\stumax\Documents\Arduino\BasicFileTest.ino\BasicFileTest.ino.ino: In function ‘void setup()’:

BasicFileTest.ino:33:3: error: ‘beginSD’ was not declared in this scope

beginSD();

^~~~~~~

BasicFileTest.ino:35:3: error: ‘beginDataLogging’ was not declared in this scope

beginDataLogging();

^~~~~~~~~~~~~~~~

exit status 1

‘beginSD’ was not declared in this scope

This report would have more information with

“Show verbose output during compilation”

option enabled in File → Preferences.

OK, had to make a few small changes to get it to compile but it does now. I also managed to compile & run some of the examples.

Are there any simpler examples of how to just create a file on the SD card and write to it? All of the examples in the SD-FAT_Beta library seem a bit over the top for what I want to do - or perhaps I’m hoping it’s a lot simpler than it really is?