Adding more stuff to the web

Playing with a NavSpark and R

Tags: hacking, hardware

Back in January I managed to get in early on the Indiegogo campaign for the NavSpark GNSS receiver. For no real reason other than the fact that it was US$17 including shipping, I decided to buy one of the NavSpark-BD boards. Besides being an Arduino-compatible board with built-in GPS, this version is also able to pick up satellites from the Chinese Beidou constellation.

While the modified Arduino client isn’t available for OS X (according to the FAQ, the LEON3 chip in the NavSpark doesn’t have an OS X cross-compiler available), I decided to have a look at some of the GPS data just to see what I could pick up. This StackExchange answer has been really useful for connecting to serial devices over USB, and the NavSpark uses the PL2303 chip which has an open-source driver available for OS X.

After installing the driver, I found the NavSpark port using ls /dev/tty.*. Since the default baud rate is 115200, screen /dev/tty.NoZAP-PL2303-000012FD 115200 started showing the GPS data from the Navspark in NMEA format. There are plenty of places that this format’s described, but the NavSpark resources page has an easy-to-read PDF. Using the lines starting with $–GSV and $–GSA, I decided to see if I could plot where the satellites were using R.

After the board had been running for a while I got the following lines:


The third number in each GSV line indicates that there were 13 GPS (GP) and 8 Beidou (BD) satellites visible - not bad considering there were three layers of concrete between the antenna and the sky when I was testing this! As I was just working with the above data, I entered the satellite elevation and azimuth data by hand this time around:

azimuth <- c(208, 316, 194, 149, 6, 230, 95, 240, 289, 326, 120, 75) <- c(292, 222, 265, 4, 348, 40, 16, 272)
elevation <- c(72, 70, 70, 51, 42, 36, 33, 15, 14, 9, 7, 6) <- c(73, 71, 57, 55, 52, 46, 2, 0)

After I’d grabbed this data, I used polar.plot() from the plotrix package to visualise the position of the satellites (this satellite location data is from 2014-05-24 at 13:33:59 UTC). I made up two additional vectors (used and that contained the numeric values corresponding to open and closed circles. Since these were entered in the order that I’d entered the azimuth and elevation data, they could be passed to the point.symbols argument to show which satellites were being used to give a fix.

polar.plot(90 - elevation, azimuth, rp.type = "s", radial.lim = c(0, 90, seq(0, 90, 15)), start = 90, clockwise = TRUE, show.grid.labels = FALSE, labels = compass, label.pos = seq(0, 337.5, 22.5), point.symbols = used)

radial.plot(90 -,, rp.type = "s", radial.lim = c(0, 90, seq(0, 90, 15)), start = 90, clockwise = TRUE, add = TRUE, point.symbols =, point.col = "red")

The end result was this (Beidou satellites in red, GPS in black):

Visualisation of satellites visible to NavSpark

I’m quite pleased with this for something that came out of my first evening of hacking in quite a long time. With a better set of functions to process the NMEA data coming from the NavSpark, it should be possible to see how the satellites move over time, much as has been done in this post by Gergely Imreh. I’m hoping to try something like this in the future - perhaps it can be a project for the next long weekend.