# Challenges with GPS Data collection

**URL:** <https://forum.communityhealthtoolkit.org/t/challenges-with-gps-data-collection/1744>\
**Category:** Technical Support\
**Tags:** location\
**Created:** [February 25, 2022, 3:22pm UTC](https://forum.communityhealthtoolkit.org/t/challenges-with-gps-data-collection/1744 "2022-02-25T15:22:04Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![mourice](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/mourice/32/588_2.png) [@mourice](https://forum.communityhealthtoolkit.org/u/mourice)\
**Post date:** [February 25, 2022, 3:22pm UTC](https://forum.communityhealthtoolkit.org/t/challenges-with-gps-data-collection/1744/1 "2022-02-25T15:22:05Z")

</div>

In a recent scale up, one of our partners bought their CHWs TECNO POP 2F (TECNO B1G) phones which meets all the recommended phone specifications, however all the CHWs with this new phones are not able to collect any GPS data yet the older phones seem to be submitting data.  
Other CHWs are using Tecno POP 2+ and others are using Huawei Y9 2017. They are running on CHT version 3.10.3

---

<div class="post-metadata">

**Author:** ![diana](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/diana/32/2049_2.png) [@diana](https://forum.communityhealthtoolkit.org/u/diana)\
**Post date:** [February 25, 2022, 4:11pm UTC](https://forum.communityhealthtoolkit.org/t/challenges-with-gps-data-collection/1744/2 "2022-02-25T16:11:28Z")

</div>

Hello @mourice

Have the users granted location permissions to the Android app?  
What is stored in the `geolocation` property of reports? Is sharing an excerpt possible?  
This is how it looks when I deny geolocation permissions, for example:

![image](https://communityhealthtoolkit.b-cdn.net/uploads/default/original/2X/1/1be5c707a927039f86055dc323a0363506d1f61c.png)

---

<div class="post-metadata">

**Author:** ![mourice](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/mourice/32/588_2.png) [@mourice](https://forum.communityhealthtoolkit.org/u/mourice)\
**Post date:** [March 4, 2022, 9:50am UTC](https://forum.communityhealthtoolkit.org/t/challenges-with-gps-data-collection/1744/3 "2022-03-04T09:50:35Z")

</div>

Apologies for delayed response. This is the error code showing up on the report

 ![Screenshot 2022-03-04 at 12.17.02](https://communityhealthtoolkit.b-cdn.net/uploads/default/original/2X/6/6b60ccb2b059c5f28365b0e7b14609cd7807d293.png)

---

<div class="post-metadata">

**Author:** ![diana](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/diana/32/2049_2.png) [@diana](https://forum.communityhealthtoolkit.org/u/diana)\
**Post date:** [March 4, 2022, 10:10am UTC](https://forum.communityhealthtoolkit.org/t/challenges-with-gps-data-collection/1744/4 "2022-03-04T10:10:22Z")

</div>

Thanks for sharing.  
This looks like it’s an issue with the browser’s geolocation service failing to get GPS (registered here: [cht-core/webapp/src/js/services/geolocation.js at 3.10.x · medic/cht-core · GitHub](https://github.com/medic/cht-core/blob/3.10.x/webapp/src/js/services/geolocation.js#L53))

Is Location enabled in these devices?

---

<div class="post-metadata">

**Author:** ![mourice](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/mourice/32/588_2.png) [@mourice](https://forum.communityhealthtoolkit.org/u/mourice)\
**Post date:** [March 4, 2022, 10:56am UTC](https://forum.communityhealthtoolkit.org/t/challenges-with-gps-data-collection/1744/5 "2022-03-04T10:56:34Z")

</div>

Location on the phones has been enabled and Google map works well, though as we were troubleshooting with the team there was a bit of delay getting it to show the phone’s location.

---

<div class="post-metadata">

**Author:** ![diana](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/diana/32/2049_2.png) [@diana](https://forum.communityhealthtoolkit.org/u/diana)\
**Post date:** [March 4, 2022, 11:06am UTC](https://forum.communityhealthtoolkit.org/t/challenges-with-gps-data-collection/1744/6 "2022-03-04T11:06:56Z")

</div>

Currently, the timeout to get location in webapp is set at 30 seconds.

> there was a bit of delay getting it to show the phone’s location

Can we get an approximation about what “a bit” means?

---

<div class="post-metadata">

**Author:** ![derick](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/derick/32/78_2.png) [@derick](https://forum.communityhealthtoolkit.org/u/derick)\
**Post date:** [March 4, 2022, 11:07am UTC](https://forum.communityhealthtoolkit.org/t/challenges-with-gps-data-collection/1744/7 "2022-03-04T11:07:26Z")

</div>

It could be that the time taken to lock to GPS satellites is longer than some set threshold.

---

<div class="post-metadata">

**Author:** ![elijah](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/elijah/32/95_2.png) [@elijah](https://forum.communityhealthtoolkit.org/u/elijah)\
**Post date:** [March 7, 2022, 8:24am UTC](https://forum.communityhealthtoolkit.org/t/challenges-with-gps-data-collection/1744/8 "2022-03-07T08:24:43Z")

</div>

Mourice is asking:

> @eljhkrr could we do something on the geolocation timeout as mentioned

---

<div class="post-metadata">

**Author:** ![diana](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/diana/32/2049_2.png) [@diana](https://forum.communityhealthtoolkit.org/u/diana)\
**Post date:** [March 7, 2022, 9:45am UTC](https://forum.communityhealthtoolkit.org/t/challenges-with-gps-data-collection/1744/9 "2022-03-07T09:45:16Z")

</div>

The timeout is hardcoded in the core code, there’s no way to configure it.  
Might I suggest some troubleshooting at device level?

---

<div class="post-metadata">

**Author:** ![elijah](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/elijah/32/95_2.png) [@elijah](https://forum.communityhealthtoolkit.org/u/elijah)\
**Post date:** [March 7, 2022, 10:31am UTC](https://forum.communityhealthtoolkit.org/t/challenges-with-gps-data-collection/1744/10 "2022-03-07T10:31:08Z")

</div>

Thanks Diana, we’ll work on it

---

<div class="post-metadata">

**Author:** ![derick](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/derick/32/78_2.png) [@derick](https://forum.communityhealthtoolkit.org/u/derick)\
**Post date:** [March 23, 2022, 9:44am UTC](https://forum.communityhealthtoolkit.org/t/challenges-with-gps-data-collection/1744/11 "2022-03-23T09:44:27Z")

</div>

Any new insights @elijah ?

We got confirmation that the affected phone is running Android 10.

---

<div class="post-metadata">

**Author:** ![elijah](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/elijah/32/95_2.png) [@elijah](https://forum.communityhealthtoolkit.org/u/elijah)\
**Post date:** [March 29, 2022, 7:09am UTC](https://forum.communityhealthtoolkit.org/t/challenges-with-gps-data-collection/1744/12 "2022-03-29T07:09:51Z")

</div>

A test exercise has been completed by PIH in Neno district with a TECNO B1g device and it was able to pick GPS co-ordinates. The next phase of testing will involve a site supervisor visiting the affected district with a different device model to check if it can pick GPS.

---

<div class="post-metadata">

**Author:** ![elijah](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/elijah/32/95_2.png) [@elijah](https://forum.communityhealthtoolkit.org/u/elijah)\
**Post date:** [June 5, 2022, 1:38pm UTC](https://forum.communityhealthtoolkit.org/t/challenges-with-gps-data-collection/1744/13 "2022-06-05T13:38:53Z")

</div>

A site troubleshooting exercise was conducted in the week of 23rd May and these were the main challenges discovered to be hindering the collection of GPS data by CHWs:

**Location setting**

Some CHWs were discovered to navigate to GPS data collection forms and attempt to obtain GPS coordinates while the device location setting was off. This is despite a message on the first page of the form instructing the CHW to “_ensure GPS is enabled on your phone before proceeding_” and having to confirm this is done by activating a checkbox. See the screenshot below:

![image823](https://communityhealthtoolkit.b-cdn.net/uploads/default/original/2X/4/4ab9c349cc491e6ca287f7762d6bb18aac157fe4.png)

Mitigation measures:

- Improve instruction design - Devices normally have a location setting not a GPS setting. Using more specific language would help users create a direct association between the form and the specific device setting that needs to be activated to collect location data.
- CHT should prompt the user when attempting to get a location fix while the location setting is not enabled. For scenarios where the user proceeds without location activated, the location request will time out. CHT should be able to display this feedback to the user so they can find out why it’s happening. This has been captured in a feature request in issue [cht-core#6657](https://github.com/medic/cht-core/issues/6657).

**Location mode setting**

Devices running android 4.4 to 8.1 have a [location mode setting](https://support.google.com/android/answer/3467281?hl=en) in addition to the location setting. Location mode has 3 available settings:

1. High accuracy
2. Battery saving
3. Device only

 ![image2530](https://communityhealthtoolkit.b-cdn.net/uploads/default/original/2X/f/f2796e91e3d171361f5eed24449cbd5da9492a89.jpeg)

While troubleshooting on-site, only high accuracy mode produced a GPS location fix with a good level of accuracy (~10m). Some devices got an initial fix with poor accuracy of ~500m but this improved after resetting all radios by turning airplane mode on & off (see middle device before and after)

Initial location fix

 ![rect3095](https://communityhealthtoolkit.b-cdn.net/uploads/default/original/2X/7/79e6883e3fccd9e2d641f2585b2320e862bee14b.jpeg)

After resetting

 ![rect3663](https://communityhealthtoolkit.b-cdn.net/uploads/default/original/2X/d/d8c5fe941f46c6da093b9b0603733b99a1e19558.jpeg)

**Device GPS hardware**

The device models tested were:

- Tecno pop 2F
- Tecno pop 3
- Tecno pop 2 plus

These devices are equipped with A-GPS (assisted GPS) hardware which is a Global Navigation Satellite System (GNSS) augmentation technology that relies on GPS data provided by the network operator via an A-GPS server that downloads and caches orbital information from GNSS satellites. An A-GPS capable device can connect to these servers and download GPS information using the GSM mobile network. This is usually categorized as data access and charged accordingly.

A-GPS system design:

 ![1024px-A-GPS.svg](https://communityhealthtoolkit.b-cdn.net/uploads/default/original/2X/5/5c6cec3eb4a9c6e528b25f18983f86702f422567.png)

Some A-GPS devices also include an autonomous GPS chipset for areas with low connectivity. We observed no GPS coordinates being collected on the Tecno models in the absence of a GSM connection. This means that the Tecno devices don’t have an autonomous GPS chipset installed and rely entirely on the service provider’s A-GPS implementation.

Autonomous GPS

GPS is one of the components of the satellite-based radionavigation system that comprises the Global Navigation Satellite Systems (GNSS). A complete list of GNSS deployments is:

- GPS - operated by the United States of America
- Galileo - operated by the European Union
- GLONASS - operated by the Russian Federation
- BeiDou - operated by the People’s Republic of China
- QZSS - operated by Japan

A few devices in some locations were able to get a location fix with very low accuracy which didn’t improve even after allowing up to 15 minutes for an improved fix:

 ![image6247](https://communityhealthtoolkit.b-cdn.net/uploads/default/original/2X/2/2e3fcb9cd8f3485a24ef60dd66d9ae9b3bcfb493.jpeg)

Mitigation measures

- Sharing location data needs with the GSM service providers and government to highlight areas of improvement to the A-GPS infrastructure and possibly kickstart deployment of a ground-based GPS augmentation system for areas with low GSM connectivity.
- Replacing CHW devices with autonomous GPS in addition to A-GPS. Autonomous GPS support is labeled in the device specification in form of the supported GNSS system i.e. Galileo, GLONASS, BDS (BeiDou) or QZSS. The higher the number of supported GNSS systems, the better chances that a device has to get a location fix.

---

<div class="post-metadata">

**Author:** ![mrjones](https://communityhealthtoolkit.b-cdn.net/user_avatar/forum.communityhealthtoolkit.org/mrjones/32/681_2.png) [@mrjones](https://forum.communityhealthtoolkit.org/u/mrjones)\
**Post date:** [June 6, 2022, 7:45pm UTC](https://forum.communityhealthtoolkit.org/t/challenges-with-gps-data-collection/1744/14 "2022-06-06T19:45:55Z")

</div>

This is a wonderfully deep dive into the specifics of GPS and how to improve accuracy. Thanks for sharing @elijah !
