1

I get GPS data from tcp (php socket), but for some devices (GRTQ) I will get an unreadable string.

First devices sends:

*HQ,XXXXXX,41,4#V1,time,A,**Lat**,N/S,**Lng**,W/E,000.00,000,date,FFFFFBFF,432,35,32448,334

then sends:

*HQ,XXXXXX,V9,time,A,**Lat**,N/S,**Lng**,W/E,000.10,000,date,,Caller ID,FFFFFBFF#

then sends:

$A  grQ05Ah@‘)���ÿÿûÿÿ����°#~À‚¡U

What's the meaning of this last string?

The model of the device is GRTQ.

  • I can find no reference to a device model of GRTQ. The string appears to be binary data. I suspect without knowing the device or manufacturer it won't be possible to determine what that string represents. – Chris W Jun 4 '15 at 21:17
2

You have to convert the received unreadable data to hexadecimal string. You will get this 24 41 20 20 67 72 51 30 35 41 68 40 2018 29 fffd fffd fffd ff ff fb ff ff fffd fffd fffd fffd b0 23 7e c0 201a a1 55

Then you can split it and parse it like this. First 2 digital(24), stand for standard mode next 10 digital, is device'ID (41 20 20 67 72) 6 digital, is time 6 digital, is data 8 digital, is latitude 2 digital, battery like this 06= 100% 05=80% 04=60% 03=40% 02=20% 01=10% 10 digital is longitude

next byte C is 16 hexadecimal, 0C, convert it into binary data, 1100 (4 bit)

Bit 3: if is 1= East longitude if is 0= West longitude Bit 2: if is 1= North latitude, if is 0= South latitude Bit1: if is 1= A( GPS position valid) if is 0= V( gps position invalid) Bit 0: discard

000215: 6 digits, 000 is speed (knot 1 knot =1.852 km/h ) , 215 is direction in degrees.

FFFFF9FF:vehicle_status 2 bytes :back-up data 2bytes :gsm_signal 0D : (convert to decimal=13 13 means the number of satellite gps_signal) 000000034 : mileage 4bytes: mobile country code (China) 00: mnc 0000: lac 0000: cell_id 00: record number

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.