Courtesy of the best startup in the world, I just got a Sprint Mobile USB modem (Sierra Wireless 598U). Of course, once you get a new toy, you have to try it out, so on the way back home, I plugged it in and experienced the novelty of surfing the web while on a moving train. One of the options intrigued me -- it said "click to start NMEA."
What's NMEA, I wondered? Turns out it's a
data specification for GPS, sonar, and other devices defined by the National Marine Electronics Association. Even better, it turns out you can actually read data directly from this device from the terminal window:
[vincentc@local ~]$ cat /dev/cu.sierra05
$GPGSV,3,1,10,03,42,254,29,06,45,240,28,09,18,060,24,14,65,180,26*77
$GPGSV,3,2,10,18,38,057,35,21,29,119,32,22,68,014,29,26,73,097,36*74
$GPGSV,3,3,10,27,14,049,18,19,39,293,*76
$GPGGA,030642.4,3725.433133,N,12207.936951,W,1,09,1.3,-13.2,M,,,,*0D
$GPVTG,,T,,M,0.0,N,0.0,K,N*2C
$GPRMC,030642.4,A,3725.433133,N,12207.936951,W,0.0,,241109,,,A*5B
$GPGSA,A,3,03,06,09,14,18,21,22,26,27,,,,2.1,1.3,1.6*36
$PSTIS,*61
....
Each of the lines begins with a code whose meaning can be looked up
here. Pretty neat! Seems like it wouldn't be too hard to write a script to parse all of the information. For instance, the two most interesting ones are:
- $GPGSV tells me which GPS satellites are currently in view
- $GPGGA tells my current location (3725.433133,N,12207.936951,W or 37d 25.433133' N latitude, 12d 207.936951' W longitude), along with my current altitude
Already pretty interesting and rich data --- not sure exactly what this could be used for, but it's definitely interesting stuff ... and I imagine there could be tons of interesting applications to be made around this data.