N900 GPS Reverse Engineering

(add information about my wireshark plugin)
m (update urls)
Line 80: Line 80:
[[User:sre|Sebastian Reichel]] writes a lowlevel library to access the N900's modem features and a wireshark plugin to analyze the packages. The information from above is currently only included in the Wireshark Plugin:
[[User:sre|Sebastian Reichel]] writes a lowlevel library to access the N900's modem features and a wireshark plugin to analyze the packages. The information from above is currently only included in the Wireshark Plugin:
-
* [https://elektranox.org/n900/images/wireshark/04.png Screenshot]
+
* [http://elektranox.org/n900/images/wireshark/04.png Screenshot]
-
* [https://git.ring0.de/libisi/tree/wireshark-plugin Plugin]
+
* [https://git.ring0.de/isi-wireshark-plugin/ Plugin]
[[Category:N900 Hardware]]
[[Category:N900 Hardware]]

Revision as of 23:50, 15 January 2011

acquire packets like:

strace -p $(pidof location-daemon) -e read=6 2>&1|grep '| 000'

alternatively you can capture them from the network interface, but this will include other modem information:

tcpdump -i phonet0 -s 0 -w phonet.cap

Contents

Packet Graph

| 00000  00 92 01 00 00 00 00 xx  05 00 00 00 09 03 00 10
         S------------------- T4  DL S-------------------
| 00010  07 da 07 15 00 xx xx 00  xx xx 00 00 09 02 00 1c
         S------------- TL TS --        S----------------
| 00020  xx xx xx xx xx xx xx xx  00 00 xx xx 00 00 08 8b
         DL---       DL--- TS     S----       S---- ^eph^
| 00030  xx 00 xx xx xx xx xx xx  09 04 00 14 62 7e xx xx
            S- DL TS---    DL MS  S---------- track SS---
| 00040  xx xx 00 xx xx xx 00 xx  00 xx 00 00 09 05 00 74
         DL--- S-    TL    S- DS  S- DS S------------- DL
| 00050  09 00 00 00 00 02 xx xx  00 xx xx xx xx xx 00 00
         DL S---------- T4--- MS  S- TS--- I  TS MI S----
| 00060  00 04 xx xx xx xx xx xx  xx xx 00 00 00 xx xx xx
         S- T4 T3 TS S- TL TS MS  TS MD S------- T4 TS---
| 00070  00 xx xx xx xx xx 00 00  00 xx xx xx 00 03 xx xx
         S- TS--- I  TS MS S-------- T3 MS MS S- DL TS MS
| 00080  xx xx 00 00 00 xx xx xx  00 xx xx xx xx xx 00 00
         TS MD S------- T3 TS MS  S- TS--- MS TS MI S----
| 00090  00 xx xx xx 00 03 xx xx  xx xx 00 00 00 xx xx xx
         S- TS------ S- DL TS MD  TS MS S------- TS SS+TS
| 000a0  00 xx xx xx xx xx 00 00  00 xx xx xx 00 xx xx xx
         S- TL TS MS TS MD S-------- TS------ S- TL TS MI
| 000b0  xx xx 00 00 00 xx xx xx  00 xx xx xx xx xx 00 00
         TS--- S------- TS--- MS  S- TS--- MI TS MS S----
| 000c0  09 08 00 0c xx xx xx xx  xx xx xx xx
         DL----------------------------------

Key

  • S = Static, unchanging normally
  • MS = Mostly static, varying in value normally slightly
  • SS = Sometimes static, completely different values sometimes
  • I = Incrementing
  • MI = Incrementing, but not every packet
  • D = Decrementing
  • MD = Decrementing, but not every packet
  • TS = Time-sensitive; changes over (short) durations of time
  • TL = Time-sensitive, longer duration
  • T3 = "
  • T4 = ", overnight
  • DS = Distance-sensitive; changes over at least 30m distance
  • DL = Distance-sensitive, like across the world

Packet Analysis

  • ??? = mode: The mode of the fix
  • ??? = fields: A bitfield representing which items of this tuple contain valid data
  • 00 = ISI sequence ID (seems to be always 0 for GPS)
  • 01 = GPS Data Opcode (0x92)
  • 10,11 = time year
  • 12 = time month
  • 13 = time day
  • 15 = time hour
  • 16 = time minute
  • 18,19 = time seconds and milliseconds (in milliseconds)
  • 1a,1b = *probably* ept: Time accuracy, but *always* 0, so no way to verify
  • 20,21,22,23 = latitude / 360 * 256*256*256*256
  • 24,25,26,27 = longitude / 360 * 256*256*256*256
  • 28 =
  • 2b,2c = 0590-12a9 (hex)
  • 2e,2f = eph (cm)
  • 30 =
  • 32,33,,36,37 = altitude; ((p32;33) - (p36;37)) / 2 = meters
  • (34?,)35 = (double epv: Vertical position accuracy) * 2
  • 3c,3d = track: Direction of motion in hundredths of a degree
  • 3e,3f = epd: Track accuracy (in hundredths?)
  • 42,43 = speed, in centimetres per second
  • 44,45 = eps: speed accuracy, in centimetres per second
  • 46,47 = climb: Current rate of climb in cm/s
  • 48,4a = epc: Climb accuracy, in cm/s

Wireshark

Sebastian Reichel writes a lowlevel library to access the N900's modem features and a wireshark plugin to analyze the packages. The information from above is currently only included in the Wireshark Plugin: