microg / GmsCore

Free implementation of Play Services
https://microg.org
Apache License 2.0
8.35k stars 1.71k forks source link

How does "Request from hotspot" inside location settings work? #2414

Closed lucasmz-dev closed 1 month ago

lucasmz-dev commented 3 months ago

Sorry, not so much a development question, but it's a bit unclear.

Currently, under microG > Location there's an option called "Request from Hotspot". This mentions that microG can get a location from hotspots directly.

But it's unclear how you can tell if

  1. your device supports this (and if it even needs to)
  2. the hotspot supports this

Is this part of some standard? Which one exactly? I remember watching some presentation about Android on how certain devices (I presume to be hotspots) help with precision down to the meter, but I'm not sure if that's the same thing and I'm a bit confused here.

joelkoen commented 3 months ago

Not 100% sure, but I think microG can source location data from certain hotspots like on planes. Certain planes offer HTTP APIs that allow you to get location information.

https://github.com/microg/GmsCore/blob/991da7bdd172add5eb664a4d713ca53513d5d5f3/play-services-location/core/provider/src/main/kotlin/org/microg/gms/location/network/wifi/MovingWifiHelper.kt#L314C1-L314C70

mar-v-in commented 3 months ago

Yes. This works in the WiFi of some buses, trains and planes. Whenever I can get access to such a system I will try to add it to the list of supported WiFis.

For those WiFis we can't use traditional WiFi-based positioning as the WiFi location is non static. We thus remove these WiFi from the usual location logic and if possible and enabled try to retrieve location from the API of the WiFi itself.

ale5000-git commented 3 months ago

@mar-v-in Is it possible to also add support to get location using "Wi-Fi location: ranging with RTT"? https://developer.android.com/develop/connectivity/wifi/wifi-rtt?hl=en This allow to get accurate location indoor.

Note: The requesting device doesn't need to connect to the access points to measure distance with Wi-Fi RTT

mar-v-in commented 3 months ago

I'd love to, but there is only a small number if business WiFi AP that support it (at least last time I checked) and I don't know anyone with a device I could use for testing. Also I don't know how useful it will be in practice.

ale5000-git commented 3 months ago

For example: With this accuracy, you can develop fine-grained location-based services, such as indoor navigation, disambiguated voice control (for example, "Turn on this light"), and location-based information (for example, "Are there special offers for this product?"). Also in shopping centers apps that use augmented reality will need precise location.

ale5000-git commented 3 months ago

I have FRITZ!Box 7530 + FRITZ!Repeater 3000, I'm not sure how to check if it is supported, do you know?

mar-v-in commented 3 months ago

If there's no setting in your router admin interface to enable it or configure its Geo coordinates, it's likely not supported. The reason why most AP won't support it is that you need at least 2 AP to be able to locate properly and most consumer devices don't target that setup.

ale5000-git commented 3 months ago

I don't see the option but FRITZ!Repeater 3000 contains three wireless radio units alone + the ones inside FRITZ!Box 7530.

mar-v-in commented 3 months ago

Google has published this list: https://developer.android.com/develop/connectivity/wifi/wifi-rtt#supported-aps It's probably incomplete, but still shows it's rarely supported. This is specifically for AP that support FTM (to measure distance) and LCI/LCR data (to announce own geocoordinates). There are more AP that support FTM without announcing it, but I don't think that will help us a lot here.

ale5000-git commented 3 months ago

If in the future I will get something that support it I will contact you. In the meantime I hope that there will be other people that already have one of these devices and want to help.

ale5000-git commented 3 months ago

@mar-v-in Instead of just guessing, is there an app for Android that list nearby devices and detect directly if they support it or not?

Sapiosenses commented 3 months ago

If in the future I will get something that support it I will contact you. In the meantime I hope that there will be other people that already have one of these devices and want to help.

I found some links for you below, including some not crazy expensive supporting H/W.

Personally I think given this protocol has been around for ~6 years now and you hardly ever hear about it, I don't think it's exactly taking the world by storm. To me the best use-case would seem to be things like robotic factories and warehouses.

The people talking about retail usage where they track everyone walking around a store, or corpos tracking employees around the office etc creeps me out tbh. It's bad enough with BT beacons.

https://people.csail.mit.edu/bkph/WifiRttScanX

https://www.netspotapp.com/blog/wifi-standards/what-is-wifi-rtt.html

https://medium.com/@darryncampbell_83863/indoor-positioning-with-wifi-rtt-and-google-wifi-a638f1147b84

https://www.inpixon.com/technology/standards/wifi

https://www.cnx-software.com/2018/09/05/compulab-wild-wifi-rtt-router-802-11mc/

mar-v-in commented 1 month ago

Closing here, as there is nothing actionable and the question is answered.