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 = "";
}