Intro to Danlaw TCP

Understanding TCP

Datalogger device messages sent over the DanlawTCP protocol are decoded into human-readable JSON events by the platform.

Knowing the types of TCP events that could come through the system allows you to write rules to capture the events you want to use in your application. This catalog lists every event type.

TCP Configurations

Unlike the UDP protocol, the Danlaw TCP protocol supports three different configurations, which affect the way data is collected, as well as the structure of resultant events.

The general properties of each Danlaw TCP configuration are listed below.

TCP Configuration


Relative Time

Trip start messages contain an absolute timestamp. All following messages contain an integer offset from the previous message; however, the platform converts to an absolute timestamp for each message.

Data Collection and Transmission

The frequency at which the device collects data is configurable for most data types. The frequency for message transmission is also configurable. Some configurations will only transmit data at the end of a trip. Some configurations will incrementally transmit data during a trip.

TCP Events Overview

Trip Start

Trip Start events are generated when a vehicle starts. The trigger for the trip start is typically related to a drop in voltage on the DLC, followed by engine RPM readings greater than zero. Devices in a non-OBD mode can detect a trip start using the accelerometer and GPS.

  • Trip Start Relative Time

Trip Data (Only Produced by Devices With Relative Time Configurations)

Trip data provides OBD-II PID readings at configurable intervals or triggers.

Trip Events

Trip events are produced when specific conditions are met in the vehicle. Hard Braking, Hard Acceleration, and Idling are examples of Trip Events.

  • Trip Event Relative Time

Trip End

Trip End events are typically triggered when engine RPMs drop to zero. Devices in non-OBD mode produce a Trip End event when GPS position is relatively static.

  • Trip End Relative Time

TCP "Heartbeat" Event

If no other activity has taken place, the device connects to the server a configured number of hours after its last connection to provide its location and assurance that it is still plugged in.

  "header": {...},
  "body": {
    "type": "DeviceHeartbeatEvent",
    "timestamp": "2018-04-17T13:58:29.098",
    "firmwareFile": "production-fw",
    "configurationFile": "production-cfg"
type (string) - `DeviceHeartbeatEvent` Indicates a type for this event.
timestamp (string) - ISO 8601-formatted time stamp showing when the event was produced. In this case, since it is a connection to the server, the timestamp is the same as the ingestion timestamp.
firmwareFile (string) - The name of the firmware file the device is currently running.
configurationFile (strig) - The name of the configuration file the device is currently running.