4

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

2 Answers 2

5

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.

2
  • Thank you. Will this make the output usable in other programs which require GPS? Commented Jun 1, 2019 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. Commented Jun 2, 2019 at 11:47
0

more alternatives:

see also this question

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.