Saturday, July 29, 2017

Realtime GPS tracking with a RPi - Summer Project

Long time no post!

Summer gets busy. Work travel. Kids' sports. Tons of excuses but I am back and have a project in mind: realtime GPS tracking with the Raspberry Pi 3.

It has been done before - Carles and Javier from gnss-sdr coauthored a paper which did some performance testing with the Raspberry Pi 3 (along with other platforms). In this case they only looked at correlating the signal not getting a final lat/lon/alt fix but in a personal communcation Carles verified they were able to track 6-7 satellites in real time.

So I set about to replicate this work. I installed Raspbian and attempted to take the "cheater's way" by installing gnuradio using APT then manually compiling gnss-sdr. It worked, but didn't - lots of overruns. Then with a fresh SD card I tried using Pybombs to compile gnuradio and dependancies for gnss-sdr. This broke partway through compile because gcc in the Raspbian repos is compile --with-arch=armv6 which is apropriate for the RPi1/2 but in order to get the full set of NEON extensions you need a compiler --with-arch=armv7-a. This problem and the solution is documented here. Basically you switch back to the debian repos and proceed. I ran into one dependancy issue libgnutls. When repos are switched the package dependancies break - issue a "apt-get remove libgmp10" before proceeding to install with Pybombs.

I was then able to compile gnuradio overnight, and gnss-sdr in an hour. I could have cross compiled but sleep time is free time.

Unfortunately, I still had overflows. Oddly, I don't have a full core occupied or all of the RAM. Not quire sure where the choke point is.

Talked to Carles - one clue he provided is they used a USRP, not a rtlsdr stick, so it's possible there is a driver overhead issue. I do have a LimeSDR and I plan on trying that.

So here's my burndown list

  • Drop sample rate until overflows go away (much less than 2Msps will likely result in failure to track)
  • Try using LimeSDR 
  • Try using an OrangePi - I have a spare from my robotics projects. The board is smaller and half the price, more powerful than a RPi2 but less powerful than a Raspberry Pi, but its unclear at this point the processor is the issue.

Has anyone successfully tracked satellites on a Raspberry Pi using gnss-sdr?

1 comment:

  1. You can always try an Ubuntu SD image on your Raspberry Pi 3. It is compiled entirely for armv7.