TrackBox Protocol

TrackPing Call

TrackBoxes do a plain HTTP-POST  (no HTTPs*) to push their box location and TrackPing data to your server.

TrackBox expects a HTTP-200 reply if your server was able to receive the data. As long as it does not receive a HTTP-200 reply, the TrackPing data will be stored and retried endlessly every 10 seconds. If your server replies HTTP-503 "Service Unavailable" the next call will be delayed for one full minute.

URL/Forwarding

Your server can:

  1. Be directly called by a track box. The URL of this must be configured on the Track Box manually, check configuration for Passive and Active. The base part includes every character up to and including the "?". It can be a maximum of 89 characters including the "?".
  2. Be called by our server in a simple call forwarding scheme. This is used if the data should also be available for time keeping purposes. The user must configure forwarding in RR12 timing module. Be aware, that a HTTP 503 reply to our server will just delay the retry of the current call from our server to yours using expontial backoff. New data from that box and data from other boxes will still be forwarded immediately. If a call is repeatedly answered with a 503 status code for ~24 hours (~30 calls), it will be droped by our server.

Typical Call with moving position and TrackPings

/trackping?v=2&custId=10000&boxId=T-20034&boxType=PTrack&boxName=NikiasV10EU%5FTESTBOX&boxTime=210827T110003Z&boxPos=M,49.05802,008.47133,105&index=1&count=10&dataIndex=0&auth=13953
ZCTAA66;22;-40;15;92832;;;;20;-90;\r 
ZCTAA55;22;-42;19;157302;;;;18;-80;\r 
ZCTAA53;22;-53;15;113108;;;;17;-77;\r 
ZCTAA62;22;-42;21;91281;;;;16;-76;\r 
ZBAAA48;15;-71;5;80109;;;;13;-77;\r 
ZCTAA66;22;-50;15;92832;;;;11;-70;\r
ZCTAA55;22;-42;19;157302;;;;10;-76;\r
ZCTAA53;22;-63;15;113108;;;;9;-70;\r
ZCTAA62;22;-42;21;91281;;;;6;-50;\r
ZBAAA48;15;-71;5;80109;;;;3;-77;\r
\r

HTTP Post Parameters

v

required

protocol version (currently 2).

custId

required

Customer ID - can be set by the customer to any 6 digit ID. Will normaly be his rr customer ID.

boxId

required

Serial number of the calling device including the prefix for hardware type. TrackBoxes start at T-20000.

boxType optional Type of hardware that generated this data. Possible values are {ATrack, PTrack, Timing}.
Defaults to ATrack if omitted.
boxName optional

Name of the box. Standard names could be START, FINISH, SPLIT, 5K, 10K, HALFM ... can be configured by user.
Can be omitted if not set by user.

boxTime

required

Current time of TrackBox in the moment of calling the http post.
YYMMDDTHHMMSSZ where T is a fixed separator between date and time and Z stands for UTC+0 (=Zulu).

boxPos
 Flag
 Lat,Lon
 Altidude

required

Flag,Latitude,Longitude,Altitude of the Box at the moment of calling the HTTP-POST
Examples: 

boxPos=U
boxPos=S,49.01469,008.52240
boxPos=M,49.01469,008.52240,226
boxPos=T,49.01469,008.52240,226
boxPos=X,49.01469,008.52240,226

 

Flag: String indicating different information about this trackping 
  U => Box position is unknown - long, lat, alt values are omitted( ...&boxPos=U&...)
  S => Box was stationary within the last minute 
  M => Box was moving within the last minute
  T => Box was traveling with at least 5km/h within the last minute
  X => Position may be not accurate anymore (moved since last gps fix)

GPS location:
  Latitude, Longitude in the standard google format of DD (Decimal degrees).
Altitude(optional): 

  Altitude of box in meter (be aware that this can be negative more often than you think! See MSL vs WGS84). Altitude is an optional parameter and can be omitted.

cell optional

Current cell ID of TrackBox. Can be omitted if GPS position is available.

lac

optional

Current network area code of TrackBox. Can be omitted if GPS position is available.

 

index 

required

Index of this call. Restarts from 1 when Track Box boots. Counts up with every call that a box tries to post to a server (even if then the call is not successful - eg returns HTTP 200). Can be used to reset a "file" logic on server and gaps in index indicate that there have been unsuccessful calls.

count

required

Number of Trackpings in this call
dataIndex  optional Index of first trackPing in this call. Resets to 0 on reboot. Will be omitted if count==0. Will always be last calls dataIndex + count and unique during runtime of a TrackBox. This can be very usefull to identify copies of data in the case that the box repeats data in a new call because it did not receive an HTTP 200 on the last call. Starts with dataIndex=1 on the first call after boot and first call after change of TrackCallPingURL or CustomerID.
auth optional Key to authenticate that the calling box is genuine RACE RESULT equipment. Please contact RACE RESULT for further information.

HTTP Post Body TrackPing Record

 

Multiple TrackPings of a transponder are reduced to one TrackPing record. See data reduction algorithm below for more details. Every line represents one TrackPing record and is delimited by a <carriage return>. The last is always an empty line with one <carriage return>. This indicates the end of the call and is the only content sent in an empty TrackPing call.

 

Each row seperated by semi-colon represents one data field. Data fields can be empty meaning that they default to 0 if they are numeric.

 

[transponderId];[peakDiffTime];[peakRSSI];[hits];[peakIndex];[flags];[latitudeDiff];[longitudeDiff];[minDiffTime];[minRSSI];[orderID]\r

Data fields:

transponderId

required Unique Transponder Identifier

peakDiffTime

required

Seconds between the moment of peak RSSI and current boxTime. The higher the value, the more in the past.
To get the true time of this TrackPing you need to calculate peakTime = boxTime - peakDiffTime
Active TrackPings are rounded to full seconds. Passive TrackBoxes and Timing Devices may report fractional seconds with a colon as decimal separator (23.345 would be 23 seconds and 345 thousands). This value can not be negative.

peakRSSI

required

RSSI value at peak signal strength in dBm (a value of -55 means -55dBm).

hits

required

Counter for number of TrackPings collected for this set of data.

peakIndex
 

optional

TrackPingIndex of the TrackPing at peak RSSI. This index is counted up and stored inside transponder for every TrackPing sent out. It is unique per transponder and can help to identify unique TrackPings received by multiple TrackBoxes.

positionFlag

optional

Char indicating position information about the Box at the time of recording this TrackPing record
U => Box position was unknown while capturing this TrackPing record
M => Box was moving within the last minute
T => Box was traveling with at least 5km/h within the last minute of capturing this track ping and therfore the moving box algorithm was used
X => Position may be old (moved since last gps fix)
;; defaults to S => 
Box was stationary while capturing this TrackPing record

peakLatitudeDiff

optional

Latitude of TrackBox at the moment of receiving the peak RSSI TrackPing relative to boxPos in 1/100000 of a degree. The more positive the value, the more the TrackPing position was to the north of current boxPos. To get the true latitude of this TrackPing you need to calculate lat = boxPos.latitude + peakLatitudeDiff/100000.

peakLongitudeDiff

optional

Longitude of TrackBox at the moment of receiving the peak RSSI TrackPing relative to boxPos in 1/100000 of a degree. The more positive the value, the more the TrackPing position was to the east of current boxPos. To get the true latitude of this TrackPing you need to calculate lon = boxPos.longitude + peakLongitudeDiff/100000.

minDiffTime

optional

Seconds between the moment of minimum RSSI and current boxTime. The higher the value, the more in the past. To get the true minimum time of this TrackPing record you need to calculate minTime = boxTime - minDiffTime.

minRSSI 

optional

RSSI value at minimum signal strength in dBm (a value of -55 means -55dBm).

 
OrderID  optional orderID of a Passive Passing

Optional values can be left empty, but semicolons must always be present to assure future version compatibility. A typical case would be data from a non moving timing system with flags and all following values missing.

 

HTTP Post Responce Body

A server can call commands on the box by putting them into the HTTP Post Response Body. See status call documentation for formating and possible commands.

Example (Stationary Timing System):

[transponderId];[peakDiffTime];[peakRSSI];[hits];

/trackping?v=2&custId=012345&boxId=D-5061&boxType=Timing&boxName=Start&boxTime=171024T144243Z&boxPos=S,49.01464,008.52243&count=2
224;62.345;-63;55;;;;;;\r
3465;22.123;-64;76;;;;;;\r
\r

Example (Moving->Traveling TrackBox):

/trackping?v=2&custId=012345&boxId=T-20061&boxName=test&boxTime=171024T144243Z&boxPos=M,49.01469,008.52240,226&count=4
ZBAAA48;12;-34;6;79834;M;1;-1;19;-40\r
ZCTAA55;12;-44;18;156766;M;1;-1;15;-60\r
ZCTAA62;16;-72;15;90739;T;1;-1;11;-80\r
ZCTAA53;13;-77;5;112570;T;1;-1;8;-85\r
\r

Example (Moving TrackBox, no new GPS fix at the begining)

/trackping?v=2&custId=012345&boxId=T-20061&boxName=test&boxTime=171024T144219Z&boxPos=M,49.01470,008.52239,225&count=7
ZCTAA66;24;-45;31;92226;X;-10;;18;-50\r
ZCTAA55;23;-33;31;156696;X;-10;;16;-40\r
ZCTAA53;24;-45;39;112501;X;-10;;13;-60\r
ZCTAA62;24;-46;40;90675;X;-10;;13;-50\r
ZBAAA48;23;-41;15;79799;X;-10;;11;-45\r
ZCTAA66;9;-18;17;92254;M;;;9;-18\r
ZCTAA55;10;-8;12;156723;M;;;8;-28\r
\r

Example (Passive TrackBox, no GPS)

http://rrsproxy.raceresult.com:48080/v1/trackping?v=2&custId=10000&boxId=T-20003&boxTime=200129T110044Z&boxPos=U&cell=B876&lac=118D703&index=603&count=8&auth=04883
8787;1.7;-55;3;;U;;;;;12345\r
8788;1.6;-55;2;;U;;;;;12345\r
8789;1.6;-55;2;;U;;;;;12345\r
8790;1.5;-55;3;;U;;;;;12345\r
8791;1.5;-55;2;;U;;;;;12345\r
8792;1.4;-55;3;;U;;;;;12345\r
8793;1.4;-55;2;;U;;;;;12345\r
8794;1.3;-55;2;;U;;;;;12345\r
\r

Example (empty call):

/trackping?v=2&custId=012345&boxId=T-20061&boxName=test&boxTime=171024T144245Z&boxPos=M,49.01469,008.52240,226&count=0
\r

HTTP Post Header

POST HTTP/1.1
Accept: */*
User-Agent: QUECTEL_MODULE
Connection: Keep-Alive
Content-Type: application/x-www-form-urlencoded

*HTTPS/AUTH Parameter

HTTPs is no option for multiple reasons:

Plain HTTP is allowed by most networks around the world.

HTTPs would need additional negotiation leading to increased battery drain. TrackBoxes only have limited capacity and we want it to run for 3 days. It completely shuts down its communication, as long as it is not transmitting anything. For placing a call it connects to the network and disconnect within 100ms again. Communication is what costs energy, it must be done as quick as possible.  

Furthermore: Whats missing in this diagram, is that one also needs to contact the certifying third party server to verify the certificate.

Furthermore HTTPs does not really give us a big benefit as it is actually not authenticating the calling client, but your server. Encryption would be nice, but the data is not really worth anything without context.

We need to make sure not to open up the server for everyone to call and push data. Thats why you can authenticate the calling device using the auth parameter. Contact RACE RESULT to obtain the public key and algorithm with which you check wether the call is coming from a genuine RACE RESULT device or not.

Interpreting RSSI Values

Passive Passing

Typical Values

-40dBm for a very close by Transponder

-80dBm for a barely detected Transponder


Active TrackPing

Typical Values

-40dBm or better, for a transponder very close by

-90dBm for a barely detected transponder 

Data Reduction Algorithm

To reduce the amount of data, the TrackBox does the following with each TrackPing it receives:

  1. If transponder unknown, create a new entry in internal short term list with minRSSI=peakRSSI both set to the first RSSI received
  2. If transponder known and new RSSI < minRSSI -> overwrite minRSSI and minDiffTime
  3. If transponder known and new RSSI >= peakRSSI -> overwrite peakRSSI (+ update all other Data like flags, index and location)

Every second the short term list is searched for entries where (neither minRSSI, nor peakRSSI have been updated within the last 10s) OR (which have been recorded for 30s or more). Those entries are taken off the short term list and stored in the internal buffer for further transmission to server.

Goal: Detect and report every minimum and every maximum while not transmitting more data than necessary.

Typical Data of a slow passing resulting in 3 calls (with each a min an max value, giving us 6 values in total):

TrackPing RSSI vs Distance

Important: RSSI is a very very rough measure for distance. Local effects around the transponder let it vary significantly. A weaker RSSI does NOT AUTOMATICALLY MEAN, that the transponder is far away.

But: A strong RSSI does mean, that the transponder must be close by. A very rough calulation for maximum distance based on RSSI can be done with this graph:

Example. If a RSSI of -57dBm is reported, it is very likely that the transponder is within 10m or closer. 

Changes from Active TrackBox to Passive TrackBox

Some small changes were made with the introduction of the Track Box (Passive) as follows. 

  • New boxType PTrack
  • Times now sent with a decimal point
  • OrderID added to each record

The protocols has been adapted to be backwards compatible. You  should not need to update your software as long as you do not need the OrderID.