RAK3712 UART1 + GNSS/GPS not working

Hi RAK and everyone,

I’ve just bought a RAK3272S (x2) and I’m trying to get GPS readings to send P2P. I’ve hooked it up to Teensy and tested the code and GPS and it’s getting the right values? When I hook it up to the RAK to the GPS via the UART1 line though, I’m not getting valid readings?

I updated the firmware to RAK3272S V4.0.5.
I’ve tried different BAUD rates 4800/9600/115200 (the GPS guide for the Foxeer M10Q 120 said 115200).
I have the TX of the GPS hooked up to UART1_RX and I have the RX of the GPS hooked up to UART1_TX (but I’ve tried switching them just in case, and no luck).
UART2_RX and UART2_TX are connected to a USB and is working great.
I can see the GPS has a lock and is flashing. The serial values are all asterisks though, so not valid using UART1 on RAK.

Any advice would be really appreciated! I just want to send latitude, longitude and altitude between the two modules.

This is the example code I am trying:

#include <TinyGPSPlus.h>

// The TinyGPSPlus object
TinyGPSPlus gps;

// The serial connection to the GPS device
void setup() {
	Serial.begin(115200);
	Serial1.begin(115200);
  delay(5000);
}

void loop() {
	printInt(gps.satellites.value(), gps.satellites.isValid(), 5);
	printFloat(gps.location.lat(), gps.location.isValid(), 11, 6);
	printFloat(gps.location.lng(), gps.location.isValid(), 12, 6);
	printFloat(gps.altitude.meters(), gps.altitude.isValid(), 7, 2);
	printInt(gps.charsProcessed(), true, 6);
	printInt(gps.sentencesWithFix(), true, 10);
	printInt(gps.failedChecksum(), true, 9);
	Serial.println();
	smartDelay(1000);
	if (millis() > 5000 && gps.charsProcessed() < 10) {
		Serial.println(F("No GPS data received: check wiring"));
	}
}

// This custom version of delay() ensures that the gps object
// is being "fed".
static void smartDelay(unsigned long ms) {
	unsigned long start = millis();
	do {
		while (Serial1.available()) {
			gps.encode(Serial1.read());
		}
	} while (millis() - start < ms);
}

static void printFloat(float val, bool valid, int len, int prec) {
	if (!valid) {
		while (len-- > 1) {
			Serial.print('*');
		}
		Serial.print(' ');
	} else {
		Serial.print(val, prec);
		int vi = abs((int)val);
		int flen = prec + (val < 0.0 ? 2 : 1); // . and -
		flen += vi >= 1000 ? 4 : vi >= 100 ? 3 : vi >= 10 ? 2 : 1;
		for (int i=flen; i<len; ++i) {
			Serial.print(' ');
		}
	}
	smartDelay(0);
}

static void printInt(unsigned long val, bool valid, int len) {
	char sz[32] = "*****************";
	if (valid) {
		sprintf(sz, "%ld", val);
	}
	sz[len] = 0;
	for (int i=strlen(sz); i<len; ++i) {
		sz[i] = ' ';
	}
	if (len > 0) {
		sz[len-1] = ' ';
	}
	Serial.print(sz);
	smartDelay(0);
}


static void printStr(const char *str, int len) {
	int slen = strlen(str);
	for (int i=0; i<len; ++i) {
		Serial.print(i<slen ? str[i] : ' ');
	}
	smartDelay(0);
}

Welcome to the forum @roboticsmick

I tried your code with our RAK1910 and RAK12500 GNSS modules on a WisBlock Base Board, and I am getting the same result.
Then I used our very simple example code from our WisBlock repo and I am getting data from the GNSS chips (uBlox MAX-7Q and uBlox ZOE-M8Q).

RAK3172-RAK1910.ino (2.5 KB)

Could be a problem with the library having compatibility problems with RUI3.