Go Down

Topic: Connecting Ublox GPS CAM-M8Q to Arduino Uno (Read 351 times) previous topic - next topic

elvijsvilkels

Good day,
I'm writing my bachelor thesis and i'm building a node where I use Ublox GPS module CAM-M8Q.

Using Arduino Uno I've connected following pins to the module:

Pin Layout going through 5 v - 3.3 v level shifter:
GPS  -   Arduino
Vcc - 3.3v
GND - GND
TX - 8 Digital Pin
RX - 9 Digital Pin



Everything seems to be connected properly after checking with Multimeter.

What have I done so far?

I've run multiple programs including NeoGPS NMEA.ini with AltSoftSerial, but that gave me no good results. Then I ran TinyGPS++ DeviceExample.ini and that showed something, but nothing I could work with.
Screenshot:


Then I thought maybe no data is comming from the module, but this softwareSerial code :

Code: [Select]

#include <SoftwareSerial.h>

static const int RXPin = 9, TXPin = 8;
static const uint32_t GPSBaud = 9600;

// The serial connection to the GPS device
SoftwareSerial ss(RXPin, TXPin);

void setup()
{
  Serial.begin(115200);
  ss.begin(GPSBaud);
}

void loop()
{
  // Output raw GPS data to the serial monitor
  while (ss.available() > 0){
    Serial.write(ss.read());
  }
}

returned me this output to Serial Console:



Maybe it's just fake gibberish, but it looks like it could be transformed to correct NMEA format to get needed data.

So my main problem would be getting valuable information from the module, like GPS coordinates. I've read that the module should be configured by sending information to it as:
Code: [Select]
  gps.send_P(gpsPort, F("$PUBX,41,1,2,2,9600,0") );

I've browsed various forum topics and other google resources to find some legit answers and some advices, but I've been stuck for 3 days now.
I'd appreciate if someone could give me advice on how to configure and get my GPS module working with Arduino.
Thank you!
 

pylon

Code: [Select]
static const int RXPin = 9, TXPin = 8;


AltSoftSerial expects the pin usage to be the other way around: 8->RXPin, 9->TXPin. That may explain why it didn't work for you with that solution.


-dev

Quote from: elvijsvilkels
I've run multiple programs including NeoGPS NMEA.ini with AltSoftSerial, but that gave me no good results.
For those connections, the default GPSport.h will choose the correct port: AltSoftSerial on pin 8 (RX, to GPS TX) and 9 (TX, to GPS RX).  That is what you described:

GPS     Arduino
Vcc  - 3.3v
GND  - GND
TX  - 8 is AltSoftSerial RX pin
RX  - 9 is AltSoftSerial TX pin
Please explain what you mean by "no good results".

When you upload and run the program,

*  Select the output text in the Serial Monitor window with your mouse (left click, drag, left release, *OR* left click anywhere then control-A).

*  Copy the text (control-C)

*  Go to your browser and click in the "Quick Reply" field at the bottom of this page

*  Paste the text (control-V).  You should see the Serial Monitor output text in the field.

*  Be sure to put the text in code tags, just like you did for your example sketch.

There are other sketches you should try:

1)  NMEAdiagnostic.ino - this sketch will try various baud rates and display what data it is receiving.  If it successfully receives NMEA data, it will tell you the correct baud rate.

If it does not find a baud rate that works, select *all* the program output in the Serial Monitor window, and paste it into your reply for us to see.

This is described on the Troubleshooting page.

2)  A simple echo sketch:

Code: [Select]
#include <AltSoftSerial.h>
AltSoftSerial gpsPort;

void setup()
{
  Serial.begin( 9600 );
  gpsPort.begin( 9600 );

  Serial.println( F("Echo test") );
}

void loop()
{
  if (gpsPort.available())
    Serial.write( gpsPort.read() );

  if (Serial.available())
    gpsPort.write( Serial.read() );
}

If the connections are correct and the baud rate is correct, you should see NMEA data like "$GNRMC", etc.

BTW,

Quote from: elvijsvilkels
returned me this output to Serial Console:
...there is no output.

Cheers,
/dev
Really, I used to be /dev.  :(

srnet

#3
Apr 27, 2018, 07:25 pm Last Edit: Apr 27, 2018, 07:36 pm by srnet
Maybe it's just fake gibberish, but it looks like it could be transformed to correct NMEA format to get needed data.
Be sure you are using a relativly recent TinyGPS++ library as this supports the default GLONASS mode of the Ublox8 GPS which produces the $GNGGA style sentences you can see.

However your not going to get any GPS co-ordinates until the GPS has a fix, which the printout clearly shows is not happening, there are no satellites in view for instance.

The GPS needs to be outside with an aerial connected and a good view of the sky to get a fix, which can take a couple of minutes, when it gets a fix, you will get meaningful data from it.




$50SAT is now Silent (but probably still running)
http://www.50dollarsat.info/
http://www.loratracker.uk/

srnet

#4
Apr 27, 2018, 09:08 pm Last Edit: Apr 27, 2018, 09:08 pm by srnet
Quote
So my main problem would be getting valuable information from the module, like GPS coordinates. I've read that the module should be configured by sending information to it as:
Code: [Select]

  gps.send_P(gpsPort, F("$PUBX,41,1,2,2,9600,0") );
The only compelling reason I can think of for configuring a Ublox GPS when your using the recent TinyGPS++ library is if you want the GPS to work above 18,000M, otherwise no chages to TinyGPS++ or configuration of the GPS is needed.
$50SAT is now Silent (but probably still running)
http://www.50dollarsat.info/
http://www.loratracker.uk/

-dev

Quote from: srnet
The only compelling reason I can think of for configuring a Ublox GPS when your using the recent TinyGPS++ library is if you want the GPS to work above 18,000M, otherwise no chages to TinyGPS++ or configuration of the GPS is needed.
Nonsense.

The PUBX,41 command is used to set the baud rate, among other things. You would change that for any number of reasons.  Increasing processor sleep time in a battery-powered system is one reason.  You can decrease the UART receive time (i.e., awake time) with a higher baud rate.

The PUBX,40 command enables/disables sentences you want to be sent during each update interval.  For example, you should disable the sentences that are not needed by your application.  Unless you write custom code in your sketch, TinyGPS++ will only parse GGA and RMC sentences.  ublox devices also send GSA, GSV, VTG and ZDA, so you should disable those.

There are UBX binary commands that could be used to configure other items.  Forcing the Talker ID to GP and setting update rate above 1Hz are popular.

All of these things have nothing to do with altitude.

Quote
Be sure you are using a relativly recent TinyGPS++ library as this supports the default GLONASS mode of the Ublox8 GPS
No, the GNRMC sentence means that multiple GNSS's (Global Navigation Satellite Systems) were used to produce the fix information.  If GPS (US) and Beidou satellites were used to calculate the fix information, it would be reported in a GNRMC sentence.

TinyGPS++ will not parse sentences for GLONASS (Russian, sent as GLRMC) nor Beidou (Chinese, sent as GBRMC).  TinyGPS and Adafruit_GPS will only parse the GPS (US) sentences GPRMC and GPGGA.  NeoGPS parses all of them, without modification.

Really, I used to be /dev.  :(

Go Up