DEBUG UART Data Packet

Protocol packet format

Debug uart port data package (P1 package) includes four types of data: “imu”, “gnss”, “vel” and “ins”. Each piece of data contains three parts: packet header, content and check code.

packet header
Offset Variable type Name Description
0 uint8 sync1 sync 1: 0xAA
1 uint8 sync2 sync 2: 0x44
2 uint8 sync3 sync 3: 0x12
3 uint8 header_length Length of packet header: 0x1C
4 uint16 message_id data id: 268-“imu” 42-“gnss” 99-“vel” 507-“ins”
6 uint8 message_type N/A
7 uint8 port_address N/A
8 uint16 message_length Data length: not including header and check code
10 uint16 sequence N/A
12 uint8 idle N/A
13 uint8 time_status N/A
14 uint16 gps_week GPS week
16 uint32 gps_millisecs GPS seconds within a week: unit: ms
20 uint32 status N/A
24 uint16 Reserved N/A
26 uint16 version N/A

Check code:

#define CRC32_POLYNOMIAL 0xEDB88320L

static unsigned long CRC32Value(int i)
{
    int j;
    unsigned long ulCRC;
    ulCRC = i;
    for (j = 8; j > 0; j--)
    {
        if (ulCRC & 1)
            ulCRC = (ulCRC >> 1) ^ CRC32_POLYNOMIAL;
        else
            ulCRC >>= 1;
    }
    return ulCRC;
}
unsigned long CalculateBlockCRC32(unsigned long ulCount,
                                  unsigned char *ucBuffer)
{
    unsigned long ulTemp1, ulTemp2;
    unsigned long ulCRC = 0;
    while (ulCount-- != 0)
    {
        ulTemp1 = (ulCRC >> 8) & 0x00FFFFFFL;
        ulTemp2 = CRC32Value(((int)ulCRC ^ *ucBuffer++) & 0xff);
        ulCRC = ulTemp1 ^ ulTemp2;
    }
    return (ulCRC);
}

Original IMU packet

“imu”
Offset Variable type Name Description
0 OpenRTKPacketHeader header header
28 uint32 gps_week GPS week
32 double gps_millisecs GPS seconds within a week (ms)
40 uint32 imuStatus N/A
44 float z_acceleration Accelerometer data on z-axis, y-axis, x-axis (g)
48 float y_acceleration
52 float x_acceleration
56 float z_gyro_rate Gyroscope data on z-axis, y-axis, x-axis (rad/s)
60 float y_gyro_rate_neg
64 float x_gyro_rate
68 int8 * 4 crc[4] check code

GNSS position solution

“gnss”
Offset Variable type Name Description
0 OpenRTKPacketHeader header header
28 uint32 solution_status N/A
32 uint32 position_type Positioning mode: 0: Invalid 1: Single point solution 4: Fixed solution 5: Floating point solution
36 double latitude longitude (deg)
44 double longitude Latitude (deg)
52 double height Altitude (m)
60 float undulation N/A
64 uint32 datum_id Geodetic datum coordinate system
68 float longitude_standard_deviation Longitude standard deviation
72 float latitude_standard_deviation Latitude standard deviation
76 float height_standard_deviation height standard deviation
80 int8 * 4 base_station_id[4] N/A
84 float differential_age N/A
88 float solution_age  
92 uint8 number_of_satellites The number of satellites used in the positioning solution
93 uint8 number_of_satellites_in_solution N/A
94 uint8 num_gps_plus_glonass_l1 N/A
95 uint8 num_gps_plus_glonass_l2 N/A
96 uint8 reserved N/A
97 uint8 extended_solution_status N/A
98 uint8 reserved2 N/A
99 uint8 signals_used_mask N/A
100 int8 * 4 crc[4] check code

GNSS velocity solution

“vel”
Offset Variable type Name Description
0 OpenRTKPacketHeader header header
28 uint32 solution_status N/A
32 uint32 position_type N/A
36 float latency N/A
40 float age N/A
44 double horizontal_speed Horizontal speed (m/s)
52 double track_over_ground Ground speed (m/s)
60 double vertical_speed Vertical speed (m/s)
68 float reserved N/A
72 int8 * 4 crc[4] check code

INS position, velocity and attitude solution

“ins”
Offset Variable type Name Description
0 OpenRTKPacketHeader header header
28 uint32 gps_week GPS week
32 double gps_millisecs GPS seconds within a week (ms)
40 double latitude Latitude (deg)
48 double longitude Longitude (deg)
56 double height Height (m)
64 double north_velocity Velocity (north) (m/s)
72 double east_velocity Velocity (East) (m/s)
80 double up_velocity Velocity (up) (m/s)
88 double roll Roll angle (deg)
96 double pitch Pitch angle (deg)
104 double azimuth Yaw angle (deg)
112 int32 status Combined solution status: 0: invalid 1: INS alignment ongoing 2: INS solution is unreliable 3: INS solution is good 4 :INS free(no GNSS update) 5: Estimating installation angle 6: Completed estima installation angle estimation
116 int8 * 4 crc[4] check code

Port command

Get module configuration information

Command: get configuration\r\n

Return: string in json format

{
       "openrtk configuration":
   {
               "Product Name":         "",
               "Product PN":           "",
               "Product SN":           "",
               "Version":                  "",
               "userPacketType":       "s1",
               "userPacketRate":       100,
               "leverArmBx":           0.0,
               "leverArmBy":           0.0,
               "leverArmBz":           0.0,
               "pointOfInterestBx":    0.0,
               "pointOfInterestBy":    0.0,
               "pointOfInterestBz":    0.0,
               "rotationRbvx":         0,
               "rotationRbvy":         0,
               "rotationRbvz":         0
       }
}

At the same time, the module will close the P1 packet output of the DEBUG port.

Enable P1 packet output

Command: log debug on\r\n

Return: N/A, the module will directly output P1 packet data after a delay of 1 second.