-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for LS20031 GPS module. #5718
Conversation
Thanks for this! We'll merge this first, but there's a follow-up step to add code to the setup function - turn off unneeded NMEA messages etc. |
Actually, PMTK314 is PMTK_API_SET_NMEA_OUTPUT? If so, is that the most appropriate as a detection command? |
Probable source of all relevant commands: http://www.adafruit.com/datasheets/PMTK%20command%20packet-Complete-C39-A01.pdf |
The reason I picked it is because it is the command to reset the NEMA output to factory defaults. In the datasheet I linked, it specifies the response we should get,
Seems to! Updated commit incoming... |
7b53b1e
to
3608928
Compare
Thanks @alexmarkley I apologise the gps.cpp file is so long; here's why I asked for that change: In the probe function ( GnssModel_t GPS::probe(int serialSpeed) ) we're just concerned with determining which specific chip we have. If you read up from line 1193, you'll see we're issuing all sorts of software/hardware version commands to try and get a response the tells us which specific chip we're talking to. Then, in the setup function (bool GPS::setup()), you'll see a whole bunch of lines where we branch on the detected model (eg GNSS_MODEL_MTK). Inside those branches we issue commands to configure the GPS. Since you're working on a Raspberry Pi, you have a lot of resources to play with so switching on everything works. On many other devices there isn't enough capacity to handle the full stream of all NMEA messages. So, in the setup function we disable all but RMC and GGA, as well as performing configuration like enabling constellations. So, where to from here? 1. Explicit Detect String Looking at the docs for the PM705 response, it looks like after the ReleaseStr and Build_ID is the Product Model (QUECTEL-76 in this case):
NB: Just in case you haven't tried already , #define GPS_DEBUG 1 in your variant.h will print out all of the messages going between the Pi and the GPS. 2. Add Setup Commands It has a slightly different PMTK314 command to the one you used before as well as some other useful commands that will improve the performance of your chip if it works :) If, comparing the documentation and the responses obtained from the GPS running the setup code, everything looks like it works same as GNSS_MODEL_MTK_L76B, then maybe we can just treat the LS20031 as a GNSS_MODEL_MTK_L76B. If it's different, then we add the relevant commands in the setup function for the LS20031. If, of course, you're busy or not really interested in this work, let us know and we'll run with your already excellent start :) |
I can confirm the full response I get back from I'd like to avoid matching on the firmware version details, which is why I put the first part of the string in there. But as you expected the device reports a product model at the end. So to confirm @fifieldt you'd prefer to look for
Based on your explanation, I understand why there is so much hardware-specific code in here! Unfortunately I'm starting a new job on Monday (and trying to get some things done around the house before that) so my time to work on this is pretty limited right now. I'm happy to help with testing patches if that would be beneficial. I'm also happy to test the setup code block for GNSS_MODEL_MTK_L76B on this device, but I would need guidance on how to validate if the commands issued in the setup block had the desired effect. |
3608928
to
bd70045
Compare
Confirmed the GPS module works if we probe for |
bd70045
to
7a6735c
Compare
Excellent, thanks @alexmarkley . Let's merge this and I'll try something for the setup code and send to you for testing :) Congratulations on your first patch! |
Adds support for the LOCOSYS LS20031 66-Channel GPS Receiver Module. Confirmed working via
linux-native
on a Raspberry Pi.Datasheet: https://cdn.sparkfun.com/datasheets/GPS/LS20030~3_datasheet_v1.3.pdf