GPS Linux GlobalSat Receiver Sirf Star IV Chipset
This will be a quick primer on how to use a GlobalSat GPS receiver on Ubuntu Linux.
It is actually quite easy since Linux doesn’t need any drivers loaded. Also this blog sort of augments the last blog I wrote regarding the capabilities of using a computer offline. In one section I used a U-blox GNSS module to capture GPS coordinates on Windows and Linux operating systems.
That U-blox module is not exactly what I’d consider to be weather proof. My intent here is provide a GPS solution that is in some sort of reasonable enclosure that is more conducive to getting bounced around in a backpack. Or more conducive to being used in an outdoor environment.
I settled on the GlobalSat BU-353-S4 ($79). The following instructions should work on other serial GPS devices from GlobalSat.
It should be noted that that this device is strictly GPS with a Sirf Star IV chipset.
Conversely, most new devices use a mix of global positioning systems such as China’s Beidou, the EU system Galileo, or Russian GLONASS.
Those systems combined are GNSS. GPS is only the US system.
Linux Instructions
This is fairly easy but does require a little configuration. First of all you want to check that the device is recognized. When you plug it in it should be found as a serial device with the device name of
/dev/ttyUSB0
If you have another serial device you can check by opening a terminal and typing
ls /dev/ttyUSB*
Once you determine your device name you can install a program called gpsd.
sudo apt install gpsd gpsd-clients foxtrotgps
Now, type
sudo nano /etc/default/gpsd
Make sure your file includes this information:
# Devices gpsd should collect to at boot time. # They need to be read/writeable, either by user gpsd or the group dialout. DEVICES="/dev/ttyUSB0" # Other options you want to pass to gpsd GPSD_OPTIONS="-G" # Automatically hot add/remove USB GPS devices via gpsdctl USBAUTO="true" START_DAEMON="true"
Reboot.
Now open a terminal and type:
cgps -s
This will happen.
Congrats! That is it. If you want you can launch foxtrotgps and it will show your position on an OpenStreet Maps.
I’d be remiss if I didn’t mention that the GPS here is using a SIRF format and not the more common NMEA format. To get it to output NMEA data you have to go to a terminal and type the following two commands:
sudo killall gpsd stty -F /dev/ttyUSB0 4800
Then you can test that by typing:
sudo cat /dev/ttyUSB0
It should now output NMEA data.
Not really seeing an advantage to doing that since you can get GPS data and use it in foxtrotgps with SIRF format via gpsd.
Another Gotcha
If my Ubuntu laptop goes to sleep and then wakes the serial device changes from /dev/ttyUSB0 to /dev/ttyUSB1. That means gpsd can’t find the device. The solution is to unplug the GPS and plug it back in. Or reboot.
I learned this because I turned off wifi and threw the laptop and GPS in the truck to see if it would GPS track on a map with no network connection. It did! But then I closed the laptop and opened it up when I came back. /dev/ttyUSB0 > /dev/ttyUSB1. Not that big of a deal but still qualifies as a “gotcha”.
Windows Instructions
Not so easy in Windows 11. No programs I downloaded seemed to want to use the SIRF format. To switch the GPS module to output NMEA you need to do some trickery.
First plug in the GPS and go to the Device Manager under Ports and set the port to:
- Bits per second – 4800
- Data bits -8
- Parity – None
- Stop bits – 1
- Flow Control – None
Next go to this page and download the GPS Info Tool For Windows
After running the program make sure your correct COM port is selected with 4800 baud selected for speed. You’ll see nonsense characters in the console. Click the button that says “Factory Reset” and it will start outputting NMEA.
So, the Sirf Star IV GPS module from GlobalSat works, but it is a minor pain to initially configure. I recommend still using chipsets from U-blox, ESPECIALLY ON WINDOWS. It is much more Windows friendly.
I’ll be testing a GPS based on the U-blox 8030 chip soon.
Wrap Up
For the cost, this ain’t your Huckleberry. If you are a Windows user you need to flip it from SIRF to NMEA protocol before you can use it with most GPS software. While it works in Linux, you need to install gpsd and if you do want straight NMEA output you have to set the serial port speed via command line every time you open a new terminal.
sudo stty -F /dev/ttyUSB0 4800
In other words, this GPS puck requires some geekiness to be useful. That being said, if you are hanging a GPS off of your laptop you probably already possess some level of geekiness.
For the cost it should be a GNSS receiver and not just a GPS receiver. Personally, if you are just someone who thinks I’m on to something with making an offline laptop, but you aren’t super technical…….I’d stay away from this GPS.
As I mentioned above, I’ll soon be testing another puck based on the U-blox 8030 chipset. It is the GNSS200L. While I’m not positive yet, I’d be willing to bet this is much more plug and play friendly for both Linux and Windows. I’ll do a separate blog on that GPS when I get it.
Having stated all that, I am a geek, I don’t mind passing a command on the command line to make something behave. I’m writing this from the perspective of someone without a lot of technical OS knowledge.
Anyway, it works, it works pretty well, but has some limitations with the most prominent being that it runs at 4800 baud on a serial port.
I’m torn on whether I should recommend this for the bug out bag or not. It really depends on your skill level and knowledge of OS’s and serial port settings.
Pingback: Using A Computer With No Internet Connection - John's Tech Blog
“If my Ubuntu laptop goes to sleep and then wakes the serial device changes from /dev/ttyUSB0 to /dev/ttyUSB1. That means gpsd can’t find the device. The solution is to unplug the GPS and plug it back in. Or reboot.”
using the /dev/serial/by-id/usb-Prolific_Technology_Inc._USB-Serial_Controller_UNIQUE_PART-port0 notation should solve this permanently.
running
ls /dev/serial/by-id/
should show you what is available