-- Leo's gemini proxy

-- Connecting to dece.space:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini;lang=en

Sharing GPS signal via Bluetooth on Android


This is my first note in the “solarpunk adventures” category. I want to delve more into technology content that matters to me, which is about radical ecology and fixing stuff.


My phone is a Xiaomi Redmi Note 7. For its price — around €200 in 2019 — it offers everything performance-wise I could ask from a phone, especially now that I got rid of MIUI to install LineageOS. But let's be honest, it's not the most reliable hardware: the left speaker died after a few months and a year ago the GPS became unable to fix itself accurately for more than a few seconds per minute, making it unusable as a car GPS and annoying when looking at maps. I thought I managed to fix the GPS issue after installing LineageOS and a GPS debug app (Xiaomi sometimes destroys GPS capabilities through updates because why not), but nah, RIP. While in the past this would have been a big reason to consider an upgrade, it's 2022 and we are solarpunks now. This phone will have to die in a lot of additional ways before it will be replaced!


I looked at alternatives for getting a GPS signal on my phone, and I can see three of them:


Fixing the GPS chip

Using an external GPS, though USB/Bluetooth/Wi-Fi

Using another phone as external GPS, as above


Providing GPS signal through USB or Bluetooth is a real thing. It seems to be a common subject on skipper/sailor forums, where people are looking for a reliable, external GPS to connect to a computer, where a phone GPS would not do the job this far from cities. It is not expensive (often less than $100) but not cheap either. I have an older phone lying around (Motorola Moto E5) with a smashed screen and missing buttons, but the GPS works fine so let's try to use it as an external GPS! 🛰


Setting up the “receiver”


This is the Xiaomi, with no GPS signal. An application will connect to the emitter phone through Bluetooth; I tried a few apps and the one that worked is called “GPS Connector” (de.pilablu.gpsconnector), which is sadly not FOSS — the only FOSS app I found was apparently too outdated to work on my phone.


GPS Connector on Google Play


On recent Android phones, you also have to select this app in the “Mock location app” settings in the developer options; these options need to be enabled beforehand, which is as easy as tapping some button like 7 times (really).


Setting up the “emitter”


This is the Motorala, with the functional GPS. We need to install an application on it that will transmit GPS data through Bluetooth. I pick Bluetooth here because it seems to be the most convenient. To be precise, the app should share NMEA data, which is a standard for sharing location data. It actually is older than the GPS technology itself! Look how rusty that website is!


https://www.nmea.org/


For the app, I picked “Share GPS” (com.jillybunch.shareGPS) which also is rusty, but provides plenty of options and a clean interface. There is a wizard to pair your phones, so start here, then configure a connection to provide NMEA over Bluetooth.


Share GPS official website, lots of interesting technical information

Share GPS on Google Play


Once you are set up, tap on the connection item to put it in listening mode, then you can try to connect from the receiver phone. Use a nice map application such as OsmAnd (net.osmand.plus) to verify if your location makes sense. GPS testing apps such as GPSTest (com.android.gpstest.osmdroid) will probably report your location without seeing the satellites themselves.


Also, it probably goes without saying for some of you but was a surprise to me: using a phone's GPS does not require you to have a SIM card installed! Data plans or cellular networks have nothing to do with the GPS chip and signal.


Testing


I've tested this while running with Trackbook (MIT licensed), an app tracking the distance ran without sending it to a dubious cloud. Works great! There are a few imprecisions due to relying solely on the GPS and not nearby Wi-Fi or Bluetooth beacons, but this is more than enough for tracking a run.


Trackbook on Github


I also tested the two new best friends in a 15 min drive with Waze (eh, know of a cool FOSS app for car directions?) and it works terrific! Great precision, it feels like there is zero latency with the location updates.


Conclusions


This is like merging two damaged phones into a fully operational one, how cool is that? So happy that this works! 👏


I plan to repair the Motorala and give it to someone else at some point, so I'll have to find another GPS source. Buying a used standalone GPS device with Bluetooth is tempting, as they apparently are usually better than the GPS chips found in phones and can be really cheap, but compatibility between devices is hit or miss from what I've gathered. We'll see! Thanks for hopping by.


References


“Using an External Bluetooth GPS Receiver with a Smartphone or Tablet”, some Google Doc by a California non-profit

“Sharing GPS via Bluetooth”, on The Linux Documentation Project

-- Response ended

-- Page fetched on Thu May 9 19:06:59 2024