queclink

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 11, 2026 License: Apache-2.0 Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package queclink is the Queclink @Track ASCII tracker protocol of the GV300, GV55, GV500 and GL300 families: frame reading, decoding into track.Message, report acknowledgements and command framing. Our own implementation from Queclink's published @Track Air Interface Protocol documents; the GV300N document, revision 3.01 (TRACGV300NAN001), is the reference for every field position below: https://controlsatperu.com/Manuales/GV300N/Document/GV300N%20@Track%20Air%20Interface%20Protocol%20V3.01.pdf (other family members: GV300 V2.40 at https://manualzz.com/doc/7953135/gv300-@track-air-interface-protocol-v2.40, GV350M V3.11 at https://www.traccar.org/protocol/5004-gl200/).

Every frame is printable ASCII ending with '$', fields separated by ','. The fields after the message name are always the protocol version, the unique ID (the IMEI, which identifies the device on every frame; there is no separate login) and the device name; the last two are the send time and the count number.

+RESP:GTxxx,<version>,<imei>,<name>,…,<send time>,<count>$   report
+BUFF:GTxxx,…$                                               report stored while offline (history)
+ACK:GTHBD,<version>,<imei>,<name>,<send time>,<count>$      heartbeat, answered +SACK:GTHBD,<version>,<count>$
+ACK:GTxxx,<version>,<imei>,<name>,[<sub>,]<serial>,<send time>,<count>$   a command's acknowledgement

Position blocks are <accuracy (HDOP, 0 no fix)>,<speed km/h>,<heading>, <altitude m>,<longitude>,<latitude>,<GPS UTC time YYYYMMDDHHMMSS>,<MCC>, <MNC>,<LAC hex>,<cell ID hex>,<reserved>, preceded by their number (a GTFRI may carry up to 15). Each block becomes a fix and its cell the record's track.Network; the mileage after the last block is the odometer (km). Handled reports: GTFRI/GTERI fixed reports (with hour meter, analogue inputs, backup battery percentage and the device status: motion state, ignition, digital inputs and outputs), GTRTL (the answer to locate), GTSOS emergency, GTSPD over-speed, GTHBM harsh braking / acceleration / turning, GTIGN/GTIGF/GTIGL ignition, GTTOW towing, GTMPN/GTMPF main power, GTBPL low backup battery, GTGEO/GTGIN/GTGOT geofences, GTCRA crash, GTJDR/GTJDS jamming, GTDIS digital inputs, GTEPS external voltage, GTSTT motion state, GTBTC/GTSTC charging, GTINF device information, GTBAT, GTCSQ, GTCID and GTVER query answers, GTPNA/GTPFA power on and off, and the other position reports of the document (GTDOG, GTIOB, GTANT, GTIDN/GTIDF, GTSTR/GTSTP/GTLSP, GTGSS, GTFLA, GTDOS, GTAIS, GTIDA). Other configuration and data reports are accepted without values; a report this package does not know is passed over with the warning queclink.unknownMessage.

The HEX (binary) format (AT+GTSRI or AT+GTQSS <Protocol Format> 1) is read on the same connection, told apart by its header: +RSP/+BSP location reports, +EVT/+BVT event reports (B: from the buffer, history), +INF/+BNF information reports, +HBD heartbeats (answered with the ASCII +SACK:GTHBD) and +ACK command acknowledgements (correlated like the ASCII ones), with the items AT+GTHRM's masks select; see hex.go. A HEX frame that names the device by its device name is read when an earlier frame on the connection gave the IMEI. The GV300N's factory masks name the device by its device name; clear those bits so that every frame carries the IMEI, for example AT+GTHRM=<password>,,,6F,3FEFFBF,3FEFFBF,FF7D,EF,,,,,,0001$. Crash data (+CRD), +DAT and +CAN frames are passed over with queclink.unknownMessage, a HEX frame that does not decode with queclink.messageUnreadable.

Commands are AT+GTxxx=<password>,…,<serial>$. The raw form {"text": "AT+GTRTO=gv300,1,,,,,,0001$"} is sent as written (a missing final '$' is added). Named commands (track.Named):

engineStop    AT+GTOUT=<password>,1,,,0,0,0,0,0,0,0,,,,,,,<serial>$   digital output 1 on (the relay; outputs 2 and 3 off)
engineResume  AT+GTOUT=<password>,0,,,0,0,0,0,0,0,0,,,,,,,<serial>$   digital output 1 off
locate        AT+GTRTO=<password>,1,,,,,,<serial>$                    real-time operation RTL: report the position now (+RESP:GTRTL)
reboot        AT+GTRTO=<password>,3,,,,,,<serial>$                    real-time operation REBOOT
interval      AT+GTFRI=<password>,1,,,,,,,<seconds>,,,,,,,,,,<serial>$  fixed timing report every 5 to 86400 s

The codec is a track.PasswordCommander: the password is the one passed to CommandWithPassword (the device's own), else profile.password (a Queclink device's factory password is its model name, such as gv300); Command uses profile.password. A profile's namedCommands text is the command without its serial and the final '$', which the codec appends. The device acknowledges a command it accepts with +ACK:GTxxx carrying the command's serial number; the codec is a track.Correlator, so that acknowledgement completes the command, and one with another serial (a late answer to an earlier command) does not. A command with a wrong password or wrong fields gets no acknowledgement at all, so it ends with a timeout.

The profile (NewCodec; Profile):

password: ""          # command password of devices without their own (default none)
sack: false           # answer every report with +SACK:<count>$ (default false; turn on when the device's SACK Enable is 1 or 2)
namedCommands: {}     # action → command text without ",<serial>$", with {password} and {seconds} (default the table above)
alerts: {}            # extra report names → alert type, such as {"GTPFA": "tamper"} (default none)

Index

Constants

This section is empty.

Variables

View Source
var Interval = track.IntervalRange{Min: 5, Max: 86400}

Interval bounds the fixed timing report (AT+GTFRI <Send Interval>).

View Source
var NamedActions = track.Actions

NamedActions are the named commands the protocol has: all of them.

Functions

func Crc16 added in v0.2.0

func Crc16(b []byte) uint16

Crc16 is the HEX frames' checksum (CRC-16, polynomial 0x1021, initial value 0xFFFF, no reflection) of b.

func NewCodec

func NewCodec(raw json.RawMessage) (func() track.Codec, error)

NewCodec validates a profile (empty for the defaults) and returns a factory of codecs, one per connection. Each codec is a track.PasswordCommander and a track.Correlator.

Types

type Profile

type Profile struct {
	// Password is the command password of devices that have no password
	// of their own (CommandWithPassword with ""). A Queclink device's factory password
	// is its model name in lower case (gv300, gl300); AT+GTCFG changes it.
	Password string `json:"password,omitempty"`
	// Sack answers every report and acknowledgement with +SACK:<count>$.
	// Turn it on when the devices' SACK Enable (AT+GTSRI or AT+GTQSS) is 1
	// or 2; heartbeats are always answered.
	Sack bool `json:"sack,omitempty"`
	// NamedCommands replaces the command text of a named action for
	// firmware that differs: the text up to and without ",<serial>$", with
	// {password} and, for interval, {seconds}; "" turns the action off.
	NamedCommands track.NamedTemplates `json:"namedCommands,omitempty"`
	// Alerts maps further report names (GTxxx) to alert types, added to
	// or replacing the built-in ones.
	Alerts map[string]string `json:"alerts,omitempty"`
}

Profile is the manufacturer-variation settings.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL