Similar to the WiFi example, this example uses only the base TinkerNav boards and GNSS antennas. However, in this example data is sent and received from an NTRIP caster on the internet (or on your own network for experimenting) rather than sent over a WiFi network. Using an NTRIP caster provides additional flexibility compared to sending data over a WiFi network. For example the base station and rover could be on different WiFi networks, or you can run only a rover that pulls data from a publicly available base station. See our How to Send RTK Corrections article for more information.
For this example we will use the RTK2Go as the NTRIP caster. The same company that hosts RTK2Go.com also offers a free version of the SNIP caster that you can run on any windows machine and is perfect for initial testing of a setup. If you need to experiment with base station software SNIP can be especially helpful since RTK2Go.com is intended for well running setups and will block IPs if they try to connect too many times without providing data. Blocks will expire after a few hours, but the intention of RTK2Go.com is to use once your setup is running. There are detailed instructions for SNIP on their website, but for testing on your local WiFi network the steps you will need to take are determining the local IP address of the machine running SNIP and connecting to that IP from your NTRIP server (base station) and client (rover).
The hardware is the same for the rover and base station with different firmware and configurations of the PX1125R or PX1122R. To start let’s set up the hardware.
The GNSS receiver is configured during the setup portion of the example programs by sending binary messages to the receiver from the RP2040. Specifically, the programs find the current baud rate of the receiver and resets it to factory defaults. The rover works on the factory defaults and does not require additional changes, the base station is configured with another binary message to operate as a survey in base station. Optionally, you can also configure TinkerNav using SkyTraq’s GNSS viewer, using our instructions.
The Arduino IDE is used to flash the firmware since it is a readily available environment with a large user base and many useful libraries. The Arduino 1.8.X and 2.X IDEs can both be used for development and flashing.
There is firmware for both the rover and base RP2040. The firmware is responsible for programming the GNSS receiver, reading data from a TinkerCharge board, if present, and communicating that information the ESP32, which does most of the work in this configuration.
The RP2040 firmware is found in the RP2040 folders at our GitHub example for TinkerRTK using a WiFi network to connect to an NTRIP caster.
The RP2040 firmware depends on three libraries that must install, SerialTransfer, Max17055_TR, and programSkyTraq. The first of these is installed using the Arduino IDE’s Manage Libraries function, which you access from the Arduino IDE’s Tools menu. The image below show the correct library, which you can find by searching for their names in the library manager.
The second library, programSkyTaq is available from our GitHub programSkyTraq repository. Download, unpack, and copy the programSkyTraq directory to your arduino/libraries folder.
The third library, MAX17055_TR, is available at from our GitHub MAX17055_TR repository. Download, unpack, and copy the MAX17055_TR directory to your arduino/libraries folder. This library implements more functionality of the MAX17055 than the other available MAX17055 libraries. Note that even if you are not using the TinkerCharge board you will need this software, the software operates with or without the board present.
For this firmware you will need to install the Earle Philhower RP2040 board set. Installation instructions are found in the documentation for the board set. Note that the Arduino MBED board set supports most needed functionality for TinkerNav, however Arduino MBED does not implement software serial as of the writing of these instructions. Software serial is needed because the RP2040 offers two hardware ports and the TInkerNav board uses the two hardware serial ports for communicating with the GNSS receiver and the optional LoRa radio since small corruptions of data that occur with software serial, especially at higher speeds, can cause dropouts in time critical data for these two devices. Software serial is used for the less critical task of communicating small amounts of data between the RP2040 and the ESP32 radio. Data drops will occur on this communication path, but are tolerable.
With the libraries installed, you can now compile the RP2040 firmware in the Arduino IDE and flash it to the RP2040 by connecting a USB-C cable from the computer running the Arduino IDE to the RP2040 side of the TinkerNav board. You will need to select the “Raspberry Pi Pico” board from the available RP2040 boards as shown heres
A successful flash looks like the picture below. Note that if you run into trouble flashing the RP2040 see the trouble shooting section below.
Remember that you must repeat the above steps for both the base and rover boards with the appropriate firmware. The base board includes “BaseStation” in the name and the rover includes “Rover” in the name.
Serial output from the RP2040 to the Arduino IDE, or other, serial monitor should look like this example, note that if the TinkerCharge board is not attached the values are meaningless, but the firmware is still working.
Next we will flash the ESP32s on the base and rover boards. The ESP32 is again flashed with different firmware for the base and rover configurations. The firmware here includes the credentials for your WiFi network and the NTRIP caster you are connecting to, so you will need to modify the “Inputs.h” file before flashing.
To flash programs to the ESP32s you need to install the ESP32 board set in the Arduino IDE. A good tutorial on installing the ESP32 board set is found here.
ESP32 Base Station
First we will flash the base TinkerNav’s ESP32. The base board is responsible for serving RTCM correction data to an NTRIP caster, which can be on your own network or on the internet. To do this the ESP32 reads the RTCM correction output of the GNSS receiver and sends it to a caster. This method enables one base to support multiple rovers. The base station’s ESP32 also serves a webpage that displays basic information about the base station’s status.
The firmware for the base station is found in the ESP32 base station folder at our GitHub. Modify the Inputs.h file to include your WiFi network’s name and password, as well as the IP address or URL of your NTRIP caster, the port your caster uses (usually 2101), the mount point name and password. The mount point and password are setup on the NTRIP caster, either online for a caster like rtk2go.com or on a local machine if you host your own, like SNIP. To flash the firmware select the “ESP32C3 Dev Module” board from the “ESP 32 Arduino” board set.
A successful flash will look like this:
Running the program will provide the following output to the Arduino IDE serial monitor. Note that to access the webpage provided by the base station ESP32 type the IP address output over serial into a browser on any device connected to the same network.
Finally we flash the ESP32 for the rover TinkerNav board. The ESP32 on the rover, in this configuration, is responsible for receiving the RTCM correction data from the TCP server on the base station ESP32 and sending that data to the GNSS receiver on the rover. The GNSS receiver uses that correction data to calculate an RTK solution, which is displayed on a webpage served by the ESP32 and output as NMEA data from the RP2040 for use in your application.
Firmware for the ESP32 on your rover is available in the ESP32 rover folder at our GitHub TinkerRKT WiFi NTRIP example. You will need to modify the Inputs.h file again, this time adding both your WiFi credentials, the NTRIP caster host name (either an IP or URL), NTRIP port (usually 2101), caster mount point, and caster credentials if needed by your caster . Follow the same steps as above for the base board to flash this firmware to your rover ESP32.
Working Base Station and Rover Pair
The first indication that that the boards are working as planned is the indicator light on the base station and rover. On the rover, the light will start off red, turn to yellow when a GPS solution is found, green for an RTK float solution, and blue for an RTK fix solution. On the base station the light will start off red, once there is a GPS solution it will turn to green, and once the solution is stable and the unit is surveyed in, it will turn to blue. Note that it is normal for surveying to take a few minutes and the light may toggle from green to blue a few times before locking in on blue. On both the rover and the base station there is also a small green led near the GNSS receiver that will flash once per second once a GNSS solution is found.
Both the base station and the rover also publish web pages to the IP addresses they print to the Arduino IDE serial monitor when they start up. Put those IP addresses into a browser on any device attached to the same WiFi network as your base station and rover. Some of the web pages produced are shown below.
The home page for the base station provides the options below. Note that you can click on the TinkerCharge, RTK, GNSS, and Map View cards for more information.
Clicking on the RTK data card shows the time the base station TinkerNav board has been up and the number of RTCM correction data made to the TCP server.
The TinkerCharge card will show the following data if a TinkerCharge board is connected to the base station TinkerNav.
The GNSS card will show the current latitude and longitude.
The Map View will show a map of the base station’s location using Open Street Maps.
The rover webpage provides additional options from the following homepage.
TinkerCharge provides the same data as the base station TinkerCharge option. RTK provides the information below. This information includes the date and time from the GNSS receiver and the time that the rover station has been up. Information about the RTK fix is provided including the current fix type, which can be GPS, RTK Float, and RTK Fix. The age of the RTK data is displayed as well as a RTK ratio that describes the quality of the RTK fix. The RTK ratio has values from 0 to 10, with 10 being the best. Any cycle slips are displayed for the GPS, Galileo, and BeiDou constellations respectively. These cycle slips occur when the receiver loses lock with the satellite and loses count of the carrier phase cycles. Finally the east, north, and up baseline is displayed. This is the distance in each direction between the base station and the rover (the example below is for antennas next to each other).
The Satellites card shows the list of satellites currently being tracked by the receiver along with their location in the sky (azimuth and elevation) and their signal to noise ratio. Signal to noise ratio is affected by the elevation of the satellite with higher elevation satellites having a shorter path through the atmosphere. Any obstructions in the sky, such as trees or buildings, also affect SNR. Multi-path, or multiple receptions paths from the satellite to the receiver will also degrade the SNR value. Values above 40 are best for RTK solutions.
Latitude and longitude are shown in the GNSS menu.
Finally the Map card shows the current location displayed on an Open Street Maps map. The Open Street Maps interface allows you to zoom and pan the map with additional options available by editing the code. Open Street Maps is similar to Google Maps, but provides a free interface.
Difficulty Detecting or Flashing RP2040 or ESP32
If your ESP32-C3 or RP2040 processor gets in a bad state and does not respond to the Arduino IDE you can reestablish communications with the Arduino IDE by following these steps:
- Connect one end of a USB-C cord to TinkerNav (either RP2040 or ESP32-C3).
- While the other end of the USB-C cord is unplugged, press the “Boot” button on the TinkerNav board corresponding to the processor you are trying to communicate with.
- Plug the USB-C cable into your computer while holding down “Boot”
- Release the “Boot” button.
- If you are still unable to see serial communications after a program is flashed, this seems to happen with the ESP32-C3, unplug and re-plug the USB cable one more time without holding down the “Boot” button.
No Serial Output from ESP32, or only crash reports
For the ESP32, if you can flash normally and the program seems to be working but you are not seeing serial output to the Arduino display you may need to enable “USB CDC on Boot”. To do this select the “Tools” menu in the Arduino IDE and select “Enabled” next to the “USB CDC On Boot:” menu item. This setting usually sticks after it is changed once, but may be lost occasionally and need to be reset to “enabled”.
Serial data is output on a crash/reset of the ESP-32 regardless of the “USB CDC on Boot” option, so there may situations where you only see these crash reports and none of the serial output you expect. Check the “USB CDC on Boot” option and make sure it is enabled.