Monday, 24 September 2012

GPS Troubleshooter


The most common questions we get asked relate to problems with GPS, distance, pace and maps. In almost all cases they are typical GPS reception problems, or problems with the GPS functionality of the phone. In fact, the last time we had to fix a bug in the GPS was in May, four months ago.

So, we've written a full guide to how GPS works, what kind of problems you can expect, and what you can do to resolve them, or at least minimise them.

I can't get a GPS fix, what should I do?


First of all REBOOT your phone. I know it's what they always say, but in 99% of cases it works. Some of the GPS drivers provided by some manufacturers just don't work, or they crash a lot. If the GPS driver has crashed, RunDouble can ask for GPS location updates, but the system will never deliver them to the app. Rebooting your phone reinitialises crashed drivers and will normally help.

Now, it's worth just checking that GPS is fully enabled. Sometimes certain widgets or power savers will disable it, so check it is fully turned on:

  1. Press "Menu" -> "Settings" -> "Location & Security" 
  2. Make sure "Use wireless networks" and "Use GPS satellites" are both checked. 
  3. If there are any other GPS options as well/instead of those, ensure they are checked. 

Now make sure GPS is enabled in RunDouble:

  1. Open RunDouble
  2. Click "Options"
  3. REMOVE the check from "Turn off GPS"

Next, ensure you have a good data connection (GPRS/EDGE/3G/4G/Wifi) when RunDouble starts looking for GPS satellites. This allows Android to download the assistance data that will greatly speed up acquiring a GPS fix.

Finally, wait. RunDouble will count down 3 minutes on the screen, while trying to get a fix. After this 3 minutes it KEEPS TRYING, so you might find that it gets a good fix after 5 minutes, or maybe even longer if you don't have a reliable data connection.

We've also had reports that network providers upgrading the network can have an adverse effect on GPS satellite acquisition. Check if your network is performing upgrades - this will normally resolve itself within a few days.

If you continue to have problems, then there is a test you should do:

  1. Download GPS Status from Google Play: https://play.google.com/store/apps/details?id=com.eclipsim.gpsstatus2
  2. Open up GPS Status, and time how long (in seconds) it takes for you to get a GPS fix - that is when all of the bars and dots turn green. 
  3. Now immediately open RunDouble, tap "Start my Run" and choose a run that you've already completed. Time how long again it takes to get a fix. 

If it takes significantly longer, or doesn't get a fix at all, then report both of these times to us. Otherwise, there is very little else we can do, as it is a problem with your phone.

GPS works fine in other apps, but not RunDouble. Is RunDouble broken?


In short, no. Many other apps will request GPS, or FINE grained location data, but will also request network or COURSE grained location data at the same time. Google Maps is a good example. When you open Google Map your location is shown on the screen almost immediately. It will often be quite accurate, especially if you're in range of a known wifi access point. Your rough location is pinpointed based of what the phone already knows - which cell tower it is connected to, and which others are in frequency range; and any local wifi hotspots (including the one in your home!).

That location is great for zooming a map to show you the right area, but it's useless for RunDouble. RunDouble needs to know precisely how far you have run, and how fast you are moving. The COURSE location data is not accurate enough to do this, so RunDouble needs to wait until you have a FULL GPS fix.

Now, getting a full GPS fix is not easy. There are several things that need to happen:

 1) Your phone doesn't know which GPS satellites are in view, so it has to scan all of the frequencies until it finds one - actually until it finds at least 4.
 2) Now, your phone needs to know precise information about the location of the satellites. This is broadcast by the satellites themselves, but it can take up to 15 minutes to get the full file. Even works, if a car drives past, or someone turns on their microwave, and a bit of this file gets lost, then it has to start again.
 3) Finally, your phone can time the signals from the satellites, and calculate your position.

Most phones now use a system called A-GPS, which means that the data that needs to be downloaded from the satellite can be downloaded more reliably using your data connection. It will use either a wifi or GPRS/EDGE/3G/4G data connection. If you make sure you have a good data connections when you start the GPS searching, then you stand a much better chance of getting a GPS fix.

My distance is completely wrong when I run indoors / around my garden, why?


There are two reasons why GPS cannot be used when indoors or in a confined space such as your garden:

  • GPS signals are very weak, and very susceptible to bouncing around off nearby objects such as walls, buildings, ceilings etc. This means that you will either not get a signal at all, or the readings will be inaccurate. You may lost signal part with through your run, or it may just dart around all over the place. It's not going to provide any useful data.
  • Small circuits don't give very accurate distances. RunDouble samples your distance every 5 seconds, which means if you are running a very small circuit it will chop off all of the corners, making your run look much smaller. Also the accuracy of GPS is not high enough to be able to accurately pinpoint your position in a small circuit - small errors become amplified, whereas on a long straight run they have a tendency to cancel each other out. 

You also need to be actually moving - using GPS while you're on a treadmill is never going to work. Some running apps will use the on-board accellerometer to detect how many strides you have taken, but this is so unreliable that we decided not to do it. Your stride can vary so much depending on the speed and gradient you are running on, and we just didn't want to feed inaccurate data to the runner.

I'm getting wildly inaccurate pace/distance readings, what can I do?


RunDouble doesn't actually control the GPS hardware on your phone. It is entirely controlled by Android, and the GPS drives supplied by the hardware manufacturer. RunDouble does 2 things: first it ask Android to start delivering location updates to the app; then it takes these updates, calculates the distance between them, and records them on the map. That's all. RunDouble doesn't manipulate the points in any way - so if you see wildly inaccurate distance/pace, or the map doesn't accurately reflect your route, then it has to be a problem with the GPS system on your phone.

As first step I would recommend restarting your phone immediately before your run. If that doesn't help, then resetting your GPS using GPS Status MAY help:

  1. Download GPS Status from Google Play: https://play.google.com/store/apps/details?id=com.eclipsim.gpsstatus2
  2. Open up GPS Status, tap the "Menu" or "..." button on your phone.
  3. Tap "Tools" -> "Manage A-GPS state" -> "Reset"

Other than this, it could be manu factors effecting the accuracy of the data. It could be terrain, nearby buildings, trees, cloud, haze, rain, electrical storm, solar flares.

I stop getting distance updates part way through my run. Why?


This could be for two reasons:
  1. Loss of signal. There's not much we can do about this. If you lose signal, you will stop receiving updates. 
  2. Power saving features of your phone. 
 If it is being caused by the power saving features on your phone, it may be possible to do something about it. Check your phone settings to see if there are any battery saver/extender settings or apps. Make sure you disable any power saving features. One that was specifically drawn to our attention is SMARTACTIONS on Motorola phones - this app specifically disables GPS when the screen has been switched off for a short period of time.

If you cannot find any power saving option, then it may be possible to keep your phone away using the screen lock built into RunDouble. Once you have started your run, tap the "Controls" button, then tap the button with a padlock symbol. This will lock your screen and leave it switched on. This will normally prevent your phone from disabling the GPS chip.

GPS stopped working in the last update, can you fix it?


This is a question we are asked every time we release a new version of RunDouble, even if we haven't changed the GPS code in any way. It is very unlikely that we have done something that has broken GPS - we generally leave the GPS code well alone, and don't mess with it. Normally it is the case that you've started having trouble getting a GPS signal, and it happened to coincide with one of our releases.

We have in the past occasionally disrupted GPS functionality for a small group of users, but in these cases we normally manage to make an update available within 24 hours. Please read the previous questions in this article to ensure you have tested all of the possibilities.

What is GPS filtering? Should I switch it off?


Occasionally users would see GPS 'glitches'. Their route would be mostly correct, except for maybe one point in the middle which was 10s or 100s of miles away. That single point would ruin the stats for the whole run. GPS filtering aims to ignore any points which would suggest that you had super-human powers. It basically checks that the data being passed from the GPS chip looks sane and normal. This is not a magic bullet - if your GPS is behaving erratically, it won't make it better, but in some cases it will stop a glitch from ruining your run.

Should you switch it off? Probably not. We made it optional, in case some users were having problems with their GPS tracks. If you find you GPS track is missing a lot of points, you might like to turn it off, to see if it helps. The chances are that the results could be even worst that with filtering switched on.

9 comments:

  1. Not a bug, just a GPS request -- it'd be awesome if the GPS could include altitude data. I do a lot of trail running, which sometimes includes lots of steps. Any way to get credit for my vertical distance as well as horizontal?

    ReplyDelete
    Replies
    1. Hi Molly. Actually we do currently record altitude data, we just don't display it anywhere. We do plan to include this on the website in the graphs, but we have to do a little development work to make that happen.

      Delete
    2. Thank you so much! I really love this app, I tried a bunch when I started running, and this is my favorite. You guys just keep being awesome, and I'll keep asking for more, haha!

      Delete
  2. Not a GPS request per se, but more of a data/logging request -- would it be possible to save and display splits for the long C25K runs (W5D3, W6D3, and beyond) and fun runs? Right now, it just lists the entire run as a leg (my last fun run, all it tells me is "3 km in 16:24 at a 5:27 pace") It'd be great to see breakdowns of the data on a mile-by-mile, km-by-km, or even minute-by-minute basis, or some combination of the three. Heck, I'd happily pay for the functionality, and I'm sure a number of other users would too!

    And I'll echo Molly -- this is a great tool, and you have done a bang-up job in helping me to keep motivated to run; being able to see and track my improvement makes running that much more fun for me.

    ReplyDelete
    Replies
    1. Again, that is another thing that is on our very long list of things to do, though you won't have to pay for it when it does come out. Some of these things take a lot of figuring out, exactly how it's going to work, what it'll look like, and how it will fit in with existing functions. Please bear with us - we want to get these things right.

      Delete
    2. Cool, thanks Martin! I love that you're adding that functionality for free -- I genuinely would have been willing to pay for it, too. I'm sure the rest of the userbase is waiting with bated breath!

      Delete
  3. Sorry if you've covered this already somewhere else. Not sure if you'd call this a GPS problem ?? I just completed my first c25k run and if I look at the stats the map is correct so I'd assume that means the GPS is working just fine but the distance is totally wrong. Plotting the path in google maps it's about 3.2 km but somehow rundouble claims it was 31.4 km ! I'm not that good, just 3km nearly killed me ! Seems like it's out by a factor of 10 ??

    ReplyDelete
  4. I'll second that observation: I am regularly somewhere between 18 and 40 km ahead. Makes me feel great, but ;)

    ReplyDelete
  5. I recently bought a new phone but I couldn't get a gps fix. I tried all the recommendations to no avail. I looked at other apps but they required more memory that I didn't have, but I really wanted to get this one working. When I realized that I needed to go into setting to reset my phone to factory setting other than just shutting the phone off, it worked. YEA!

    ReplyDelete