No GPS Data for RAK5010

Issue: No GPS Data

Setup: RAK5010

Details: Using test code from Github

OK

Test end<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Test degin<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

ATI
Quectel
BG96
Revision: BG96MAR02A07M1G

OK

ACC(mg): x=-291.02 y=-4.88 z=874.02
Light=45.80
Pressure(HPa) =1013.24
Temperature =33.96 humidity =63.41

AT+QGPSGNMEA=“GGA”
+QGPSGNMEA: $GPGGA,0,*66

OK

Test end<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

Hi, do you connect the antenna outdoors? Actually, the demo code just run a slow cycle. So you can change the delay time. Search GPS signal costs a little time.

Hi Nero,

i have connected my antenna outdoors. Is there any other AT commands to turn on or configure the GPS module? The demo sketch only includes the following commands for the GPS module

Serial1.write(“AT+QGPS=?\r”);
Serial1.write(“AT+QGPSCFG=“gpsnmeatype”, 1\r”);
Serial1.write(“AT+QGPS=1, 1, 1, 1, 1\r”);
Serial1.write(“AT+QGPSGNMEA=“GGA”\r”);

And the output even in outdoors is

AT+QGPSGNMEA=“GGA”
+QGPSGNMEA: $GPGGA,0,*66

Hello, you can use the following two AT methods to turn on GPS

1.Default arguments are used in this example to turn on GNSS. After turning on GNSS, NMEA sentences
will be output from “usbnmea” port by default; and GNSS can be turned off via AT+QGPSEND.

AT+QGPS=1 //Turn on GNSS.
OK
//After turning on GNSS, NMEA sentences will be output from “usbnmea” port by default.
AT+QGPSLOC? //Obtain positioning information.
+QGPSLOC: 061951.0,3150.7223N,11711.9293E,0.7,62.2,2,0.0,0.0,0.0,110513,09
OK
AT+QGPSEND //Turn off GNSS.
OK

2.When GNSS is turned on and is enabled, NMEA sentences can be acquired directly via
AT+QGPSGNMEA

AT+QGPSCFG=“nmeasrc”,1 //Enable functionality.
OK
AT+QGPSGNMEA=“GGA” //Obtain GGA sentence.
+QGPSGNMEA: $GPGGA,103647.0,3150.721154,N,11711.925873,E,1,02,4.7,59.8,M,-2.0,M,*77
OK
AT+QGPSCFG=“nmeasrc”,0 //Disable functionality.
OK
AT+QGPSGNMEA=“GGA” //Disable functionality, and thus GGA sentence
cannot be obtained.
+CME ERROR: 507

Hi Zhangtao,

I noticed that the demo sketch set digitalWrite(bg96_GPS_EN,0); After setting to digitalWrite(bg96_GPS_EN,1); I was able to get some form of GGA data, but the data is not complete or wrong.

AT+QGPSGNMEA=“GGA”
+QGPSGNMEA: $GPGGA,091857.00,0126.610308,N4K

Hello, the GPS data you have obtained is raw data and cannot be used directly. It must be converted into commonly used latitude and longitude data through some algorithms.
The length of the GPS data you obtained is not enough. The buffer may be too small. You try to modify the buffer to obtain the data again. The correct data length should be similar to (Global Positioning System Fix Data, Time, Position and related fix data)
+QGPSGNMEA: $GPGGA,032026.0,3150.792650,N,11711.929445,E,1,05,1.4,63.2,M,-2.0,M,*79

We currently do not do data conversion on Arduino, you can try this method
Proceed as follows:

  1. N (north latitude) 2238.5260
    (1) 2238.5260÷100=22.385260 (rounded) =22
    (2) 385260÷60=6421
    Get the latitude coordinate in degrees as N 22.642100°
  2. E (East longitude) 11401.9686
    (1) 11401.9686÷100=114.019686 (rounded) =114
    (2) 019686÷60=0328.1

Good luck!

Supplement longitude results:
Obtain the longitude coordinate in degrees as E 114.032810°

Hi Zhangtao,

Was able to get it resolved by setting the buffer to 128. Thanks !!!
However, I did find that the GPS fix was not stable (will have some instances of no fix). Could it be that an external battery is needed?

And thanks for the info on how to retrieve the lat and long, looks like now I will have to do some string manipulation.

Hi, try to use an external battery, which is more stable than USB power supply.

Hi,

Thanks. I was able to get the GPS data in the right format. However when i only use external battery, I dont seem to get any GPS signal (i send to IOTdashboard, so i will know if gps data is received). Face this problem when board is switched from laptop with external battery to only external baterry and also if it works when go to external battery only (very rare), once i go indoors, and back outdoors, the signal is lost again and no GPS data is sent to my cloud.

Can I view the serial log using BT on my phone? Will be more easier to check whats the issue when board is only with the external battery. Appreciate for the advance help.

hi, according to your description, I probably understand it.

  1. External battery power supply at least ensure that the battery voltage is greater than 3.6BV.
  2. According to the current code, the log cannot be viewed on the mobile phone. If you want to view it, you need to add the Bluetooth code on the 52840 to view the log on the mobile phone.
  3. According to your description of the GPS problem, I just tried it. After configuring an AT that sends data at intervals of 180 seconds outdoors, I collected 2 sets of data outdoors. The GPS data found on my cloud is Valid, the value on the right, and then I took the module into the room and waited for a few minutes, and checked the collected data on my cloud. The GPS data was 0. There should be no GPS signal indoors, and then I got the module again. Outdoors, I waited for a few minutes and checked the collected data on the cloud. The GPS data has numerical values, and it is valid GPS data available. During the whole process from outdoor to outdoor, then to outdoor, the module has not been powered off. Below is the data record on the cloud

Hope to make progress for you

Hi Zhangtao,

Thanks. Yes I have also tried your method 3 and it works, but I had my laptop connected all the time (to see the serial log). However when I wanted to travel out (exit my home) with the RAK5010 without the laptop, I could see no GPS data sent to my cloud (which also makes me unsure what is happening as serial log cant be seen).

So for this case, are you able to send me any samples or guide on how to do step 2 which might be helpful for me to see whats happening when RAK5010 is on stand alone (with BLE) using my phone?

Regards
Raj

Hello, you first choose your own board, and then follow the steps in the figure below to find examples

Hi Zhangtao,

Thanks for the help. I managed to connect my phone (using Adafruit app) to see the serial monitor over BLE. This was what i saw

  1. Upload program via usb cable and connect over BLE (able to see firmware running)
  2. When remove usb cable to goto stand alone mode, both red and blue LED turn off (indicate power off). Take note external battery still connected
  3. When turning on the module (now using external battery), there is no log captured on the app. (This could be the issue)
  4. To check again, connect USB to the laptop again. Module powers off as mentioned in step 2. This time when turn on the module, the firmware starts running, and the log seen in the app.

Is there any possible reason why the log is not captured over BLE when the module powers off and restart again (BLE pairing is done) or the firmware doesnt restart after power on? And what is the function of the reset switch? The firmware doesn’t seem to restart when this switch is pressed. At times it turns off the module.

Hello, I’m really sorry, we only provided the most basic code, and we did not implement the function you want to do.
If you want to implement this function yourself, it is recommended that you go to the Adafruit forum to find the corresponding answer or help.
Sorry, I could not help you.

Hi Zhengtao,

You might have misunderstood. BLE is no issue now. The problem is any firmware i program in doesnt auto restart when i power on the module. Even reset button doesnt work.

I think your answer and fix is in this topic:

1 Like

Hello Zhengtao,

@JeroenKl is correct. The problem is that the current examples wait forever for Serial connection and will hang when no computer is connected on USB.

We are at the moment re-working all examples. The solution (as Jeroen mentioned) is to replace

Serial.begin(115200);
while (!Serial) { delay(10); }

with

// Initialize Serial for debug output 
Serial.begin(115200); 
time_t timeout = millis(); 
while (!Serial) {
   if ((millis() - timeout) < 5000) 
   { 
      delay(100); 
   } 
   else 
   { 
      break; 
   } 
}
1 Like

Hi JeroenKI and beegee, yes that was the issue. Now my RAK can be on standalone mode. Thanks alot. !!!

1 Like

Hi Guys,

I do have an issue when i start to do trials. Get GPS data and publish to UDP/MQTT server and cloud respectively. When I publish each and every data (loop count of 5s), there is no issue. However when i wait for the 30th data to publish (every 5mins), there is no issue after 2 cycles, but on the 3rd cycle (15min), RAK powers off (both LED turn off). And the board hangs (no gps data). Even after power cycle and rest, there is still no gps data.

I can only recover the board (get gps data) by re inserting the battery and even at times reconnecting the GPS antenna. The board is just seating at same position from cycle1 to cycle 3.

There is no issue with the network.