-

Convert your Android into a GPS for Linux

Posted by Benoit Papillault on Jun 8, 2011 in Android

Problem description:

I want to use my Android phone as a GPS for my Linux laptop. Here is a way to do it :

  1. First, install BlueNMEA on your Android. Once launched, it listens on TCP port 4352 and sends NMEA strings to clients
  2. Next, make sure your laptop and Android phone are connected via TCP/IP (for instance, they might be connected to the same WiFi AP or the Android phone is acting as a WiFi AP itself). You can check this by doing : telnet 192.168.1.1 4352 (Note : 192.168.1.1 is the default IP of the Android phone when acting as a WiFi AP)
  3. Install gpsd on your laptop : aptitude install gpsd gpsd-clients. Since we are using gpsd 2.95, it can directly use the TCP/IP port. Otherwise, you need to use socat to relay data read from a TCP port to a special serial device : aptitude install socat ; socat TCP:192.168.1.1:4352 PTY,link=/tmp/gps
  4. Start gpsd manually : gpsd -N /tmp/gps or gpsd -N tcp://192.168.1.1:4352 (add -D 2 for debug to see NMEA sentences)
  5. Start xgps to show your position

Futher work :

  1. Display your position on google maps using HTML5 geolocation API
  2. Record your position with ms resolution and generate a KML file for Google Maps

Tags: ,

Copyright © 2024 Blog de Benoit Papillault ! All rights reserved. Theme by Laptop Geek.