I have the GPS NEO-M9N connected to a readboard via qwiic. The Get_Position example works after some tweaking.
FYI: the LTE shield library used unsigned variables for location data, so it wrapped my location data around to an invalid coordinate. It also didn’t handle negative values at all. I needed to put an if statement to determine if either value was positive or negative, since it always returned one degree off.
I’m using the SparkFun Ublox library, since the LTE library crashes the modem and disconnects it when I try to use the gps functions. I am not able to fix this, and have a qwiic enabled redboard to use.
The NMEAParsing example doesn’t output anything. It never gets a fix, even though the Get_Position example gets a fix right away. I waited 5 minutes for it to start working, but no luck. The Get_Location example outputs the correct coordinates very accurately, but without decimal places. I have tried going outside, putting the antenna by a window over night to get a good fix while running the Get_Position example.
I need to extract the coordinate data in order to put it into a google maps url string. I can’t assume that the degrees for longitude will always have 3 place values, so I can’t just divide the result by a fixed value to get a decimal format. I can get through the NMEA data myself, but it will not show up in the serial monitor. If I can’t get the NMEAParsing example to work, I just want the entire NMEA sentence to print to a string somewhere so I can parse it myself. I need it to return over I2C for this project, not UART like the other examples need.
Can you provide some of the data readouts from Get_Location?
Thank you for your reply, I dove right into the library and figured out what some functions do.
I needed to use the EnableNMEA example and change everything that says UART to I2C. I was too worried about bricking the module to try messing with saved profiles until I understood what I was changing.
myGPS.disableNMEAMessage(UBX_NMEA_GLL, COM_PORT_I2C); //Several of these are on by default on virgin ublox board so let's disable them
myGPS.disableNMEAMessage(UBX_NMEA_GSA, COM_PORT_I2C);
myGPS.disableNMEAMessage(UBX_NMEA_GSV, COM_PORT_I2C);
myGPS.disableNMEAMessage(UBX_NMEA_RMC, COM_PORT_I2C);
myGPS.enableNMEAMessage(UBX_NMEA_GGA, COM_PORT_I2C); //Only leaving GGA/VTG enabled at current navigation rate
myGPS.enableNMEAMessage(UBX_NMEA_VTG, COM_PORT_I2C);
//Here's the advanced configure method
//Some of the other examples in this library enable the PVT message so let's disable it
myGPS.configureMessage(UBX_CLASS_NAV, UBX_NAV_PVT, COM_PORT_I2C, 0); //Message Class, ID, and port we want to configure, sendRate of 0 (disable).
myGPS.setI2COutput(COM_TYPE_NMEA);
myGPS.setSerialRate(9600);
myGPS.saveConfiguration(); //Save these settings to NVM
After running this, the NMEAParsing example worked.
I wouldn’t say understanding this would be beginner level, maybe the example sketch could be made to define how to output the data more easily? That is a project for another day, but I think I2C is more desireable with the new qwiic ecosystem.
Again, thanks for getting back to me, I asked for help too early.
No worries, sometimes you just need to shout in the void to idea bounce. It can be really helpful. Also, your question and solution will help the community as a whole. So thank you, I’m glad you got it figured out!