3

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

Kodeeo
  • 223
  • 5
  • 14

2 Answers2

4

Requirements:

  1. In PC, install adb package with sudo apt install adb. Or download it directly from this link.
  2. In Android, enable Developer options and USB debugging.
  3. Connect Android with USB cable, run adb devices in terminal, allow USB debugging prompt in phone.

image

Procedure:

  1. In Android, enable GPS. Then open Settings > About Phone > tap five times on Kernel version > Single Item Test > GPS.
  2. In PC, Open terminal in PC. Clear all previous log with adb logcat -c
  3. 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"

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:

see also this

eadmaster
  • 1,573
  • 4
  • 18
  • 30