Debian – How to get GPS data from Android phone to Debian

androiddebianlinuxsmartphone

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

Best Answer

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.

Related Question