|
|
| (13 intermediate revisions by the same user not shown) |
| Line 1: |
Line 1: |
| ==Device Info Packet Structure== | | == Binary Protocol Overview == |
| {| class="wikitable"
| |
| |-
| |
| ! colspan="5" style="background:#D3D3D3;" | Header Info Bytes
| |
| |-
| |
| ! Field !! Size (bits) !! Bit Range !! Description !! Breakdown
| |
| |-
| |
| | Start Character || 8 || 0–7 || Starting character $ (ASCII value 36) || $
| |
| |-
| |
| | Length || 12 || 8–18 || 2-byte length of the data following the header ||
| |
| |-
| |
| | No of Packets || 5 || 19–23 || NO of data Packets (always 1 with device info) ||
| |
| |-
| |
| | IMEI || 50 || 24–74 || Unique device identifier ||
| |
| |-
| |
| | Packet Type || 5 || 75–79 || Integer type:
| |
| * 00 - Device info Packet
| |
| * 01 - Alert Packet
| |
| * 02 - OTA Packet
| |
| * 03 - Error Packet
| |
| * 04 - Device configuration Packet
| |
| * 05 - IP configuration Packet ||
| |
| |-
| |
| ! colspan="5" style="background:#D3D3D3;" | Data
| |
| |-
| |
| | Time || 32 || — || UTC Timestamp (UTC time in seconds) ||
| |
| |-
| |
| | Time Zone || 8 || — ||
| |
| Timezone in quarter hours (e.g., 22 = +5:30).
| |
| Each unit = 15 minutes.
| |
| Value 22 = 22 × 15 min.
| |
| Range: -48 to 56.
| |
| Negative timezone in 2's complement. ||
| |
| |-
| |
| | ICCID || 160 || — || 20 Bytes, Character string || 8991000903297069053F
| |
| |-
| |
| | VID || 32 || — || 4 Bytes, Character string || TRAN
| |
| |-
| |
| | CELLULAR_MODULE_FV NAME || 40 || — || 5 Bytes, Character string || TSPJT
| |
| |-
| |
| | CELLULAR_MODULE_FV VERSION || 80 || — || 10 Bytes, Character string || XX.YY.ZZZZ
| |
| |-
| |
| | MCU_APP_MODULE_FV NAME || 40 || — || 5 Bytes, Character string || TSPJT
| |
| |-
| |
| | MCU_APP_MODULE_FV VERSION || 80 || — || 10 Bytes, Character string || XX.YY.ZZZZ
| |
| |-
| |
| | MCU_APP_MODULE_FV BUILD NO || 40 || — || 5 Bytes, Character string || YYDDD
| |
| |-
| |
| | VN || 80 || — || 10 Bytes, Character string || KL07CP8490
| |
| |-
| |
| | HWINFO || 88 || — || 11 Bytes, Character string || PCB-0220-AB
| |
| |-
| |
| ! colspan="5" style="background:#D3D3D3;" | Tail Info (2 Bytes)
| |
| |-
| |
| | End Character || 8 || 0–7 || Starting character * (ASCII value 42) || *
| |
| |-
| |
| | CRC || 8 || 8–15 || 8-bit XOR CRC of data from $ to * (excluding $ and *) ||
| |
| |}
| |
|
| |
|
| ==Telemetry Packet structure==
| | This is a custom binary protocol designed for communication between device and a server. It is used in scenarios like vehicle tracking, remote diagnostics, OTA (Over The Air) updates, and device configuration. Each packet is structured with a defined header, payload, and checksum for integrity. The payload structure varies based on packet type and purpose. |
| {| class="wikitable"
| |
| |-
| |
| ! colspan="5" style="background:#D3D3D3;" | Header (10 bytes)
| |
| |-
| |
| ! Field !! Size (bits) !! Bit Range !! Description !! Breakdown
| |
| |-
| |
| | Start byte || 8 || 0–7 || Starting character $ (ASCII value 36) || $
| |
| |-
| |
| | Data length || 12 || 08–19 || 2-byte length of the data following the header ||
| |
| |-
| |
| | Num of data packets || 5 || 20–24 || Number of packets (0–32) || 0–32
| |
| |-
| |
| | IMEI || 50 || 25–74 || Unique device identifier || e.g., 887744556677882
| |
| |-
| |
| | packet type || 5 || 75–79 || Integer type:
| |
| * 00 - Device Info Packet
| |
| * 01 - Alert Packet
| |
| * 02 - OTA Packet
| |
| * 03 - Error Packet
| |
| * 04 - Device Configuration Packet
| |
| * 05 - IP Configuration Packet
| |
| * 06 - Live ||
| |
| |-
| |
| ! colspan="5" style="background:#D3D3D3;" | Data (= 55 bytes × number of packets)
| |
| |-
| |
| | Packet Status || 1 || — || Type of packet ||
| |
| |-
| |
| | Frame Number || 16 || — || Frame number ||
| |
| |-
| |
| | AlertID || 8 || — || Alert identifier ||
| |
| |-
| |
| | Operator || 4 || — || Network operator || 00-Airtel, 01-BSNL, 02-VI, 04-JIO
| |
| |-
| |
| | Signal Strength || 5 || — || Signal strength || Integer (0–31)
| |
| |-
| |
| | MCC || 10 || — || Mobile country code || Integer
| |
| |-
| |
| | MNC || 6 || — || Mobile network code || Integer
| |
| |-
| |
| | Cell Id || 16 || — || Cell tower ID || Integer
| |
| |-
| |
| | Location Area Code || 16 || — || Location area code || Integer
| |
| |-
| |
| | Fix_status || 1 || — || GPS fix status || 0: No fix, 1: Valid Fix
| |
| |-
| |
| | Start byte || 1 || — || Latitude coordinate || Divide by 1,000,000 for float value
| |
| |-
| |
| | NS_Indication || 1 || — || N or S || 0: N, 1: S
| |
| |-
| |
| | Longitude || 29 || — || Longitude coordinate || Divide by 1,000,000 for float value
| |
| |-
| |
| | EW_Indication || 1 || — || East/West Indication || 0: E, 1: W
| |
| |-
| |
| | HDOP || 10 || — || Horizontal dilution || Divide by 10 for float value
| |
| |-
| |
| | PDOP || 10 || — || Position dilution || Divide by 10 for float value
| |
| |-
| |
| | Speed || 10 || — || Speed in km/h || Divide by 10 for float value
| |
| |-
| |
| | Altitude || 15 || — || Altitude in meters || Divide by 10 for float value
| |
| |-
| |
| | Power Status || 1 || — || Power connection status || 0: Power disconnected, 1: Power connected
| |
| |-
| |
| | Ignition Status || 1 || — || Ignition status || 0: OFF, 1: ON
| |
| |-
| |
| | Immobilizer Status || 1 || — || Immobilizer status || 0: OFF, 1: ON
| |
| |-
| |
| | Tamper || 1 || — || Wire Tamper detection || 0: Tamper clear, 1: Tamper alert ON
| |
| |-
| |
| | Supply Voltage || 6 || — || External battery voltage || Divide by 10 for float value
| |
| |-
| |
| | Internal Battery Voltage || 6 || — || Internal battery voltage || Divide by 10 for float value
| |
| |-
| |
| | Fuel SensorValue 1 || 16 || — || Fuel sensor value || Divide by 10 if float
| |
| |-
| |
| | Fuel Percentage 1 || 16 || — || Fuel level percentage || Divide by 10 for float value
| |
| |-
| |
| | Fuel SensorValue 2 || 16 || — || Fuel sensor value || Divide by 10 if float
| |
| |-
| |
| | Fuel Percentage 2 || 16 || — || Fuel level percentage || Divide by 10 for float value
| |
| |-
| |
| | Fuel SensorValue 3 || 16 || — || Fuel sensor value || Divide by 10 if float
| |
| |-
| |
| | Fuel Percentage 3 || 16 || — || Fuel level percentage || Divide by 10 for float value
| |
| |-
| |
| | Analog Input || 10 || — || Analog input || Divide by 10 for float value
| |
| |-
| |
| | Analog Input 1 || 10 || — || Analog input 1 || Divide by 10 for float value
| |
| |-
| |
| | Digital Input 1 || 1 || — || Digital input 1 || 0 or 1
| |
| |-
| |
| | Digital Input 2 || 1 || — || Digital input 2 || 0 or 1
| |
| |-
| |
| | Digital Output 1 || 1 || — || Digital output 1 || 0 or 1
| |
| |-
| |
| | Digital Output 2 || 1 || — || Digital output 2 || 0 or 1
| |
| |-
| |
| | Temperature sensor status 1 || 1 || — || Status of temperature sensor 1 || 1 if connected, 0 if not connected
| |
| |-
| |
| | Temperature 1 || 12 || — || Temperature in °C || Signed, divide by 10
| |
| |-
| |
| | Temperature sensor status 2 || 1 || — || Status of temperature sensor 2 || 1 if connected, 0 if not connected
| |
| |-
| |
| | Temperature 2 || 12 || — || Temperature in °C || Signed, divide by 10
| |
| |-
| |
| | Temperature sensor status 3 || 1 || — || Status of temperature sensor 3 || 1 if connected, 0 if not connected
| |
| |-
| |
| | Temperature 3 || 12 || — || Temperature in °C || Signed, divide by 10
| |
| |-
| |
| | Humidity || 8 || — || Humidity percentage ||
| |
| |-
| |
| | Odometer || 35 || — || Odometer value in meters ||
| |
| |-
| |
| | DateTime UTC || 32 || — || Timestamp || UTC time in seconds
| |
| |-
| |
| | TimeZone || 8 || — ||
| |
| Timezone in quarter-hours (e.g., 22 = +5:30).
| |
| Each unit = 15 mins.
| |
| Value 22 = 22 × 15 mins = 330 mins = +5:30
| |
| Range: -48 to 56, 2's complement ||
| |
| |-
| |
| ! colspan="5" "style="background:#D3D3D3;" | Tail
| |
| |-
| |
| | End Character || 8 || 0–7 || Starting character * (ASCII value 42) || *
| |
| |-
| |
| | CRC || 8 || 8–15 || 8-bit XOR CRC of data starting from $ to * (excluding $ and *) ||
| |
| |}
| |
|
| |
|
| ==OTA Packet structure== | | === Advantages of Binary Protocol === |
| {| class="wikitable"
| | * Compact (saves bandwidth) |
| |-
| | * Faster to transmit and parse |
| ! colspan="5" style="background:#D3D3D3;" | Header
| | * Suitable for constrained environments like cellular networks (2G/4G) |
| |-
| | |
| ! Field !! Size (bits) !! Bit Range !! Description !! Breakdown
| | === Comparison with Text Protocol === |
| |-
| | * No delimiters like commas, newlines, or JSON/XML formatting |
| | Start byte || 8 || 0–7 || Starting character $ (ASCII value 36) || $
| | * Cannot be inspected or parsed in a terminal without a decoder |
| |-
| | |
| | Data length || 12 || 8–18 || 2-byte length of the data following the header ||
| | == Packet Sending Modes == |
| |-
| | |
| | Num of data packets || 5 || 19–23 || Number of packets (0–32) || 0 - 32
| | The vehicle’s mode is determined using a combination of location data from the GPS module, accelerometer data from the LIS2DE12 sensor (Measures force/vibration from vehicle movement), and the ignition state. These inputs are used to classify the vehicle's current mode into one of the following: Motion Mode, Halt Mode, or Sleep Mode. |
| |-
| | |
| | IMEI || 50 || 24–74 || Unique device identifier || Integer type: e.g., 887744556677882
| | The device can be in any of the following modes: |
| |-
| | |
| | Packet Type || 5 || 75–79 || Type of packet ||
| | === Motion Mode (M) === |
| 00 - Device info
| | Motion Mode is activated when either of the following conditions is met: |
| 01 - Alert packet
| | * Linear Acceleration: The linear acceleration exceeds 0.5 m/s². |
| 02 - OTA pkt
| | * Speed: The vehicle’s speed exceeds the threshold of 10 km/h. |
| 03 - ErrorPacket
| | Only one of these conditions needs to be satisfied for the system to enter Motion Mode. This indicates that the vehicle is in motion. |
| 04 - Device configuration packet
| | |
| 05 - IP configuration packet
| | === Halt Mode (H) === |
| |-
| | Halt Mode is activated when both of the following conditions are satisfied: |
| ! colspan="5" style="background:#D3D3D3;" | Data
| | * Linear Acceleration: The linear acceleration is below 0.3 m/s². |
| |-
| | * Speed: The vehicle’s speed is below 10 km/h. |
| | OTA Source || 5 || — || Source of OTA ||
| | When both of these conditions are true, the system considers the vehicle to be stationary, hence entering Halt Mode. |
| 00 - OTA_SRC_SERIAL
| | |
| 01 - OTA_SRC_SMS
| | === Sleep Mode (S) === |
| 02 - OTA_SRC_IP_TRANSIGHT
| | Sleep Mode is triggered when the ignition is switched off. As soon as the ignition state changes to off, the system immediately switches to Sleep Mode to conserve energy. |
| 03 - OTA_SRC_IP_CUSTOMER
| | |
| |-
| | == Types of Packets & Packet Structure == |
| | Error status || 8 || — || Non-zero value indicates an error || NO ERROR = 0, ERROR = Non-zero value
| | |
| |-
| | * [[Device Info Packet]] |
| | Cell Number || 51 || — ||
| | * [[Telemetry Packet]] |
| First bit (MSB) with value 1 = number includes country code.
| | * [[OTA (Over-The-Air) Packet]] |
| If MSB = 0, number is without country code.
| | <!-- * [[Error Packet]] --> |
| Remaining 50 bits represent mobile number in integer format. ||
| | * [[Device Configuration Packet]] |
| Example: 400D6276ACF52 (+919784312658)
| | * [[IP Configuration Packet]] |
| |-
| |
| | Date & Time || 32 || — || UTC Timestamp || UTC time in seconds
| |
| |-
| |
| | Timezone || 8 || — ||
| |
| Timezone in quarter-hours (e.g., 22 = +5:30)
| |
| Quarter-hour increment = 15 minutes per unit
| |
| Range: -48 to 56 (2’s complement for negative) ||
| |
| Example: 22 = 22 × 15 = 330 mins
| |
| 330 ÷ 60 = 5.5 hrs = +5 hours 30 mins ahead of UTC
| |
| |-
| |
| | Command Length || 8 || — || Length of command string ||
| |
| |-
| |
| | Command || max 600 bits (75 bytes) || — || Input command with arguments, char array, terminated with null character ||
| |
| Example: SET CUIOCFG:IO1-DI-IGN*IO2_AN_GEN*IO3-DI-PBN*IO4-DO-IMB*
| |
| |-
| |
| | Response Length || 8 || — || Length of response string ||
| |
| |-
| |
| | Response || max 512 bits (64 bytes) || — || Response for particular command ||
| |
| Example: IOCFG:IO1-DI-IGN*IO2-AN_GEN*IO3-DI-PBN*IO4-DO-IMB*
| |
| |-
| |
| ! colspan="5" style="background:#D3D3D3;" | Tail
| |
| |-
| |
| | End Character || 8 || 0–7 || Starting character * (ASCII value 42) || *
| |
| |-
| |
| | CRC || 8 || Aug-15 ||
| |
| 8-bit XOR CRC of data starting from $ to *
| |
| (excluding $ and *) ||
| |
| |}
| |
| ==Error Packet== | |
| {| class="wikitable"
| |
| |-
| |
| ! colspan="5" style="background:#D3D3D3;" | Header (10 bytes)
| |
| |-
| |
| ! Field !! Size (Bits) !! Bit Range !! Description !! Breakdown
| |
| |-
| |
| | Start byte || 8 || 0–7 || Starting character $ (ASCII value 36) || $
| |
| |-
| |
| | Data length || 12 || 08–19 || 2-byte length of the data following the header ||
| |
| |-
| |
| | Number of data packets || 5 || 20–24 || Number of packets (0–32) || 0–32
| |
| |-
| |
| | IMEI || 50 || 25–74 || Unique device identifier || —
| |
| |-
| |
| | packet type || 5 || 75–79 || Type of packet || 02 – OTA Packet
| |
| |-
| |
| ! colspan="5" style="background:#D3D3D3;" | Data
| |
| |-
| |
| | Time || 32 || — || UTC Timestamp || UTC time in seconds
| |
| |-
| |
| | Time Zone || 8 || — ||
| |
| Time zone in quarter-hours (e.g., 22 = +5:30).
| |
| Quarter-hour increment means each unit represents 15 minutes.
| |
| The value 22 represents 22 quarter-hours. | |
| Ranges from -48 to 56, negative time zone to 2’s complement representation. ||
| |
| eg: 22 (+5:30)
| |
| 22 × 15 = 330 minutes = 5.5 hours = +5:30 UTC
| |
| |-
| |
| | Error Length || 8 || — || Length of Error string || ERROR DATA, LENGTH GIVEN
| |
| |-
| |
| ! colspan="5" style="background:#D3D3D3;" | Tail (2 bytes)
| |
| |-
| |
| | End Character || 8 || 0–7 || Starting character * (ASCII value 42) || *
| |
| |-
| |
| | CRC || 8 || 8–15 ||
| |
| 8-bit XOR CRC of data starting from $ to * (excluding $ and *) ) ||
| |
| |}
| |
Binary Protocol Overview
This is a custom binary protocol designed for communication between device and a server. It is used in scenarios like vehicle tracking, remote diagnostics, OTA (Over The Air) updates, and device configuration. Each packet is structured with a defined header, payload, and checksum for integrity. The payload structure varies based on packet type and purpose.
Advantages of Binary Protocol
- Compact (saves bandwidth)
- Faster to transmit and parse
- Suitable for constrained environments like cellular networks (2G/4G)
Comparison with Text Protocol
- No delimiters like commas, newlines, or JSON/XML formatting
- Cannot be inspected or parsed in a terminal without a decoder
Packet Sending Modes
The vehicle’s mode is determined using a combination of location data from the GPS module, accelerometer data from the LIS2DE12 sensor (Measures force/vibration from vehicle movement), and the ignition state. These inputs are used to classify the vehicle's current mode into one of the following: Motion Mode, Halt Mode, or Sleep Mode.
The device can be in any of the following modes:
Motion Mode (M)
Motion Mode is activated when either of the following conditions is met:
- Linear Acceleration: The linear acceleration exceeds 0.5 m/s².
- Speed: The vehicle’s speed exceeds the threshold of 10 km/h.
Only one of these conditions needs to be satisfied for the system to enter Motion Mode. This indicates that the vehicle is in motion.
Halt Mode (H)
Halt Mode is activated when both of the following conditions are satisfied:
- Linear Acceleration: The linear acceleration is below 0.3 m/s².
- Speed: The vehicle’s speed is below 10 km/h.
When both of these conditions are true, the system considers the vehicle to be stationary, hence entering Halt Mode.
Sleep Mode (S)
Sleep Mode is triggered when the ignition is switched off. As soon as the ignition state changes to off, the system immediately switches to Sleep Mode to conserve energy.
Types of Packets & Packet Structure