Skip to content

tgranqvist/fmb-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Teltonika GPS tracker server

Authorization

Each transaction with the FMB device is authorized: the devices sends its IMEI to the server. If The server wants to engage with the device, it sends back 0x01, if not, it sends 0x00.

Persistence

Sufficiently modern Redis with geo command set.

Codec8

Data format description here. AVL IDs here.

Coordinate format

coord integer = (d + m/60 + s/3600 + ms/3600000) * p

Where: d = degrees, m = minutes, s = seconds, ms = milliseconds, and p = precision 10000000

If longitude is in west or latitude in south, multiply result by –1. To determine if the coordinate is negative, convert it to binary format and check the very first bit. If it is 0, coordinate is positive, if it is 1, coordinate is negative (two's complement).

Development

You need a Redis server >= 3.2.0, for the Geo command set. On Windows, it's easiest to run it under Windows Subsystem for Linux.

Testing

This implementation successfully parses the example data from the Teltonika wiki. These can be sent with the excellent Packet Sender.

Example 1

One data record with one each IO element property (1 byte, 2 bytes, 4 byte, and 8 byte).

00 00 00 00 00 00 00 36 08 01 00 00 01 6B 40 D8 EA 30 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 05 02 15 03 01 01 01 42 5E 0F 01 F1 00 00 60 1A 01 4E 00 00 00 00 00 00 00 00 01 00 00 C7 CF

Example 2

One data record with one or two different IO element properties (1 byte, 2 byte).

00 00 00 00 00 00 00 28 08 01 00 00 01 6B 40 D9 AD 80 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 03 02 15 03 01 01 01 42 5E 10 00 00 01 00 00 F2 2A

Example 3

Two data records with one or more different IO element properties (1 byte, 2 byte).

00 00 00 00 00 00 00 43 08 02 00 00 01 6B 40 D5 7B 48 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 01 01 01 00 00 00 00 00 00 01 6B 40 D5 C1 98 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 01 01 01 01 00 00 00 02 00 00 25 2C

Other resources

Limitations

  • Only single tracker supported, for now
  • No validation of CRC checksum

Prior art and inspiration

About

A TCP server for Teltonika GPS trackers

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors