Skip to content

mls: Specifiy radio type for individual towers

Guido Günther requested to merge agx/geoclue:lte-radio-type into master

So i was wondering why my location was several 100km off when driving around but sometimes very accurate when i had bad reception (and hence the modem downgraded from 4G to 3G or 2G). Turns out we need to feed the radioType of the cell tower when on 4G:

Mozilla's API has a per tower radioType field¹. Without that filled in it will assume GSM and hence ignore the provided data in case of 4G with a locationAreaCode > 65535² and just fallback to GeoIP.

This changes the request from

    {"radioType":"gsm","cellTowers":[{"cellId":45622821,"mobileCountryCode":262,"mobileNetworkCode":3,"locationAreaCode":47260}]}
to
    {"radioType":"gsm","cellTowers":[{"cellId":45622821,"mobileCountryCode":262,"mobileNetworkCode":3,"locationAreaCode":47260,"radioType":"lte"}]}

and the returned result then matches the cell tower data from ³.

  1. https://ichnaea.readthedocs.io/en/latest/api/geolocate.html#cell-tower-fields
  2. See https://developers.google.com/maps/documentation/geolocation/overview#calculating_cell_id
  3. https://location.services.mozilla.com/downloads

Fixes 5d15b65e

Merge request reports