Friday, December 3, 2021

Connecting GPS to a Computer

To run an electronic charting system (ECS) such as OpenCPN, qtVlm, Coastal Explorer, Expedition, Time Zero, or any of many other fine navigation programs, on a computer requires connecting a live GPS receiver to it. Unlike tablets and phones, most computers do not include a GPS receiver, but it is easy to add one.

Note added Jan 28, 2024, about 3 yrs after this was originally published. We were surprised to learn that many of the then popular units are no longer for sale. We will keep the discussions as they largely apply to replacement units, but mark the section in brackets [ ] followed by options available now.

GPS Options

There are several kinds of connections. Some years ago, the only option was via a serial port connector and this is still available, but since few computers have those connectors these days, this would then be  achieved using a serial to USB converter cable. But this would likely be an old GPS if it had a serial connector on the output. These days we are more likely to have a USB connector that plugs directly into the computer, or we could use a Bluetooth connection, or a Wi-Fi connection. Or we might have a NMEA 2000 (N2K) connector, but for most computer-based ECS these would need the output converted to NMEA180 and there are several N2k-USB gateways for that such as the Yacht Devices YDNU-02.

So we look here at the generic options: USB, Bluetooth (BT), and Wi-Fi. These all have options in the $100 range; there are USB GPS for about $30, and some as low as $12, and indeed there are phone apps that will transmit a wireless GPS signal to your computer for $8—or spend $40 for an app like qtVlm and you get a whole array of sensor data (position, time, heading, heel, and barometer) from phone to computer by Wi-Fi, as well as a top of the line mobile nav app.

Here are examples we know about and have tested, but there are certainly very many other options. We do not have any commercial interest in any of these products. We have pictures of these shown below.

[ •  Inexpensive USB GPS: Globalsat BU-353S4 about $30. This is probably as inexpensive as they get. Has about a 6 ft cable, and you just plug it in (and follow set up notes below). Might need a USB cable extension. They are inexpensive. These units must see as much of the horizon as possible... but can look through a glass portlight (industrial Velcro!). ] See replacements such as



These are both very low cost and plenty adequate for training and backup.

[ •  Low cost Bluetooth GPS: Globalsat BT-821C We have had several of these over the years and old ones still work, but not clear if still available. Was about $50. Again, velcro to a portlight, or at home set it on a window sill.  ] A good BT GPS is always a great tool to have in your nav kit. I do not find any low cost versions, but there are still a couple good higher end units listed below.

When pulling out the old units, remember GPS technology has changed; newer units will get a fix faster, and with fewer satellites, and potentially more accurate results.  My guess is anything older than about 10 years would likely show notably less than optimum performance.

[ •  High-end Bluetooth GPS with data logger and app: Bad Elf Pro about $200. You can also just turn it on periodically without any BT or other connections to record and save nav data. Very good BT behavior and includes a basic mobile app as a back up. Great battery life. Going sailing with friends, turn it on and tie it somewhere in view of the sky, then you can take it home and export your track as a GPX file.  This will also of course serve as a live BT GPS signal for your ECS navigation. ]. This excellent Bad Elf unit is discontinued, with only expensive units from the company that we do not need. There are though still a couple very good BT units at or near $100.

Dual Electronics We have one and they work great. Also serves as external GPS for iOS devices

Garmin GLO 2.  Have not used one, guaranteed to be excellent.

 •  Antenna mount N2k GPS with built in heading sensor: Lowrance Point-1. About $270. This is an excellent unit for a vessel. We have had one for a couple years now, super fast connections.  It connects to a N2k backbone that includes the USB gateway that links it to the computer. 

There are several related units at West Marine. Many made to connect to AIS or radio, so we need to add connector adapters.

Garmin GA38 Just $78. Includes a long cable, but with BNC (coax) connectors at each end, so you will need to go from BNC to USB to get into the computer. 

 • Handheld dedicated GPS unit: It may take some research, but some of these can be wired to your computer to use as a primary source of GPS.  We have many of these dating way back, but the example we use here is our Garmin GPSMAP 78s. This is an old one, it was one of three used by team MAD Dog when they set the record for the R2AK in 2016—we had the pleasure of working with them in preparation for the race. Connecting these hand held GPSs to the computer can take some research. It is usually not covered in the manuals. We explain below how to do it with this one.


•  An iOS App that broadcasts GPS signals to your computer from your phone is GPS2IP. There is a well documented free version for testing (4 minutes at a time), and then $8 for full version with no time limits. It is best to test the free app to be sure all works as you expect, before the purchase. Our experience is it works great. The app can be set up to transmit other phone sensor data, but at present it is position and heading. These connect via a Wi-Fi link, either TCP, UDP, or Socket, as explained in detail at their website, which also includes step by step instructions for actually connecting to most of the popular navigation programs. The app will transmit in the background, but running the GPS and broadcasting data are a heavy battery draw, so the unit must be either plugged in or not far from it.

•  The mobile version of qtVlm both iOS and Android will also broadcast the GPS signals to your computers via Wi-Fi. It has a demo version, but for this function we need the paid version, which is $40. The app will also transmit your barometer, heading, and heel, all obtainable from sensors in the phones. It will also run and transmit this data in the background, but as noted above, this is a heavy battery draw, so the unit has to be plugged to power.  But with this, you have a full navigation system in the phone, plus a backup way to send signals to your computer. A BT or USB device is likely best choice for regular usage.

Wired GPS connections

The above are sample sources of GPS and other NMEA data we can use, now we take a look at the actual connection, and for this we will use qtVlm as a typical ECS to show the process. This is essentially the same for all ECS, once you find how you access NMEA connections. In OpenCPN it is Setup/Connections; in Coastal Explorer it is Settings/Electronics; in Expedition it is System/Instruments, and so on.

Below shows the units we used for the input testing.


These are, left to right, Lowrance Point 1 antenna mount (connected by wire to the N2k backbone shown below, which in turn was connected via USB to the computer), an iPhone with qtVlm mobile app running and broadcasting GPS and other NMEA data to the computer by Wi-Fi, above it an old Globalsat bluetooth GPS, and next to it is a new Bad Elf pro Bluetooth GPS; above it is a Globalsat USB GPS; then the Garmin GPSMAP 78s, which is connected to the computer with a custom Garmin cable; below that is another iPhone, this one running the GPS2IP app broadcasting the GPS data by Wi-Fi to the computer; and on the right, an older antenna mount GPS from some 15 year ago. It still works but is slow.  The window faces due south, but there are large windows to the right of this pic providing a slice of sky view to the west and N-NW. You can click the pic, then open in new tab, and zoom for detailed view.

The N2k bus (backbone) we use for testing is shown below. 


The far left cable is the Lowrance Point 1, next to it is the YD Gateway that can be configured to output the N2k signals or convert them to NMEA 0183 which are needed for many if not most stand alone ECS. The output cable is USB. Next to that is a YD N2k barometer, followed by the 12V power connector.  We have a review article called Introduction to NMEA 2000 with a Refresher on NMEA 0183.

qtVlm connections

That is the hardware we use, now we can look at the connections. In qtVlm this is at Preferences/NMEA connections, which brings up the window below (in Windows this is Configuration/NMEA connections).


Here is the incoming setup. qtVlm can export this data to another device (Output tab), but we are not covering that here. Recommend leaving Automatically start NMEA in the Off position for training. Underway this would be turned on.

We look at the port options below. The NMEA signals will always be: 4800, No parity, 8 bits, 1 stop bit, and no control. No need to change any of these.

The Replay file is a way to view NMEA data stored in a file, which we don't cover here. (We used this function to reenact the grounding of the Ever Given in the Suez Canal.)

Edit custom serial ports is a function for Linux users. Not needed here.

Next is option to set up 3 different serial port sources (USB or BT), which we could then switch with a click. Only one at a time is used. Also not difficult to change one as needed.

If your device (i.e., tablet or phone) has an Internal GPS, this is where you turn it on. This would be for those running the mobile version of qtVlm.  Next to that is the option to Send to NMEA outputs, again not covered here—this is covered in the Wi-Fi GPS section below.

RMB is a NMEA sentence that describes the active waypoint. This is left off. It is an option to let some external device determine what the active waypoint is. 

Display raw NMEA data  I prefer to leave on for training as it is a quick way to note we are getting signals, and it is easy to shut off.  

Record NMEA data only applies to real NMEA signals, not simulated. You can if you like record a day's sail or a race or a practice maneuver, and then replay to study it... or to gather information to improve your polar diagram.

Date and time from NMEA is useful when away from any network for an extended time. Not needed on shore with your computer connected to the internet. This automatically keeps your local computer time  up to date. Offshore, however, your computer is just another quartz watch, which will gain or lose time.

What you see when you drop down one of the serial port input options is typically a list of not just the active ports, but all the ones you have looked at recently. On a PC these will show up as a list of com ports, as shown below


For the direct USB cable plugin the process is usually just plug and play. With PC connections, the com number is typically unique to specific USB input plugs, with one, for example, called com3 and the one next to it com4, and on the other side of the laptop com5, etc. It can be valuable to use the same input for the same device to save having to reconfigure screens like the one above.  These com numbers can also change if you connect multiple devices. 

For the Bluetooth and Wi-Fi connections, there are usually a couple steps to follow in the correct order, which we come to below.

How these serial ports show up in a Mac is always a surprise. Below is what we see on an iMac after using several of the GPS sources shown above. In the Mac version of qtVlm you will see two basic forms: cu.port-name and tty.port-name. You can use either one for the input. Other Mac nav programs may only show the cu.port-name.  I think we see both in qtVlm because it offers the option to export the data as well as import it.


The green symbol on the right is a NMEA sentence filter. Most ECS have this option in some form. In this case it looks like the following, where we compare the Display raw NMEA data window, before and after applying a filter. This option is not often called for. You may have the same data from two sensors whose sentences can be identified, and this way you can shut one off.


Once the GPS, or NMEA stream more generally, is connected you can view the quality of the GPS data from the NMEA tab in the Dashboard. Start the NMEA and then press GPS status to see something like this:


I have to say "something like this..." because this is artificial in that you cannot see the two color panels at once; it is one or the other. This shows the satellites being used for the fix. The numbers are the actual satellite numbers; this is not just counting them.

Latest build of qtVlm also now predicts satellite locations for Iridium and GPS satellites and more.

The "Constellation" view is a radar presentation showing their relative locations and elevations. The circumference is the horizon, the point overhead is in the middle. The black ring is halfway up the sky. Red means the satellite has been identified and is there, but for some reason is not being used in the fix. This information is being transmitted from the GPS receiver that is doing the fixing and then telling us this satellite information in sentences GSV and GSA. The green squares are Russian GLONASS satellites (numbers 65-88). Not all receivers are configured to use these. US GPS are numbers 01-32. Augmented GPS (WAAS) are 46, 48, 44, and provide highest accuracy, but these geostationary satellites over the Equator are not easy to see on land at higher latitudes, as buildings or terrain to the south may block them out.



Video demo of connecting a wired GPS to qtVlm. (7:06)

Bluetooth GPS

Bluetooth (BT) is another popular way to connect a GPS to the computer. Once set up, it generally works as well as a wired connection, but there are two extra steps to the connection: paring the GPS device to the computer and then connecting the nav app to the serial port created by the pairing. It is important to recognize that this is two distinct steps. The Bluetooth GPS may allow for paring with multiple devices, but once paired to a computer, you can only connect one app at a time to that serial port in that computer.  Other computers on the boat could connect to the same BT GPS and use it.

The paring process will typically create two ports. In Windows they will appear as two consecutive com ports (i.e., COM6 and COM7) in a Mac they appear as cu.port-name and tty.port-name). In the PC, one of them is called "incoming" and the other is "outgoing," but this is from the perspective of the device, i.e., the GPS. So we want to use the one called "outgoing." In a PC only that one will work. You can try one and if that does not work, use the other, or you can look ahead of time, from the Windows "Bluetooth & other devices" panel, scroll down to the bottom and click "More Bluetooth options," then click COM Ports, where you learn which is the Outgoing port. It will also be the one with a name.


Bluetooth in a Mac makes a similar distinction between incoming and outgoing, more basically tied to who is asking for the data, but either one will work on a Mac, so this is not a potential stumbling block... do I hear Mac users quietly clapping in the background?
 


Video demo of connecting Bluetooth GPS to qtVlm(5:40)

Once the connection is made via BT the behavior in qtVlm is the same as described above with the USB. If you have both BT and USB you might use two different ports on the set up page to save setting it up again.


Wi-Fi GPS

Finally, there is a way to get GPS into your laptop navigation system that you might not have known of, namely there are a couple phone apps (iOS and Android) that will broadcast the GPS position and time data over Wi-Fi that you can then pick up with your computer. Furthermore, since modern phones also include sensors for heel angle, barometer, and heading, you can get all of that info as well. In short, with such an app, your phone is a back up navigation system!

Below are two videos showing this connection. One using GPS2IP, which is an iOS app, and the other is using the mobile version of qtVlm, which is available in iOS or Android. GPS2IP has a free demo version you can use to see that it all works. This one lets you connect for 4 minutes. The full app is $8 and it makes a permanent connection. This app provides GPS data and heading.



Connecting an iPhone GPS to qtVlm via Wi-Fi using the GPS2IP app (2:25).

You can also do this using the qtVlm mobile app for iOS or Android as shown below.


Connecting GPS and other sensors from a smartphone to a computer (10:03). The method shown using qtVlm mobile can connect to any nav program, in Mac or PC, but the example connects it to the computer version of qtVlm.

In our online course we cover use of the internal simulator for practicing with GPS and other NMEA signals including simulated depth sounding. Later we will come back and add the use of external NMEA simulators, of which there are several.

Also to follow shortly will be an article on augmented GPS signals both in US waters using the WAAS system and in Europe using the EGNOS system. Generically these are called SBAS for Satellite Based Augmentation Systems, which are ways to get more accurate GPS data. Invented for aircraft, but marine and land navigation can often take advantage of this.

_______

For completeness, we connected the Garmin 78s using a custom cable from a much older Garmin III+ unit, shown below. It splits from the 4 pin plug to a 12V power connector and to a serial connector that we then connected to a serial to USB cable. There is also a setting in the 78s called Export NMEA. Then it all (magically) worked just fine. The newer Garmin handhelds seem to mostly not have such a wired connection option, but models such as the 276CX offer both BT and Wi-Fi links to a PC so they would serve as a backup source for the ship's electronics if needed.


If you have one of these older popular handhelds, which do in fact still work well, you can find a direct 4-pin to USB cable from third parties online, but it would be worth checking with the sellers about your application, to be sure the power and the data are wired as you need.



No comments:

Post a Comment