B2G/QA/Geolocation
From MozillaWiki
Testing Geolocation :
To note :
- We do not have a SUPL server to test against because it is a pay-for-service. Configurations for AGPS w/ SUPL is up to the vendor. See https://wiki.mozilla.org/B2G/Geolocation for more details.
- For example, pointing to supl.google.com:7276 requires a license.
Test pages
- Testing getCurrentPosition:
- navigator.geolocation.getCurrentPosition function; not high : http://people.mozilla.org/~nhirata/html_tp/geo_testpage_nohigh.html
- navigator.geolocation.getCurrentPosition function/high : http://people.mozilla.org/~nhirata/html_tp/geo_testpage.html
- Testing watchPosition:
- navigator.geolocation.watchPosition; high: http://people.mozilla.org/~nhirata/html_tp/geolocation_highwatch.html
- navigator.geolocation.watchPosition; not high: http://people.mozilla.org/~nhirata/html_tp/geolocation_watch.html
NOTE:
- we have to test high accuracy versus low accuracy as there may be issues : see bug 1013012
- Using watchPosition is better if you're going to be testing an extended amount of time as it will constantly refresh the position and get multiple readings. If you are going to just get the current location it might be good to test a single point by closing the browser, clearing the cache and then reopening the browser.
Test apps
- GPS app in the engineering build or you can push it via webIDE
- GPS app in the marketplace
- weather app
- map apps:
- zMaps app in the marketplace
- Here maps ( is currently off market and in revision )
- Google maps in web browser ( https://maps.google.com )
- note: there are some tech evangalism bugs listed for google maps.
- Find My Device
- Use opensignal.com website to check signal strength and cell tower locations.
- Single requests from home depot, or other stores ( "Show me stores around me" feature on their web sites )
- http://www.elsewhere.org/journal/gmaptogpx/
Testing
- Testing should include user stories such as :
- using GPS for navigation
- using GPS for pathfinding (jogging tracks)
- checkin apps like four squares, Find My Device
- one time geolocation calls: Home Depot closest location, yelp
- logging:
- be sure to turn on geolocation logging in settings -> developer
- be sure to turn on geo.wifi.logging.enabled for wifi testing ; you can adb logcat | grep WIFI
- This should print content as much information of that layer of the device sees on cell tower id and wifi :
*** WIFI GEO: sending [a big set of JSON key,value pairs]
- https://bugzilla.mozilla.org/show_bug.cgi?id=1190337 : turn on gDebug_isLoggingEnabled for more logging.
Signals
MLS / Wifi
- indoors or out, it doesn't matter as long as you are near wifi points.
- wifi must be turned on
- Note: you may want to turn cell data off; if it gets the ip from cell data then it might put you in a weird location (ip location of the cell tower)
- MLS; if GPS/AGPS isn't active we should be using MLS
- MLS uses wifi/cell tower locations
- wifi accuracy:
- 30 to 200 meters accuracy : on some map apps, you can see a blue halo around the point
- wifi accuracy:
- If we don't have MLS data point we use GeoIP
MLS/Cell Tower
- turn wifi off, if GPS/AGPS doesn't kick in, it will fall back to Cell tower.
- cell data off
- ie indoors, maybe. make sure you have bars for signals for cell
- cell tower accuracy:
- 1 to 10 km accuracy ( in the cities at farthest it would be 5 km, in rural 20 km)
- cell tower accuracy:
- If we don't have MLS data point we use GeoIP
GeoIP:
- IP address: 50 miles accuracy ( server which assigned IP address to the device from the cell tower)
- Some more explanation found here : https://bugzilla.mozilla.org/show_bug.cgi?id=1023647
- worst case scenario uses GeoIP
- how to set this : no cell tower and no wifi scanning
- no sim turn off wifi
- GeoIP is very approximate
AGPS
- must be outside or near outside (window)
- best when outside away from buildings, having south side clear of buildings.
- turn off wifi
- turn off cell data
- two different methods of access, define only one to verify :
- SUPL
- SUPL must be defined. We have code in gaia pref and QC has code in /etc/gps.conf These can be manually edited to include a SUPL server.
- packet sniffing to see if SUPL server is being used is one way to check if SUPL is being used
- Ephemeris Solutions: (Download files):
- XTRA - Must be on a Qualcomm chipset as this is QC's proprietary AGPS Ephemeris Solution
- /etc/gps.conf must include XTRA server in order for this to work.
- check logs to see if any package downloaded from XTRA server; if it has, then this method is being used.
- Other Ephemeris Solutions not in Firefox OS:
- EPO must be on a MTK or Intel chipset as this is MTK's proprietary AGPS Ephemeris Prediction
- AssisNow from u-blox
- HULA must be on a Broadcom chipset as this is Broadcom's proprietary AGPS Ephemeris Prediction
- XTRA - Must be on a Qualcomm chipset as this is QC's proprietary AGPS Ephemeris Solution
- SUPL
GPS
- Requires:
- outside location only
- best when outside away from buildings, having south side clear of buildings.
- no wifi around or wifi off
- cell data off
- don't define either SUPL nor XTRA servers in the gps.conf file nor in gaia pref.
- outside location only
- Accuracy:
- on a clear sky outside no buildings near by : 60% of the time should be 2 meter accuracy
- partial view of sky, i.e. buildings around, cloudy : lower
- inside in a building : 0. Nothing should be found
- AGPS server to speed up location finding; could potentially take 15 minutes.
Notes for Testing
- There was a patch that now caches queries, so we do not ping the server every 5 seconds for geolocation data.
- Shutting off wifi : (Bug 1014924)
- Expected: that shutting off wifi should shut off wifi scanning
- Actual: does not shut off wifi scanning, no change in geolocation because of this.
- When using mobile SIM:
- geolocation should scan cell towers and use data from active cell connection
- support for using multiple neighboring cells towers is not yet implemented (Bug 1032865)
- Test scenerios ( in conjunction to the testing above )
- location: urban, suburban, rural
- carriers
- countries
- Beta Tests:
- reboot phone
- gps with phone asleep
- switching between types of connections. ie turn on/off wifi, cell data on/off
- multiple sim scenario
- Real World:
- multiple locations such as jogging/hiking trail. (use in conjunction with logshake)
Additional tooling
Alexandre's patch for more logcat info: File:Debugging.zip
Existing Bugs
- Bug 1010282 - No geolocation support on CDMA/EVDO networks
Background info
Devices Specific information
Tarako
- Tarako doesn't have GPS and relies on MLS and GeoIP
- Some of the areas that may affect geolocation are:
- sim card : 0, 1, 2 sims (Bug 1014916)
- sim position for 1 sim
- wifi
- wifi throwing an exception
- wifi scanning
- Cell Tower Location 0, 1, 2, +
- type of SIM
- AWS SIM
- Some of the areas that may affect geolocation are:
- Note :
- normally geolocation doesn't work for AWS sim cards ; apparantly geolocation works with AWS sim card in Tarako
- iPhone 5C are first to support AWS
Technology Background Information
MLS
- http://www.wikiwand.com/en/Mozilla_Location_Service
- https://wiki.mozilla.org/CloudServices/Location/Software
- https://location.services.mozilla.com/
- https://location.services.mozilla.com/map#2/15.0/10.0