Twig protocol

Protocol used by personal GPS tracking devices manufactured by Twig Com Ltd headquartered in Finland.
flespi parses the Twig protocol messages into a JSON object with the fields listed below in the Parameters tab.

To connect your tracker using the Twig protocol, you need to have a twig channel created first.

Point your tracker to the channel's domain name:port via SMS or configuration tool provided by the vendor.

Then create a device instance for your tracker and use the last 8 characters of device's IMEI (IMEI is usually specified on the tracker casing) in the ident field.

Use the Toolbox tab on the device screen to check if the messages are coming.

alarm.mode.status
boolean
Device alarm mode status
anchor.distance
number
meters
Distance to anchor/area center
battery.level
number
percentage
Internal battery level
battery.temperature
number
celsius
Battery temperature
battery.voltage
number
volts
Internal battery voltage
ble.beacons
array
Standard parameter names used: *id* - beacon identification string. Usually it is beacon's UUID or MAC-address *local_name* - Beacons's Local Name *rssi* - BLE signal level. Units = dBm *battery.voltage* - Beacon's battery voltage. Units = volts *battery.level* - Beacon's battery level. Units = percentage *temperature* - Beacon's temperature. Units = celsius *humidity* - Beacon's humidity. Units = percentage
channel.id
number
ID of channel that received a message
device.firmware.version
string
Firmware revision
device.id
number
ID of device that received a message
device.imei
string
IMEI of the device
device.model
string
Device model ID string
device.name
string
Name of device that received a message
device.type.id
number
ID of device type of device that received a message
emergency.alarm
boolean
Emergency alarm event triggered
error.type
number
Protocol-specific error identification number
event.code
string
Protocol-specific event code string
event.enum
number
Protocol-specific event code
event.seqnum
number
Unique event sequence number
gnss.type
string
GNSS type: gps, glonass, etc...
gps.module.version
string
GPS module version
gsm.cellid
number
Mobile network (GSM, 3G, 4G, LTE, 5G, ...) base station ID
gsm.firmware.version
string
Mobile network (GSM, 3G, 4G, LTE, 5G, ...) module firmware version
gsm.lac
number
Mobile network (GSM, 3G, 4G, LTE, 5G, ...) location area code
gsm.mcc
number
Mobile network (GSM, 3G, 4G, LTE, 5G, ...) country code
gsm.mnc
number
Mobile network (GSM, 3G, 4G, LTE, 5G, ...) code
gsm.network.type
string
The type of the Mobile network the device is currently registered to
gsm.pcid
number
Physical layer Cell ID in the Mobile network (LTE and NR)
gsm.signal.dbm
number
dbm
Strength of the Mobile network (GSM, 3G, 4G, LTE, 5G, ...) signal
gsm.signal.level
number
percentage
Mobile network (GSM, 3G, 4G, LTE, 5G, ...) signal strength level
ident
string
Device unique identifier like serial number, IMEI, etc
message.content
string
Message content
message.detail
string
Message detail
message.type
string
Message type
modem.name
string
Name of the modem
network.signal.rsrp
number
dbm
LTE reference signal received power (RSRP)
normal.mode.status
boolean
Normal mode status
peer
string
IP:port from which device connecting to the channel
position.accuracy
number
meters
Position data accuracy in meters
position.altitude
number
meters
Altitude value for position
position.direction
number
degrees
Heading angle at position detection moment
position.latitude
number
degrees
Latitude coordinate value
position.longitude
number
degrees
Longitude coordinate value
position.speed
number
km/h
Instant speed at position detection moment
position.timestamp
number
seconds
Timestamp when coordinates where calculated
protocol.id
number
ID of protocol
report.reason
number
Transmission reason code
server.timestamp
number
seconds
Timestamp when server received a message
test.mode.status
boolean
Device is in test(diagnostic) mode
timestamp
number
seconds
Message timestamp
wifi.mac.address
string
WiFi MAC address
wifi.signal.strength
number
WiFi signal strength, RSSI
wifi.ssid
string
Wi-Fi SSID name
Properties
Custom command
custom
Send custom MPTP command from Central Station to Mobile Telematics Terminal
payload: Command payload
Stop simple tracking process started by TRC or TRS command
{"payload":"?STO"}
Request last known position. Response will be stored as message
{"payload":"?LOC_0"}
Request stored SRD beacon report from device memory. Response will be stored as LOB message
{"payload":"?LOB"}
Request position: Attempt to acquire a fresh position fix. Response will be stored as message
{"payload":"?LOC_1"}
Request device info (SW version, GPS version, IMEI, GSM module). Response will be stored as SIR message
{"payload":"?SIR"}