I want to use my phone as a GPS receiver on Debian. I can connect the phone via usbc and wifi, but I have no Bluetooth on the pc. Anyone can explain how to get GPS data from the phone? The best thing would be have it recognized as a GPS receiver
Asked
Active
Viewed 1,552 times
2 Answers
4
Requirements:
- In PC, install adb package with
sudo apt install adb. Or download it directly from this link. - In Android, enable Developer options and USB debugging.
- Connect Android with USB cable, run
adb devicesin terminal, allow USB debugging prompt in phone.
Procedure:
- In Android, enable GPS. Then open Settings > About Phone > tap five times on Kernel version > Single Item Test > GPS.
- In PC, Open terminal in PC. Clear all previous log with
adb logcat -c To filter out the GPS logs only, run any of the command below:
- For all GPS related logs:
adb logcat | grep -i gps - For GPS tag:
adb logcat "*:S Gps_test_Activity"
- For all GPS related logs:
The output will show 1. Number of Satellites (num) 2. Satellite ID (prn) 3. Elevation 4. Azimuth. For further filtering, use grep, awk, sed tools.
Biswapriyo
- 718
- 2
- 6
- 20
-
Thank you. Will this make the output usable in other programs which require GPS? – Kodeeo Jun 01 '19 at 15:07
-
@Kodeeo If a program need Latitude and Longitude the it has to be calculated from Azimuth and Elevation. Or use Location class from Android API. – Biswapriyo Jun 02 '19 at 11:47
0
more alternatives:
- using the Geoclue service + GeoclueShare app
- using the
gpsdservice + BlueNMAE app
see also this
eadmaster
- 1,573
- 4
- 18
- 30
