Vehicle Tracking System

Our software provides high performance and stability on the Amazon AWS stack. We use ElasticBeanstalk auto-scalable hosting solution and TCP traffic able load balancer to handle all requests from the devices. We used the MongoDB cluster for high-performance data recording and querying.

Vygandas Pliasas
by Vygandas Pliasas, 9 months ago, January 7th, 2022
Share if you like it

Server

Our software provides high performance and stability on the Amazon AWS stack. We use ElasticBeanstalk auto-scalable hosting solution and TCP traffic able load balancer to handle all requests from the devices. We used the MongoDB cluster for high-performance data recording and querying.

Communication with server

First, when the module connects to the server, the module sends its IMEI. First comes a short identifying number of bytes written and then goes IMEI as text (bytes). For example, IMEI 356307042441013 would be sent as 000F333536333037303432343431303133. The first two bytes denote IMEI length. In this case, 0x000F means, that IMEI is 15 bytes long. After receiving IMEI, the server should determine if it would accept data from this module. If yes, the server will reply to module 01, if not - 00. Note that confirmation should be sent as a binary packet. I.e. 1 byte 0x01 or 0x00. Then module starts to send the first AVL data packet. After the server receives the packet and parses it, the server must report to module number of data received as integer (four bytes). If the sent data number and reported by the server doesn’t match module resends sent data.

WEB interface
WEB interface

Devices

This solution is able to encrypt and decrypt packages that come with FMB120 - FMB140 modules.

Teltonika FMB140
Teltonika FMB140

The interface includes a modern fully-featured web interface with both desktop and mobile-friendly layouts.

Live Tracking

With our solution, you can view your GPS devices in real-time with no delay. We have various mapping options, including road maps and satellite imagery. The Server can handle a wide variety of sensors and additional information supplied by GPS units.

FMB120 Schematic
FMB120 Schematic
FMB120-wiring-scheme-3.jpg
FMB120-wiring-scheme-3.jpg

Alerts

The software provides instant web notifications along with support for email and SMS. This allows for external alerting in cases of harsh driving behavior like speeding, fuel and maintenance events, geo-fencing, and many other types of alerts.

WEB interface example
WEB interface example

Codec 8 support

Codec8 – a main FM device protocol that is used for sending data to the server.

Codec 8 protocol sending over TCP

TCP is a connection-oriented protocol that is used for communication between devices. The workings of this type of protocol is described below in the communication with server section.

AVL Data Packet

The below list represents the AVL Data Packet structure:

  • Preamble – the packet starts with four zero bytes.
  • Data Field Length – size is calculated starting from Codec ID to Number of Data 2.
  • Codec ID – in Codec8 it is always 0x08.
  • Number of Data 1 – a number that defines how many records is in the packet.
  • AVL Data – actual data in the packet (more information below).
  • Number of Data 2 – a number that defines how many records is in the packet. This number must be the same as “Number of Data 1”.
  • CRC-16 – calculated from Codec ID to the Second Number of Data. CRC (Cyclic Redundancy Check) is an error-detecting code used to detect accidental changes to RAW data. For calculation, we are using CRC-16/IBM.

Note: for FMB630, FMB640, and FM63XY, the minimum AVL record size is 45 bytes (all IO elements disabled). The maximum AVL record size is 255 bytes. The maximum AVL packet size is 512 bytes. For other devices, the minimum AVL record size is 45 bytes (all IO elements disabled). The maximum AVL packet size is 1280 bytes.

Longitude and latitude are integer values built from degrees, minutes, seconds and milliseconds by formula:

GPS decryption formula
GPS decryption formula

Where:

d – Degrees; m – Minutes; s – Seconds; ms – Milliseconds; p – Precision (10000000) If a longitude is in the west or latitude in the south, multiply the result by –1.

Note:

To determine if the coordinate is negative, convert it to binary format and check the very first bit. If it is 0, the coordinate is positive, if it is 1, the coordinate is negative.

Example:

Received value: 20 9C CA 80 converted to BIN: 00100000 10011100 11001010 10000000 first bit is 0, which means coordinate is positive converted to DEC: 547146368. For more information see two‘s complement arithmetic.

Spread the word! ♥

Like what you read?

Sign up for our newsletter and don't miss our latest articles!

Copyright 2021 Cortip, MB. All Right Reserved.