I recently bought a RedBoard (an Arduino-like board), SAM-M8Q GPS module, and an OpenLog MicroSD module.
I have searched all the Example files for anything that logs GPS data to the MicroSD module, but can only find sketches designed for Artemis systems and not designed for the RedBoard (eg. the size is 117% of its RAM capacity)
I am looking for a way of simply piping the raw NMEA data I can so easily and seamlessly get via the Serial port, onto the SD card. Is that possible?
Have you looked at https://learn.sparkfun.com/tutorials/di … gps-module ? It shows how to connect and access the SAM-M8Q GPS to the REDBOARD.
From there you can use either https://learn.sparkfun.com/tutorials/op … okup-guide (for DEV-13712) or https://learn.sparkfun.com/tutorials/qw … okup-guide (for DEV-15164); to do the connection and code for the OpenLog. If all of your stuff is QWIIC the connections are going to be dead-simple.
I’ve connected all the components as per the instructions, but how do I configure the sketch to send the GPS’s raw NMEA data straight to the SD card?
@FlamminHat - I am not really familiar with the uBlox devices but looking at the SFE libraries for those devices they recommend units with processors bigger than ATmega328. From the brief reading I did logging the raw NMEA data seems like a much taller task than logging the more standard subset for Location (LAT, LON, ALT, TIME).
I would have thought it was a simple task of passing the data straight from the GPS module to the SD card, without any processing. I don’t understand why it would have to be so involved and complicated. It’s the raw data that the GPS module spits out.
I want to make it clear I am not familiar with the SAM-M8Q, but reading through the documentation of it one of the things that makes it very andy is that if you pair it with Artemis it automatically logs (but that is not to say it just magically does it - there is some logic built-in to do that).
Having said that; expanding on the comments above a simple GPS pass-through using the serial interface will look like the code below. You would then replace the hardware serial output interface with the SD card interface (overly simplified explanation/example to be sure).
/*
Example GPS PassThrough
@languer 2023
This example demonstrates basic PassThru of all sentences from GPS
to Hardware Serial
Arduino pin
8 -> Software Serial RX
9 -> Software Serial TX (not used but needs to defined)
3.3V -> VCC
GND -> GND
Board: Arduino/Genuino Uno
Programmer: AVR ISP
*/
/************************* Libraries *********************************/
#include <SoftwareSerial.h>
/************************* Defines *********************************/
#define SerialRX 9
#define SerialTX 8 // TX is not used but needs to be defined as SoftSerial requires the definition
#define SOFT_SERIAL_BAUD 9600
#define HARD_SERIAL_BAUD 57600 // this rate has to be much higher than the GPS rate such that the softSerial buffer is not overloaded
#define VERSION_NO "1.0"
SoftwareSerial mySerial(SerialRX, SerialTX); // RX, TX
/************************* SETUP *********************************/
void setup() {
Serial.begin(HARD_SERIAL_BAUD);
mySerial.begin(SOFT_SERIAL_BAUD);
Serial.print("Simple RS232 GPS Pass-through Example - version "); Serial.println(VERSION_NO);
Serial.println(); Serial.println(); Serial.println();
delay(2500);
}
/************************* MAIN *********************************/
void loop() {
if (mySerial.available()) {
Serial.write(mySerial.read());
}
}
I am getting nothing on the Serial Monitor with this code.
What baud rate do I have to use?
What is the RX and TX pins under the Qwiic system?
The code is for some random gps module I have. The baud rate is on the code (9600 for the GPS-Arduino, and 57600 for the Arduino-PC). I don’t have an SAM-M8Q to check for you. However, the product schematic shows the UART connector. You should connect its TX to the Arduino 9. And hopefully that module auto-negotiates baud rate.