|
| 1 | +SparkFun Ublox Arduino Library |
| 2 | +=========================================================== |
| 3 | + |
| 4 | +<table class="table table-hover table-striped table-bordered"> |
| 5 | + <tr align="center"> |
| 6 | + <td><a href="https://www.sparkfun.com/products/15136"><img src="https://cdn.sparkfun.com//assets/parts/1/3/5/1/4/15136-SparkFun_GPS-RTK2_Board_-_ZED-F9P__Qwiic_-03.jpg"></a></td> |
| 7 | + <td><a href="https://www.sparkfun.com/products/15005"><img src="https://cdn.sparkfun.com//assets/parts/1/3/3/2/0/15005-SparkFun_GPS-RTK__Qwiic__-_NEO-M8P-2-00.jpg"></a></td> |
| 8 | + <td><a href="https://www.sparkfun.com/products/15193"><img src="https://cdn.sparkfun.com//assets/parts/1/3/6/1/4/15193-SparkFun_GPS_Breakout_-_U.FL__ZOE-M8__Qwiic_-01.jpg"></a></td> |
| 9 | + <td><a href="https://www.sparkfun.com/products/15210"><img src="https://cdn.sparkfun.com//assets/parts/1/3/6/4/8/15210-SparkFun_GPS_Breakout_-_Chip_Antenna__SAM-M8Q__Qwiic_-01.jpg"></a></td> |
| 10 | + </tr> |
| 11 | + <tr align="center"> |
| 12 | + <td><a href="https://www.sparkfun.com/products/15136">SparkFun GPS-RTK2 - ZED-F9P (GPS-15136)</a></td> |
| 13 | + <td><a href="https://www.sparkfun.com/products/15005">SparkFun GPS-RTK - NEO-M8P-2 (GPS-15005)</a></td> |
| 14 | + <td><a href="https://www.sparkfun.com/products/15193">SparkFun ZOE-M8Q Breakout (GPS-15193)</a></td> |
| 15 | + <td><a href="https://www.sparkfun.com/products/15210">SparkFun SAM-M8Q Breakout (GPS-15210)</a></td> |
| 16 | + </tr> |
| 17 | +</table> |
| 18 | + |
| 19 | +Ublox makes some incredible GPS receivers covering everything from low-cost, highly configurable modules such as the SAM-M8Q all the way up to the surveyor grade ZED-F9P with precision of the diameter of a dime. This library focuses on configuration and control of Ublox devices over I2C (called DDC by Ublox) and Serial. The UBX protocol is supported over both I2C and serial, and is a much easier and lighterweight interface to a GPS module. Stop parsing NMEA data! And simply ask for the datums you need. |
| 20 | + |
| 21 | +This library can be installed via the Arduino Library manager. Search for **SparkFun Ublox**. |
| 22 | + |
| 23 | +Want to help? Please do! We are always looking for ways to improve and build out features of this library. |
| 24 | + |
| 25 | +Thanks to: |
| 26 | + |
| 27 | +* We are always interested in adding SPI support with a checkUbloxSPI() function |
| 28 | +* [trycoon](https://github.com/sparkfun/SparkFun_Ublox_Arduino_Library/pull/7) for fixing the lack of I2C buffer length defines |
| 29 | +* [tve](https://github.com/tve) for building out serial additions and examples |
| 30 | +* [Redstoned](https://github.com/Redstoned) and [davidallenmann](https://github.com/davidallenmann) for adding PVT date and time |
| 31 | + |
| 32 | +Need a library for the Ublox and Particle? Checkout the [Particle library](https://github.com/aseelye/SparkFun_Ublox_Particle_Library) fork. |
| 33 | + |
| 34 | +Repository Contents |
| 35 | +------------------- |
| 36 | + |
| 37 | +* **/examples** - Example sketches for the library (.ino). Run these from the Arduino IDE. |
| 38 | +* **/src** - Source files for the library (.cpp, .h). |
| 39 | +* **keywords.txt** - Keywords from this library that will be highlighted in the Arduino IDE. |
| 40 | +* **library.properties** - General library properties for the Arduino package manager. |
| 41 | + |
| 42 | +Documentation |
| 43 | +-------------- |
| 44 | + |
| 45 | +* **[Installing an Arduino Library Guide](https://learn.sparkfun.com/tutorials/installing-an-arduino-library)** - Basic information on how to install an Arduino library. |
| 46 | + |
| 47 | +Polling vs. auto-reporting |
| 48 | +-------------------------- |
| 49 | + |
| 50 | +This library supports two modes of operation for getting navigation information with the `getPVT` |
| 51 | +function (based on the `UBX_NAV_PVT` protocol packet): polling and auto-reporting. |
| 52 | + |
| 53 | +The standard method is for the sketch to call `getPVT` (or one of the `getLatitude`, `getLongitude`, |
| 54 | +etc. methods) when it needs a fresh navigation solution. At that point the library sends a request |
| 55 | +to the GPS to produce a fresh solution. The GPS then waits until the next measurement occurs (e.g. |
| 56 | +once per second or as set using `setNavigationFrequency`) and then sends the fresh data. |
| 57 | +The advantage of this method is that the data received is always fresh, the downside is that getPVT |
| 58 | +can block until the next measurement is made by the GPS, e.g. up to 1 second if the nav frequency is |
| 59 | +set to one second. |
| 60 | + |
| 61 | +An alternate method can be chosen using `setAutoPVT(true)` which instructs the GPS to send the |
| 62 | +navigation information (`UBX_NAV_PVT` packet) as soon as it is produced. This is the way the older |
| 63 | +NMEA navigation data has been used for years. The sketch continues to call `getPVT` as before but |
| 64 | +under the hood the library returns the data of the last solution received from the GPS, which may be |
| 65 | +a bit out of date (how much depends on the `setNavigationFrequency` value). |
| 66 | + |
| 67 | +The advantage of this method is that getPVT does not block: it returns true if new data is available |
| 68 | +and false otherwise. The disadvantages are that the data may be a bit old and that buffering for |
| 69 | +these spontaneus `UBX_NAV_PVT` packets is required (100 bytes each). When using Serial the buffering |
| 70 | +is an issue because the std serial buffer is 32 or 64 bytes long depending on Arduino version. When |
| 71 | +using I2C the buffering is not an issue because the GPS device has at least 1KB of internal buffering |
| 72 | +(possibly as large as 4KB). |
| 73 | + |
| 74 | +As an example, assume that the GPS is set to produce 5 navigation |
| 75 | +solutions per second and that the sketch only calls getPVT once a second, then the GPS will queue 5 |
| 76 | +packets in its internal buffer (about 500 bytes) and the library will read those when getPVT is |
| 77 | +called, update its internal copy of the nav data 5 times, and return `true` to the sketch. The |
| 78 | +skecth calls `getLatitude`, etc. and retrieve the data of the most recent of those 5 packets. |
| 79 | + |
| 80 | +Products That Use This Library |
| 81 | +--------------------------------- |
| 82 | + |
| 83 | +* [GPS-15136](https://www.sparkfun.com/products/15136) - SparkFun GPS-RTK2 ZED-F9P |
| 84 | +* [GPS-15005](https://www.sparkfun.com/products/15005) - SparkFun GPS-RTK NEO-M8P-2 |
| 85 | +* [GPS-15210](https://www.sparkfun.com/products/15210) - SparkFun GPS Breakout - Chip Antenna, SAM-M8Q (Qwiic) |
| 86 | +* [GPS-15193](https://www.sparkfun.com/products/15193) - SparkFun GPS Breakout - Chip Antenna, ZOE-M8Q (Qwiic) |
| 87 | +* [SPX-14980](https://www.sparkfun.com/products/14980) - SparkX GPS-RTK Black |
| 88 | +* [SPX-15106](https://www.sparkfun.com/products/15106) - SparkX SAM-M8Q |
| 89 | + |
| 90 | +License Information |
| 91 | +------------------- |
| 92 | + |
| 93 | +This product is _**open source**_! |
| 94 | + |
| 95 | +Various bits of the code have different licenses applied. Anything SparkFun wrote is beerware; if you see me (or any other SparkFun employee) at the local, and you've found our code helpful, please buy us a round! |
| 96 | + |
| 97 | +Please use, reuse, and modify these files as you see fit. Please maintain attribution to SparkFun Electronics and release anything derivative under the same license. |
| 98 | + |
| 99 | +Distributed as-is; no warranty is given. |
| 100 | + |
| 101 | +- Your friends at SparkFun. |
0 commit comments