I2C GPS Module SAM-M8Q

Hello, I am using an AFF R412M and having trouble to parse relevant data out of the GPS module (SAM-M8Q). The example code is way too difficult for me to understand and not able to expand it for Altitude etc. The example code gives only Lat / Lon, the other options for this nice module are not available. I use a lib from Sparkfun to parse successfully, but the board freezes while communicating over the radio with no error’s.

I hope that someone can help me out finding a useful library for parsing the data (Altitude, Groundspeed, fixType, Number of satellites etc). I Hope for help, with only Lat Lon the board is more or less useless for me.

Kind regards, Henk

Hi Henk,

Did you test our library with example sketch?

You can download our library via GitHub or the Arduino Library manager.
SodaqMoja/Sodaq_UBlox_GPS: An Arduino library for the UBlox GPS EVA7M (github.com)

The example can be loaded from Arduino: File → Examples

Best regards,
Jan

Hello Jan,

Thanks for the fast response. The first test with the EVA7M lib example code is successful, I will now integrate it with the rest of the sketch and will update you. Your lib parses enough information for my needs at this moment. It still would be nice to have an M8Q library that could make full benefit off all the capabilities of this module.

Before this post I worked with SparkFun_u-blox_GNSS_Arduino_Library.h // to get the library: http://librarymanager/All#SparkFun_Ublox_GPS. It is also able to parse all the desired info but doesn’t work together with the rest of my sketch (GPS tracker code for R412M KPN M2M Sim).

As I promissed, I will keep you updated.
Kind regards, Henk

Hi Henk,

The Sodaq_UBlox_GPS is for the EVA7M, EVA8M, M8M and M8Q.
I made a note to make this a bit more clear.

What kind of info would you like to see parsed by the sodaq library?

Best regards,
Jan

Hi Jan,

I tested the Sodaq_UBlox_GPS lib with some good results. I am able to parse relevant data, but with very bad accuracy (see the mapper.png file for 1 static position) In the grafana.png file, you can see the jumping altitudes. The module was only able to see 5 sats with an HDOP op >>1, maybe that explains the inaccuracy. The GPS antenna however had a clear view to open sky. A comparison with the original example code showed that much better accuracy is posible.

To make use of the Sodaq_UBlox_GPS lib I had to disable the Sodaq_LSM303AGR.h and companying functionality! Having them both active causes the freeze while trying to use the radio.

What I would like to see out of the GPS module is Lat, Lon, Alt (Height above sea level), Groundspeed, fixType (0,1,2,3), Number of sats, HDOP.

I hope you can help me out. Currently, I returned to the first example sketch with only Lat Lon (which I added with temp C and Batt Voltage. It is my goal to build a life tracker for life-saving purposes in rural terrain. For that reason, I need more than Lat Lon only and with a good accuracy.

Best Reagds, Henk

Hi Henk,

The default accuracy of the M8Q is 100m
You can have a look with on how to change the M8Q accuracy.
Be aware that with higher accuracy you will have a higher power consumption.

Best regards,
Jan

Hi Jan,

Ok, didn’t know about the default accuracy of 100m. I should have a look at it before, my fault.
Question: Can you point me to a solution using the Sodaq_UBlox_GPS library with increased accuracy? Note: Higher power consumption is not a big issue for me.

Yesterday I did a test run with the GPS example code from the ThingsML library as suggested on the KPN support pages. This example gives only Lat, Lon but with much better accuracy as you can see in the screenshot (always on the road, so << 100m).

Best Regards,


Henk

Hi Henk,

For better performance please look into the UBX-CFG-PMS register.

You can find this on page 243.

What you probably is option “0x03 = Aggressive with 1 Hz”, but if you really don’t care about power consumption you could just set “0x00 = Full power”. But I’d not recommend this, I doubt you’ll see a difference.

Here’s a prepped version.


uint8_t buffer[] = 
{
	0xB5, 0x62, 0x06, 0x86, 0x08, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x97, 0x6F
}

Wire.beginTransmission(0x42);
Wire.write(buffer, sizeof(buffer));
Wire.endTransmission();

Where 0xB5 0x62 is the header, 0x06 is the class, 0x86 is the ID, 0x08 0x00 is the length, 0x00 0x03 0x00, 0x00 0x00 0x00 0x00 0x00 is the payload and 0x97 0x6F is the checksum.

If you want to do this a bit nicer, look at the ublox code we have for the universal tracker here.

Then you just need to call

uint8_t buffer[] = 
{
	0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
}
UBlox::send(buffer, sizeof(buffer));

Hope this helps.

Thom

Hi Tom,

Thanks for the tips, I tried the 1e prepped version. I didn’t notice any change in accuracy, nor I did in power consumption. I embedded your suggested code snippet in the setup() and hope that’s correct. If not I guess you will tell me :slight_smile:

The uBlox document also shows the option to switch between the so-called Dynamic Platform Model. What I found is that default the GPS starts in portable mode with medium position deviation. For a pedestrian one could go for a small deviation, that looks promising (at least for my application). I tried to change the config of the module by using the Sodaq GPS Example sketch & u-Centre SW to try to change and save the default config. That didn’t work, unfortunately. I refer to this doc on pages 22 and 217/218 of:

So I have two questions for you:

  • Was it correct to place the 1e prepped code snippet in the setup function of my sketch (after enabling GPS etc) or do I need that snippet before every GPS use?

  • How can I change the UBX-CFG-NAV5 the platform model from portable to pedestrian. I hope with an easy-to-implement snippet like you presented for the PMS register.

Kind regards, Henk

Hi Henk,

We do it every time the GPS is turned on, but I suppose this may not be necessary.

I assume you’d need something like this.

uint8_t buffer[36] = { 0 };
buffer[1] = 0x01;
buffer[2] = 0x03;
UBlox::send(buffer, sizeof(buffer));

But I will note that I haven’t tested it.

Regards,
Thom