advanced
Queclink
IoT
integration

Queclink IoT Integration

Technical guide to Queclink KS/EB TCP integration, telemetry processing, ECU control, and configuration for Queclink-powered vehicles.

Levy Fleets TeamDecember 25, 202522 min read

Queclink IoT Integration

Levy Fleets supports Queclink KS/EB TCP devices using the Queclink Air Interface Protocol v91.28 command set and a TCP ingress proxy on port 9003.

Protocol Coverage

This guide reflects the current Queclink TCP implementation used by Levy Fleets. Devices connect over raw TCP; the proxy then forwards messages to the internal HTTPS API.

Overview

Queclink IoT devices communicate with Levy Fleets through a raw TCP connection to the Queclink proxy, which forwards telemetry to the application API. The integration supports:

  • High-precision GPS tracking with multi-GNSS support
  • Comprehensive battery monitoring including BMS integration
  • ECU control for lock/unlock and speed limiting
  • Multi-zone geofencing with entry/exit detection
  • Extensive alarm system with customizable triggers
  • CAN bus integration for vehicle diagnostics
  • OTA configuration for remote device management
  • NFC support for card-based operations

Device Configuration

Server Settings

Configure your Queclink device to communicate with Levy Fleets:

SettingValue
Server IP/Domain165.245.152.26 or iot.levyelectric.com
Port9003
ProtocolTCP
Report Format@Track Protocol

Authentication

Queclink devices do not send HTTP headers to Levy Fleets. The device authenticates operationally by connecting to the correct TCP host and port and sending its IMEI in the Queclink payload. The x-api-key header is used only internally by the proxy when forwarding the message to /api/iot/queclink.

Device Identification

Devices are identified by IMEI in the message payload. The system uses intelligent caching for vehicle lookups to optimize performance.

Supported Commands

Location Reports

CommandCodeDescription
Fixed Report IntervalGTFRIPeriodic GPS location with full telemetry
Event Report IntervalGTERIEvent-triggered location reports
Real-Time LocationGTRTOOn-demand position response
Location RequestGTRTLImmediate location query response

Status & Information

CommandCodeDescription
Status ReportGTSTTCurrent device status
Device InformationGTINFHardware/firmware details
Version InformationGTVERSoftware versions
Cell InfoGTCIDCellular network data
Alive CheckGTALIDevice heartbeat response
Query ResponseGTQRYConfiguration query
Serial NumberGTQSNDevice serial query
All ConfigurationGTALCComplete config dump
SIM InformationGTSIMSIM card status and details
Audio InformationGTANMAudio module status

Battery & Power

CommandCodeDescription
Battery StatusGTBATMain battery status
Battery LowGTBPLLow battery alert
Battery DataGTBADDetailed battery telemetry
Battery Abnormal EventGTBAEBattery anomaly detected
Battery Abnormal ClearGTBACBattery anomaly cleared
Main Power LowGTMPLMain battery critically low
Battery ManagerGTBMIBMS detailed data
Power OnGTPNADevice power on event
Power On (Fixed)GTPNLPower on with location
Power OffGTPFADevice power off event
Charging StartGTSCEMain battery charging started
Charging StopGTPCEMain battery charging stopped
Backup Charge StartGTBTCBackup battery charging
Backup Charge StopGTSTCBackup battery charged
Main PowerGTEPNExternal power connected
Backup PowerGTEPFRunning on backup power

ECU (Electronic Control Unit)

CommandCodeDescription
ECU StatusGTECUECU operational data
ECU State ChangeGTECSECU state transition
ECU ErrorGTCFUECU fault codes
ECU ShutdownGTCSDAbnormal ECU shutdown
ECU Firmware LostGTCFLECU firmware error
CAN VersionGTCVRCAN bus version
CAN Version IIGTCVIExtended CAN info
CAN TransparentGTCATRaw CAN data

Lock Operations

CommandCodeDescription
Lock StatusGTLCKCurrent lock state
Lock State ChangeGTLKSLock transition event
Lock SuccessfulGTLOCLock command confirmed
Lock FailedGTLOFLock command failed
Unlock SuccessfulGTULSUnlock command confirmed
Unlock FailedGTULFUnlock command failed
Lock RequestGTLORECU lock request
Mechanical LockGTMLSMechanical lock status

Speed & Throttle

CommandCodeDescription
Throttle StatusGTSPDSpeed/throttle state
Speed AlarmGTSPAOver-speed alert

Geofencing

CommandCodeDescription
Geofence EventGTGEOGeneric geofence trigger
Geofence EntryGTGEIEntered defined zone
Geofence ExitGTGEXExited defined zone
Extended Geofence EventGTGFEExtended geofence trigger
Extended Geofence InGTGFIExtended geofence entry
Extended Geofence TransitionGTGFTExtended geofence transition
Extended Geofence AllGTGFAAll extended geofence status

Alarms & Alerts

CommandCodeDescription
General AlarmGTALMConfigurable alarm event
SOS AlarmGTSOSEmergency alert
Alarm ListGTALSActive alarm summary

Motion Detection

CommandCodeDescription
Motion DetectionGTJDRMovement detected
Motion StartGTJDSMotion detection triggered
Motion DataGTMDRDetailed motion telemetry
Acceleration DataGTADRAccelerometer readings

Overturn & Recovery

CommandCodeDescription
OverturnGTBOVVehicle overturned
RecoveryGTBRNRecovered from overturn

System Events

CommandCodeDescription
HeartbeatGTHBDKeep-alive signal
Diagnostic ReportGTDGNDevice diagnostics
Error ReportGTERRError information
Network ConnectionGTNCNServer connection event
Watchdog RebootGTDOGWatchdog-triggered restart
Firmware UpdateGTUPDOTA firmware update status
Data TransmissionGTDATData transmission event

Configuration & GPS

CommandCodeDescription
GPS ConfigurationGTCGPGPS settings

NFC & External

CommandCodeDescription
NFC EventGTNFCNFC card interaction
Service RequestGTRSSService stop request
ReservationGTRESReservation event
Wireless ChargingGTWLCWireless charge status
Helmet BoxGTHLMHelmet box unlock
Beacon InfoGTBEIBluetooth beacon data
Binding ReportGTBNDDevice binding info

Advanced Safety Detection

Queclink devices support advanced safety features unique to this integration:

CommandCodeDescription
Tire Burn EventGTTBETire overheating detected
Tire Burn ClearGTTBCTire temperature normalized
Tandem Riding EventGTTREMultiple riders detected
Tandem Riding ClearGTTRCSingle rider confirmed

Critical Safety Events

Tire burn (GTTBE) events are critical alerts that may automatically throttle the vehicle to prevent injury. These require immediate attention.

AI Detection & Auxiliary

Devices with AI box integration support intelligent detection:

CommandCodeDescription
AI Detection EventGTAIEAI-detected event (helmet, rider)
AI Box InformationGTAIFAI module status and diagnostics

The AI detection system can identify:

  • Helmet usage compliance
  • Rider behavior patterns
  • Obstacle detection
  • Lane departure warnings

Acknowledgments & Buffered

CommandTypeDescription
ACK Messages+ACKCommand acknowledgments
Buffered Messages+BUFFStored offline messages

Message Format

Message Structure

Queclink messages follow this format:

+RESP:GTXXX,PROTOCOL,IMEI,...,CHECKSUM$

Components:

  • +RESP / +ACK / +BUFF - Message type
  • GTXXX - Command code
  • PROTOCOL - Protocol version identifier
  • IMEI - 15-digit device identifier
  • ... - Command-specific data fields
  • CHECKSUM$ - Message checksum

Example Messages

Location Report (GTFRI):

+RESP:GTFRI,380701,867648045123456,,0,0,1,1,0.0,0,35.6,-73.9876,40.7580,20251225120000,0310,0260,00F7,36A3,00,0.0,,,99,20251225120001,0065$

Battery Status (GTBAT):

+RESP:GTBAT,380701,867648045123456,,0,85,4200,0,20251225120000,0065$

Lock Success (GTLOC):

+RESP:GTLOC,380701,867648045123456,,0,1,20251225120000,0065$

Telemetry Processing

Location Report Processing

When receiving GTFRI or GTERI messages:

  1. Parse coordinates - Extract latitude, longitude, speed, heading
  2. Validate GPS fix - Check fix quality indicator
  3. Update vehicle - Set current position and last_location_update
  4. Store in ride history - If active ride, add to ride_locations
  5. Calculate speed - Convert and validate speed reading
  6. Apply odometer - Update cumulative distance
  7. Trigger zone check - Evaluate geofence boundaries

Battery Data Fields

Battery messages include comprehensive BMS data:

FieldDescriptionUnit
Battery LevelState of charge% (0-100)
Battery VoltagePack voltagemV
Charging StatusCharging indicator0/1
TemperatureBattery temperature°C
Cycle CountCharge cyclescount
HealthBattery health estimate%

ECU Report Processing

ECU messages (GTECU, GTECS) provide vehicle controller data:

FieldDescription
Lock StateElectronic lock engaged/released
Throttle StateThrottle enabled/disabled
Speed LimitCurrent speed limit setting
Error CodesActive ECU fault codes
FirmwareECU firmware version

Vehicle Identity Resolution

Caching Strategy

The integration uses efficient caching for vehicle lookups:

  1. Check memory cache - Look for IMEI in 1-hour cache
  2. Cache hit - Return cached vehicle identity immediately
  3. Cache miss - Query database for vehicle by iot_imei
  4. Populate cache - Store result for 1 hour
  5. Return identity - Provide vehicle UUID and number

Benefits

  • Reduced database load - Single query per hour per device
  • Faster processing - Sub-millisecond cache lookups
  • Consistent identity - Same vehicle ID across all messages

Cache Invalidation

Cache is automatically cleared when:

  • IoT devices are bulk imported
  • Vehicle IMEI is changed
  • Manual cache clear is triggered

Active Ride Integration

Ride Detection

For each incoming message:

  1. Query for active/paused rides by vehicle_uuid
  2. If not found, check by vehicle_number (legacy support)
  3. Backfill legacy rides with proper UUIDs
  4. Associate telemetry with ride

Location History

During active rides, location reports:

  1. Insert into ride_locations table
  2. Include: coordinates, speed, altitude, heading
  3. Calculate if vehicle is moving
  4. Store raw data for debugging
  5. Update ride distance/duration

Zone Enforcement

After location processing:

await enforceZoneActions(admin, {
  vehicleId: vehicleUuid,
  rideId: rideId,
  latitude: location.latitude,
  longitude: location.longitude,
  context: 'iot_queclink'
})

Zone actions include:

  • Speed limit application in slow zones
  • Throttle disable in no-go zones
  • Alert generation for boundary violations

Sending Commands

IoT Password

Configure the Queclink password:

Settings > Vehicles > IoT Passwords > Queclink

Default password: zk600

Dashboard Commands

CommandActionResponse
LockSend lock commandGTLOC (success) or GTLOF (fail)
UnlockSend unlock commandGTULS (success) or GTULF (fail)
SoundPlay alert tone+ACK:GTRTO acknowledgment
LocateFlash lights / locate deviceGTQRY response
QueryGet device infoGTINF response

Command Response Handling

Lock/unlock commands include result processing:

ResponseStatusAction
GTLOCLock successfulUpdate vehicle: lock_status: 'locked'
GTLOFLock failedLog error, maintain current status
GTULSUnlock successfulUpdate vehicle: lock_status: 'unlocked'
GTULFUnlock failedLog error, maintain current status

Alarm Handling

Alarm Types

The system processes multiple alarm categories:

AlarmCodeDescriptionSeverity
SOSGTSOSEmergency button pressedCritical
General AlarmGTALMConfigurable alarm eventHigh
OverturnGTBOVVehicle tipped overHigh
Tire BurnGTTBETire overheating detectedCritical
Tandem RidingGTTREMultiple riders detectedMedium

Alarm Processing

  1. Parse alarm message and extract type
  2. Look up associated customer (if ride active)
  3. Create alarm record in database
  4. Generate notification if warranted
  5. Update vehicle status if needed

Customer Notifications

For certain alarms during active rides:

  • SOS alerts notify fleet operators immediately
  • Crash detection may trigger emergency protocols
  • Tamper alerts flag for investigation

Data Storage

Telemetry Table

All messages stored with:

FieldDescription
vehicle_uuidAssociated vehicle
vehicle_numberHuman-readable ID
imeiDevice IMEI
raw_payloadComplete message JSON
message_typeCommand code
timestampMessage time
idempotency_keyDedup key
battery_levelExtracted battery %
speedExtracted speed
latitudeExtracted latitude
longitudeExtracted longitude
lock_statusLock state if reported

Ride Locations

For active rides, GPS data stored in ride_locations:

FieldDescription
ride_uuidAssociated ride
latitudeGPS latitude
longitudeGPS longitude
speedSpeed at point
altitudeGPS altitude
headingDirection of travel
accuracyGPS accuracy
is_movingMovement indicator
raw_dataOriginal message
timestampFix timestamp

Unmatched Devices

Recording Unmatched

When a message arrives from an unknown IMEI:

  1. Process message for logging purposes
  2. Record in iot_unmatched_devices table
  3. Store: IMEI, protocol, source, payload, timestamps
  4. Make visible in dashboard "Unmatched Devices"

Resolving Unmatched

To register an unmatched device:

  1. Navigate to IoT Devices > Unmatched Devices
  2. Click on the unmatched entry
  3. Click "Register Device"
  4. Fill required fields (subaccount, IoT type)
  5. Save - device is now tracked normally

Configuration Options

Report Intervals

Configure how often the device reports:

SettingDescriptionDefault
FRI IntervalFixed report interval30 seconds
HBD IntervalHeartbeat interval4 minutes
GPS TimeoutMax time for GPS fix180 seconds

Power Modes

ModeDescriptionBattery Impact
NormalFull reportingHigh
Power SaveReduced frequencyMedium
SleepMinimal reportingLow
Deep SleepOn-demand onlyMinimal

Geofence Configuration

Configure up to 100 geofence zones per device:

ParameterDescription
Zone IDUnique identifier (1-100)
ShapeCircle or polygon
CoordinatesCenter/vertices
RadiusFor circular zones
ActionsEntry/exit triggers

Troubleshooting

No Location Updates

Symptoms: Vehicle position not updating

Solutions:

  1. Check device power and battery level
  2. Verify GPS antenna has sky view
  3. Review FRI interval configuration
  4. Check cellular connectivity
  5. Examine recent GTHBD, GTFRI, or GTNCN messages for connectivity and fix status

Commands Not Working

Symptoms: Lock/unlock commands not executed

Solutions:

  1. Verify IoT password in Settings
  2. Check device is online (last seen < 5 min)
  3. Review command response (GTLOF/GTULF = failure)
  4. Check ECU status for errors
  5. Power cycle vehicle if needed

Heartbeat Missing

Symptoms: Device shows offline, no GTHBD

Solutions:

  1. Verify server configuration on device
  2. Check cellular signal strength
  3. Ensure SIM card is active
  4. Review for watchdog reboots (GTDOG)
  5. Check device isn't in deep sleep

Zone Enforcement Not Working

Symptoms: Speed not limited in slow zones

Solutions:

  1. Verify zone is properly configured
  2. Check zone type supports enforcement
  3. Confirm ride is active
  4. Review location accuracy
  5. Check ECU can receive speed commands

Buffered Messages

Symptoms: Delayed telemetry arrival

Explanation: When offline, device buffers messages and sends when reconnected. These arrive with +BUFF prefix.

Handling:

  • Messages are processed with original timestamps
  • Ride statistics are retroactively updated
  • Zone enforcement not applied to historical data

API Reference

Endpoint

POST /api/iot/queclink

Headers

These headers apply to the proxy-to-API request, not the raw TCP session from the device.

x-api-key: your-iot-api-key
Content-Type: application/json

Request Body

{
  "imei": "867648045123456",
  "message": "+RESP:GTFRI,380701,867648045123456,...",
  "timestamp": "2025-12-25T12:00:00Z"
}

Response

{
  "success": true,
  "imei": "867648045123456",
  "messageType": "+RESP",
  "command": "GTFRI",
  "processed": true
}

Health Check

GET /api/iot/queclink

Returns service status including:

  • Service name and version
  • Protocol version
  • Route-level handled command counts
  • List of all supported commands

Technical Support

For Queclink integration issues, contact support@levyelectric.com with:

  • Device IMEI
  • Raw message content (if available)
  • Timestamp of the issue
  • Expected vs. actual behavior
  • Any relevant error codes