Convert your Android into a GPS for Linux
Problem description:
I want to use my Android phone as a GPS for my Linux laptop. Here is a way to do it :
- First, install BlueNMEA on your Android. Once launched, it listens on TCP port 4352 and sends NMEA strings to clients
- 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)
- 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
- 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)
- Start xgps to show your position
Futher work :
- Display your position on google maps using HTML5 geolocation API
- Record your position with ms resolution and generate a KML file for Google Maps