Error Code 516 No Fix GPS RAK5860 Quectel BG77

Hi all, I am attempting to get this module to do a GPS lock as per the Quectel specs/ documentation but keep getting a 516 error indicating that there is no GPS fix/lock. I have tried the additional lines setting the GPSEnable and PowerKey from this forum link but this has not resolved the issue.

Current RAK setup:
RAK5005
RAK4630/RAK4631 (Labelled as RAK4630) - bought as a kit
RAK5860
Charged 18650 3.7v connected to RAK5005

I have been able to register on a cellular network and ping successfully, now I am trying to get the GPS working.

From the aforementioned link I am also able to see the GPS stats update/ refresh through the NMEA port. If I am interpreting this correctly, I can see multiple satellites (16) but not get a lock.

I am sending at commands via the below script manually to understand them and control the debugging, These are the main commands I am using.
AT+QGPSEND
AT+QGPS
AT+QGPS=1,1
AT+QGPSLOC?
AT+QGPSGNMEA=“GSV”

Pasting the output error here for easy searching:

OK
AT+QGPS
+CME ERROR: 502
AT+QGPSEND
OK
AT+QGPS=1,1
OK
AT+QGPSLOC=?
+QGPSLOC: (0-2)[,(0-3600)]

OK
AT+QGPSLOC?
+CME ERROR: 516
AT+QGPSLOC?
+CME ERROR: 516
AT+QGPSLOC?
+CME ERROR: 516
AT+QGPSLOC?
+CME ERROR: 516
AT+QGPSGNMEA="GSV"
atGPSGNMEA: $GPGSV,3,1,10,01,41,215,00,03,22,242,00,04,19,300,Q$1,,,1NV,3,
OK
at
OK
at
OK
AT+QGPSGNMEA="GSV"
+QGPSGNMEA: $GPGSV,4,1,16,01,41,215,00,03,22,242,00,04,19,30,0GG,,1,Q$11,,SG65,3at
OK
AT+QGPSLOC?
+CME ERROR: 516
AT+QGPSLOC?
+CME ERROR: 516

/**
   @file BG77_Unvarnished_Transmission.ino
   @author rakwireless.com
   @brief BG77 unvarnished transmission via USB
   @version 0.1
   @date 2020-12-28
   @copyright Copyright (c) 2020
**/
#include <Adafruit_TinyUSB.h>


#define BG77_POWER_KEY WB_IO1
#define BG77_GPS_ENABLE 34
#define BG77_POWER_KEY 17


void setup()
{
	time_t serial_timeout = millis();
	Serial.begin(115200);
	while (!Serial)
	{
		if ((millis() - serial_timeout) < 5000)
		{
            delay(100);
        }
        else
        {
            break;
        }
	}
	
	Serial.println("BG77 AT CMD TEST!");
	// Check if the modem is already awake
	time_t timeout = millis();
	bool moduleSleeps = true;
	Serial1.begin(115200);
	delay(1000);
	Serial1.println("ATI");
	//BG77 init
	while ((millis() - timeout) < 6000)
	{
		if (Serial1.available())
		{
			String result = Serial1.readString();
			Serial.println("Modem response after start:");
			Serial.println(result);
			moduleSleeps = false;
		}
	}
	if (moduleSleeps)
	{
		// Module slept, wake it up
		pinMode(BG77_POWER_KEY, OUTPUT);
		digitalWrite(BG77_POWER_KEY, 0);
		delay(1000);
		digitalWrite(BG77_POWER_KEY, 1);
		delay(2000);
		digitalWrite(BG77_POWER_KEY, 0);
		delay(1000);

	}
     pinMode(BG77_GPS_ENABLE, OUTPUT);
    digitalWrite(BG77_GPS_ENABLE, 1);
	Serial.println("BG77 power up!");
}

void loop()
{
	int timeout = 100;
	String resp = "";
	String snd = "";
	char cArr[128] = {0};
	while (timeout--)
	{
		if (Serial1.available() > 0)
		{
			resp += char(Serial1.read());
		}
		if (Serial.available() > 0)
		{
			snd += char(Serial.read());
		}
		delay(1);
	}
	if (resp.length() > 0)
	{
		Serial.print(resp);
	}
	if (snd.length() > 0)
	{
		memset(cArr, 0, 128);
		snd.toCharArray(cArr, snd.length() + 1);
		Serial1.write(cArr);
		delay(10);
	}
	resp = "";
	snd = "";
}

@carlrowan @beegee

Is this something we could continue debugging?

Hello @AnthonyU welcome to the forum.

It looks like you can activate the GPS and get the GPS messages.

Are you testing indoor or outdoor? It is nearly impossible to get a location fix inside a building. At least, try to get the antenna outside.

Is your GPS antenna placed in the right direction? Not sure which antenna is delivered with the RAK5860 (we have no NB-IoT network here, so we cannot really test).
The position of the GPS antenna should be like here:
image
For the small antenna, the double sided tape should look to the sky. For the bigger black antenna the upper cover should look to the sky.

Hi Beegee,

The kit comes with the smaller one, with double sided tape.

So I went in the middle of my yard and had a very large open sky and still count get a lock. This was after about 5 minutes of trying and waiting. Same error, 516 No Fix / No Lock.

Was I reading the previous logs correctly, it could see 16 satellites?
Could you think of any other issues as the problem, perhaps some configuration?
Was there some sample code which is guaranteed to work or is what I have done via the AT commands the best solution?

Kind regards
Anthony

RAK5860 is not working in my country, so I did not do a lot with it.

I just tried this Hologram_Tcp.ino example. It has the GPS functionality and parsing in the code.

Of course I cannot connect LTE (no NB-IoT) here, but it gave me a location. The parsing is wrong, but the numbers are correct:

17:30:12->Send test data to Hologram via TCP!
17:33:03->1425.2841N,12100.4152E
17:33:04->==============================

Should be 14.25 N and 121.00 E.

Hi BeeGee,

Sorry about the delayed reply, I have purchased a hologram SIM, activated it and run through the sketch so that we’re working off the same code.

Still no success with the GPS, could there be a firmware fault with the WWAN module sent from RAK or do you think it could be still a signal strength issue? Surely its not incompatible with my country? Are there staff in APAC?

I have configured this to echo the commands for further debugging “ATE 1”

I have an LTE connection

This is the output from the same point as yours. Still no GPS lock :frowning: hologram did record traffic and is confirming its connected over LTE.

22:32:20.281 -> Send test data to Hologram via TCP!
22:32:39.825 -> AT+QGPS=1,1

22:32:39.825 -> +CME ERROR: 504
22:32:39.825 -> 
22:37:34.716 -> AT+QGPSEND

22:37:34.716 -> OK
22:37:34.716 -> 
22:37:34.716 -> {"k":"UA3xxxxxxxxE","d":,"t":"TOPIC1"}
22:37:37.680 -> 
22:37:40.654 -> 
22:42:41.639 -> Send test data to Hologram via TCP!
22:43:01.189 -> AT+QGPS=1,1

22:43:01.189 -> OK
22:43:01.189 -> 
22:47:56.135 -> AT+QGPSEND

22:47:56.135 -> OK
22:47:56.135 -> 
22:47:56.135 -> {"k":"UA3xxxxxxxxE","d":,"t":"TOPIC1"}
22:47:59.074 -> 
22:48:02.059 -> 


Do you have any further tips to debug this?

I have only one more idea why you cannot get a location (assuming you are still testing outdoors). The only thing that comes up is that the antenna is defect.

Do you have access to another GPS antenna to test?