iPad: why your location sometimes doesn’t keep up
21 May 2024 om 10:39
Apple devices, and iPads in particular, are exceptional devices for us to consider when developing our app. We previously wrote this blog post, about navigating with an iPad. Here, we specifically addressed iPads with wifi only and thus lacking a GPS antenna.
Since last year, out of the blue, we started getting reports from our users who all ran into the same problem. Their location on our map was regularly suddenly stationary and therefore no longer ‘running’. Product Owner Sven investigated and found an unusual cause.
Last year, out of the blue, and in fairly quick succession, we received the same comment from several of our app users. Their location on the map sometimes stopped tracking abruptly and did not run along while they were cruising. The problem would disappear briefly if they would pick up their device for a moment and move. We do get quite some feedback, but this was a special case, as we hadn’t changed anything in our app in terms of location features and GPS.
In the first email we send back in such a case, we ask three questions:
#1: On what kind of device does this happen (brand, type)?
#2: What operating system do you have installed on that device (e.g. iOS 17.1)?
#3: What version of our app are you using on that device (you can find this at the bottom of your profile page)?
Based on this, we found out that in almost all cases it happened on iOS (Apple) devices, i.e. iPhones and iPads. But apparently not on all Apple devices and not in all circumstances, otherwise we would have received many more emails.
In fact, most app users do not email us. When there is a problem with the app, most people first close the app, restart the app and often miraculously the problem is fixed. Still, we got enough emails to start looking for the ‘issue’.
Reproduce
With all the information we got from our users, we investigated with some Apple devices to see how we could reproduce the problem. The first thing I did was to test my iPads in the car, but nothing showed up; no problems.
I live on my ship, so I went sailing the next day. And indeed…on one of the three iPads, my own location fell silent. Very annoying, and even more so for the sake of being able to find why this happened: how could this happen on one iPad but not the other, and not on the iPhone either?
Compare
The iPads I was able to reproduce the issue on, were two different ones. Each with a different OS (operating system). This offered some perspective. However, when we tried to reproduce this issue on identical iPads with an identical OS…it didn’t work? How could that be?
Technology in an iPad and iPhone
To find out exactly what was happening, we started looking at what exactly is happening inside an Apple device, as we were getting more and more suspicious that it was a hardware problem in Apple devices. Inside an iPad on iPhone are located:
- An accelerometer: records movement/motion (distance, speed)
- A gyroscope: records movement across the X and Y axis
- A GPS chip: records your location, course and speed (by the way: there is no GPS chip in ‘wifi only’ models)
- A battery/battery
Nothing too special, as these components are in almost every smartphone. But, the essential difference is that Apple has had problems with their battery for years: they simply don’t last as long as those of other smartphones. Not per charge and not in terms of battery life.
Saving battery life
To extend battery life in their devices, Apple does all sorts of things in their operating system to preserve energy and thus minimise activity in the device.
To see exactly what was happening in iOS while boating, we climbed aboard a Stromma canal boat with one of our programmers Erik-Jan Geniets. Erik-Jan is a canal skipper in Amsterdam as well as a Waterkaarten power user. Brilliant, as this meant we had our hands free for testing while Erik-Jan sailed us through the canals of Amsterdam.
By connecting a laptop to an iPad, we could see what was happening in iOS in regards to the location problem. Even though we were moving along the canals, we saw that iOS paused GPS messages under certain conditions…until we slightly moved the device, which triggered the iPad to continue receiving new GPS messages again. By the way, those GPS messages contain information about your location, course and speed.
The conditions and criteria
So we were cruising the canals of Amsterdam, in a 40-tonne canal boat, on virtually still water, with no wave action, at an average speed of 7 km/h. You know what that feels like:
- The boat is barely moving
- You’re hardly moving forward
And just when the above criteria, or just one of them, was met, we noticed that iOS, despite the fact that we were indeed cruising the canals, paused the GPS message; we were literally getting the same Lat/Lon coordinates over and over again.
The conclusion
When a device is moving below a certain speed and not moving along the X and Y axes, the accelerometer and gyroscope are not triggered and the reception of GPS messages is paused.
Why does this happen? Because receiving and sending GPS messages is a power-hungry process. And to save battery on (a better battery in) your Apple device, the easiest gain is to turn off sending and receiving GPS.
Unfortunately, this does not happen with all devices, and it is subject to the iOS you’re using as well as the components used per iPad or iPhone. And even per type of iPad or iPhone, different gyroscopes, accelerometers or GPS chips are used.
Any questions?
Question:
But, when I open Google Maps or any other app, it does work!
Answer:
Correct. You grab the device, open Google Maps and perhaps hold your device. The device is moved along the X and Y axis and the GPS messages come back in. We have tested this with Navionics, Savvy Navvy, Google Maps, Apple Maps and a few other navigation apps.
Question:
Did this happen all the time in Amsterdam?
Answer:
No. On the IJ, it did not happen and indeed; there, we had no problems at all. The minimal wave action there minimally moved the boat over X and Y and triggered the gyroscope, and we sailed there about 13 km/h which also triggered the accelerometer.
Question:
In my car too, I hardly move at all, but Maps just works there too – how is that possible?
Answer:
It’s all in the word ‘barely’. Let’s compare driving a car with flying a large aeroplane. If you have ever flown, you know that an aeroplane can fly very fast, and above all super fast, without vibration. Compare that to driving in your car, or better yet: focus on the movement or vibration you experience in a car; almost always, there is some. And besides: the accelerometer registers that you are moving forward. Two criteria that keep GPS signals coming in.
Solution
We started thinking about how we could manipulate the gyroscope or accelerometer and tell in iOS’ code that it is moving. But you guessed it: that’s not possible. But, we did think of something else.
As you know, recently we’ve been busy with enabling the linking of AIS devices with the app.
- AIS transponders have always had a GPS module and/or an external GPS antenna can be connected to it
- More and more AIS receivers come with the above options
- …and so, those devices also receive GPS messages.
And those GPS notifications are forwarded to the app via such AIS devices. Our programmers have tested and built for us a version of our app in which GPS messages from a paired AIS device are read and can be used in our app.
We tested this recently and it works: the location is constantly running, and course and speed are displayed just fine. We even completely turned off the location features on the iPad and iPhone, as they would no longer use our app. And by coincidence, such an AIS receiver with GPS reception is a win-win situation. Because in addition to your location tracking fine, you can also see the shipping traffic around you.
Very useful for iPad ‘wifi-only’ models too
Another sidenote: a ‘wifi-only’ iPad does not have a GPS chip and location is determined, among other things, by means of nearby wifi networks, which you do not even have to log in to. But such an AIS receiver also works for these types of models (or transponder, but that comes with a different price tag and you’ll need a basic Marine Radio Certificate).
Author: Sven Lens, Product Owner Waterkaarten