Positioning Service

Last Updated on : 2024-06-04 08:50:24download

This topic describes the commands for the positioning service.

Enable or disable GNSS positioning (0x72 81)

Because the GNSS module performs many operations, the maximum timeout period for a response is three seconds.

The MCU sends the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x03
Command 1 0x72
Data length 3 0x0003
Data 3
  • Subcommand: 0x81
  • Control command:
    0x01: Enable.
    0x00: Disable.
  • Positioning mode: applies when positioning is enabled. Some GPS modules do not support this field.
    • 0x00: Global Positioning System (GPS) plus BeiDou Navigation Satellite System (BDS)
    • 0x01: GPS plus GLONASS (depending on the used GNSS modules)
    • 0x02: GPS
    • 0x03: BDS (depending on the used GNSS modules)
    • 0x04: GLONASS (depending on the used GNSS modules)
    • 0x05: Galileo satellite navigation (depending on the used GNSS modules)
Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.

The module returns the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x00
Command 1 0x72
Data length 2 0x0003
Data 3
  • Subcommand: 0x81. The result of enabling or disabling positioning:
    • 0: Failure.
    • 1: Success.
  • Status of the positioning mode (invalid when positioning is disabled): Some GPS modules do not support this field, so the return value can be ignored.
    • 0: Failure.
    • 1: Success.
Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.
  • The LZ211 module supports GPS plus BDS only. Modification is not allowed.
  • The values of positioning modes are valid only when the GNSS positioning is enabled.

Report GNSS automatically (0x72 90)

The MCU sends the module the DP ID and reporting period of GNSS. The module automatically reports the positioning information to the cloud accordingly. You must enable GNSS positioning before using this feature.

The MCU sends the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x03
Command 1 0x72
Data length 2 0x0004
Data 4
  • Subcommand: 0x90
  • The reporting period: 2-byte data in seconds, transmitted in big-endian format.
  • DP ID: 1-byte data.
Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.

The module returns the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x00
Command 1 0x72
Data length 2 0x0002
Data 2
  • Subcommand: 0x90
  • Status:
    • 0: Failure.
    • 1: Success.
Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.
  • If the reporting period is 0, it indicates automatic reporting is canceled.
  • The reporting period must be greater than five seconds.
  • The data that is automatically reported is transmitted over the cellular network.
  • Only DPs of string type are supported.

Enable or disable Wi-Fi positioning (0x72 82)

With Wi-Fi positioning enabled, if Wi-Fi and Bluetooth on the module are mutually exclusive, Bluetooth will be turned off.

The MCU sends the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x03
Command 1 0x72
Data length 2 0x0002
Data 2
  • Subcommand: 0x82
  • Control commands:
    • 0x01: Enable.
    • 0x00: Disable
Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.

The module returns the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x00
Command 1 0x72
Data length 2 0x0002
Data 2
  • Subcommand: 0x82
  • Status:
    • 0: Failure.
    • 1: Success.
Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.

Report Wi-Fi positioning automatically (0x72 91)

The MCU sends the module the DP ID and reporting period of Wi-Fi positioning. The module automatically reports the positioning information to the cloud accordingly. You must enable Wi-Fi positioning before using this feature.

The MCU sends the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x03
Command 1 0x72
Data length 2 0x0004
Data 4
  • Subcommand: 0x91
  • The reporting period: 2-byte data in seconds.
  • The DP ID: 1-byte data, in big-endian format.
Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.

The module returns the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x00
Command 1 0x72
Data length 2 0x0002
Data 2
  • Subcommand: 0x91
  • Status:
    • 0: Failure.
    • 1: Success.
Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.
  • If the reporting period is 0, it indicates automatic reporting is canceled.
  • The reporting period must be greater than five seconds.
  • The data that is automatically reported is transmitted over the cellular network.
  • Only DPs of string type are supported.

Report LBS automatically (0x72 92)

The MCU sends the module the DP ID and reporting period of LBS. The module automatically reports the positioning information to the cloud accordingly.

The MCU sends the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x03
Command 1 0x72
Data length 2 0x0004
Data 4
  • Subcommand: 0x92
  • The reporting period: 2-byte data in seconds.
  • The DP ID: 1-byte data, in big-endian format.
Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.

The module returns the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x00
Command 1 0x72
Data length 2 0x0002
Data 2
  • Subcommand: 0x92
  • Status:
    • 0: Failure.
    • 1: Success.
Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.
  • If the reporting period is 0, it indicates automatic reporting is canceled.
  • The reporting period must be greater than five seconds.
  • The data that is automatically reported is transmitted over the cellular network.
  • Only DPs of string type are supported.
  • It takes about one second to get the LBS positioning.

We recommend you choose only one of the positioning modes from Wi-Fi, GNSS, or LBS for automatic positioning reporting. Otherwise, there will be a deviation of one to two seconds between the actual reporting period and the preset period. If the module fails to receive positioning information as scheduled, it will pause the timer and retry after one or two seconds. The timer will reset once the information is obtained.

Reset GNSS module (0x72 83)

The MCU sends the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x03
Command 1 0x72
Data length 2 0x0003
Data 3
  • Subcommand: 0x83
  • GPIO reset pin: a value from 0 to 31, according to the actual hardware connection.
  • The voltage level on the reset pin: 0: low level. 1: high level.
Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.

The module returns the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x00
Command 1 0x72
Data length 2 0x0002
Data 2
  • Subcommand: 0x83
  • Status:
    • 0: Failure.
    • 1: Success.
Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.
  • The LZ211 module includes a GNSS device that is reset every time it is powered on.
  • The LZ201 module supports this feature.
  • Other modules do not support this feature.

Get GNSS positioning (longitude, latitude) (0x71 10)

The MCU sends the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x03
Command 1 0x71
Data length 2 0x0001
Data 1 Subcommand: 0x10
Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.

The module returns the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x00
Command 1 0x71
Data length 2 0x0002 + N
Data 2+N
  • Subcommand: 0x10
  • Status:
    • 0: Failure.
    • 1: Success.
  • The returned N-byte positioning information string takes the format longitude,latitude.
Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.

The module returns information in string type, so the MCU gets the information and reports it back to the cloud through status reporting. If the cloud requires DP data in latitude and longitude format, the MCU must convert the format of the received positioning information.

Get GNSS positioning (latitude,longitude) (0x71 29)

The MCU sends the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x03
Command 1 0x71
Data length 2 0x0001
Data 1 Subcommand: 0x29
Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.

The module returns the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x00
Command 1 0x71
Data length 2 0x0002 + N
Data 2+N
  • Subcommand: 0x29
  • Status:
    • 0: Failure.
    • 1: Success.
  • The returned N-byte positioning information string takes the format longitude,latitude.
Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.

The module returns information in string type, so the MCU gets the information and reports it back to the cloud through status reporting.

Get the SNR of GNSS signals (0x71 11)

The MCU sends the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x03
Command 1 0x71
Data length 2 0x0001
Data 1 Subcommand: 0x11
Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.

The module returns the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x00
Command 1 0x71
Data length 2 0x0003
Data 3
  • Subcommand: 0x11
  • Status:
    • 0: Failure.
    • 1: Success.
  • The 1-byte SNR value ranges from 0 to 100.
Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.

Get GNSS positioning speed (0x71 12)

The MCU sends the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x03
Command 1 0x71
Data length 2 0x0001
Data 1 Subcommand: 0x12
Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.

The module returns the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x00
Command 1 0x71
Data length 2 0x0004
Data 4
  • Data[0]: Subcommand 0x12
  • Data[1]: Status
    • 0: Failure.
    • 1: Success.
  • Data[2]: indicates the speed of the high data bit.
  • Data[3]: indicates the speed of the low data bit. For example, Data[2] is SPEED>>8, and Data[3] is SPEED&0xFF.
The speed value has 2 bytes, in the unit of 100 m/h.
Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.

Get Wi-Fi positioning (0x71 20)

The MCU sends the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x03
Command 1 0x71
Data length 2 0x0001
Data 1 Subcommand: 0x20
Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.

The module returns the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x00
Command 1 0x71
Data length 2 0x0002 + N
Data 2+N
  • Subcommand: 0x20
  • The number of access points (APs): 1 byte.
  • The N-byte positioning information string.
Example: 18:56:80:2F:7C:36,-61;18:56:80:2F:7C:36,-61;18:56:80:2F:7C:36,-61.
Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.
  • The module returns information in string type, so the MCU gets the information and reports it back to the cloud through status reporting.
  • Up to 10 APs sorted by signal strength can be reported.

Get LBS positioning (0x71 21)

The MCU sends the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x03
Command 1 0x71
Data length 2 0x0001
Data 1 Subcommand: 0x21
Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.

The module returns the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x00
Command 1 0x71
Data length 2 0x0002 + N
Data 2+N
  • Subcommand: 0x21
  • Status (1 byte):
    • 0: Failure.
    • 1: Success.
  • N-byte LBS positioning information string, such as 460,00,6166,27556130,-75.
Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.

Example:

55 AA 00 71 00 1A 21 01 34 36 30 2C 30 30 2C 36 31 36 36 2C 32 37 35 35 36 31 33 30 2C 2D 37 35 5F

  • Typically, the base station number has two bytes (04ba). The base station number is designed to support four bytes, so when reporting LBS DP information, remove the padded 0000 from a value such as 04ba0000.
  • LBS positioning information takes the format: carrier code (mobile country code (MCC) + mobile network code (MNC)) + location area code + base station number + signal strength. For example, the LBS information for China Telecom is 46000,1816,875a521,-40.

Control GNSS’s main power supply (0x72 85)

The MCU sends this command to the LZ211 module to turn on or off the GNSS’s power supply. The LZ211 module has a built-in GNSS chip. As long as the device is powered on, the backup power for GNSS works. The on/off control of GNSS’s main power supply is supported. The chip performs a warm boot when the main power is on.

The MCU sends the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x03
Command 1 0x72
Data length 2 0x0002
Data 2
  • Subcommand: 0x85
  • Data: Data[1]
    • 1: Turn on the power supply.
    • 0: Turn off the power supply.
Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.

The module returns the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x00
Command 1 0x72
Data length 2 0x0002
Data 2
  • Subcommand: 0x85
  • Status:
    • 0: Failure.
    • 1: Success.
Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.
  • The GNSS chip takes about four seconds to load its firmware after being powered on. The GNSS positioning will restart when the main power is off and on again. For more information, see Enable or disable GNSS positioning.
  • This feature applies to the LZ211 module only. Before enabling the positioning service, turn on the GNSS power.

Get GNSS’s power status (0x71 22)

The MCU sends the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x03
Command 1 0x71
Data length 2 0x0001
Data 1 Subcommand: 0x22
Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.

The module returns the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x00
Command 1 0x71
Data length 2 0x0002
Data 2
  • Subcommand: 0x22
  • Status:
    • 0: Power is off.
    • 1: Firmware is being loaded.
    • 2: Power is on, and firmware loading is finished.
    Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.

    Only the LZ211 module supports this feature.

    AGNSS on/off (0x72 86)

    • Turn on or off the AGNSS service. This service uses mobile data. AGNSS is turned off by default.
    • AGNSS data is updated once every two hours.
    • The MCU integration protocol must be v1.1.4 or later.

    The MCU sends the following data.

    Field Bytes Description
    Header 2 0x55aa
    Version 1 0x03
    Command 1 0x72
    Data length 2 0x0001
    Data 2
    • Subcommand: 0x86
    • Data: Data[1]
      • 1: On
      • 0: Disable.
    Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.

    The module returns the following data.

    Field Bytes Description
    Header 2 0x55aa
    Version 1 0x00
    Command 1 0x72
    Data length 2 0x0002
    Data 2
    • Subcommand: 0x86
    • Status:
      • 0: Failure.
      • 1: Success.
    Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.

    Get the number of visible GNSS satellites (0x71 15)

    The MCU sends the following data.

    Field Bytes Description
    Header 2 0x55aa
    Version 1 0x03
    Command 1 0x71
    Data length 2 0x0001
    Data 1 Subcommand: 0x15
    Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.

    The module returns the following data.

    Field Bytes Description
    Header 2 0x55aa
    Version 1 0x00
    Command 1 0x71
    Data length 2 0x0003
    Data 3
    • Subcommand: 0x15
    • Status:
      • 0: Failure.
      • 1: Success.
    • The number of visible satellites: 1 byte
    Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.

    Get the enablement of positioning features (0x71 30)

    Get whether positioning via GNSS, Wi-Fi, or LBS is enabled or not.

    The MCU sends the following data.

    Field Bytes Description
    Header 2 0x55aa
    Version 1 0x03
    Command 1 0x71
    Data length 2 0x0001
    Data 1 Subcommand: 0x30
    Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.

    The module returns the following data.

    Field Bytes Description
    Header 2 0x55aa
    Version 1 0x00
    Command 1 0x71
    Data length 2 0x0004
    Data 4
    • Subcommand: 0x30
    • Status:
      • GNSS positioning: 0x01: Enabled. 0x00: Disabled.
      • Wi-Fi positioning: 0x01: Enabled. 0x00: Disabled.
      • LBS positioning: 0x01: Enabled. 0x00: Disabled.
    Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.

    (Optional) Get GNSS heading (0x71 13)

    The MCU sends the following data.

    Field Bytes Description
    Header 2 0x55aa
    Version 1 0x03
    Command 1 0x71
    Data length 2 0x0001
    Data 1 Subcommand: 0x13
    Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.

    The module returns the following data.

    Field Bytes Description
    Header 2 0x55aa
    Version 1 0x00
    Command 1 0x71
    Data length 2 0x0002/0x0004
    Data 2/4
    • Data[0]: Subcommand 0x13
    • Data[1]: Status
      • 0: Failure.
      • 1: Success.
    • Heading (2 bytes): Its value is 10 times the actual value. No data is returned on failure.
    Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.

    (Optional) Get GNSS horizontal dilution of precision (HDOP) (0x71 16)

    The MCU integration protocol must be v1.1.3 or later.

    The MCU sends the following data.

    Field Bytes Description
    Header 2 0x55aa
    Version 1 0x03
    Command 1 0x71
    Data length 2 0x0001
    Data 1 Subcommand: 0x16
    Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.

    The module returns the following data.

    Field Bytes Description
    Header 2 0x55aa
    Version 1 0x00
    Command 1 0x71
    Data length 2 0x0002/0x0004
    Data 2/4
    • Data[0]: Subcommand 0x16
    • Data[1]: Status
      • 0: Failure.
      • 1: Success.
    • HDOP (2 bytes): Its value is 10 times the actual value. No data is returned on failure.
    Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.

    (Optional) Get GNSS orthometric height (0x71 17)

    The MCU integration protocol must be v1.1.3 or later.

    The MCU sends the following data.

    Field Bytes Description
    Header 2 0x55aa
    Version 1 0x03
    Command 1 0x71
    Data length 2 0x0001
    Data 1 Subcommand: 0x17
    Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.

    The module returns the following data.

    Field Bytes Description
    Header 2 0x55aa
    Version 1 0x00
    Command 1 0x71
    Data length 2 0x0002/0x0004
    Data 2/4
    • Data[0]: Subcommand 0x17
    • Data[1]: Status
      • 0: Failure.
      • 1: Success.
    • Orthometric height (2 bytes): Its value is 10 times the actual value. No data is returned on failure.
    Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.

    (Optional) Enable GPS filter algorithm (0x72 18)

    The MCU integration protocol must be v1.1.3 or later.

    The MCU sends the following data.

    Field Bytes Description
    Header 2 0x55aa
    Version 1 0x03
    Command 1 0x72
    Data length 2 0x0001
    Data 1 Subcommand: 0x18
    Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.

    The module returns the following data.

    Field Bytes Description
    Header 2 0x55aa
    Version 1 0x00
    Command 1 0x72
    Data length 2 0x0002
    Data 2
    • Data[0]: Subcommand 0x18
    • Data[1]: Status
      • 0: Failure.
      • 1: Success.
    Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.

    (Optional) Set GPS filter algorithm (0x72 19)

    The MCU integration protocol must be v1.1.3 or later.

    The MCU sends the following data.

    Field Bytes Description
    Header 2 0x55aa
    Version 1 0x03
    Command 1 0x72
    Data length 2 0x0003
    Data 3 Subcommand: 0x19
    HDOP threshold (2 bytes): Its value is 10 times the actual value. The HDOP threshold ranges from 0 to 99.9, defaulting to 2.0.
    Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.

    The module returns the following data.

    Field Bytes Description
    Header 2 0x55aa
    Version 1 0x00
    Command 1 0x72
    Data length 2 0x0002
    Data 2
    • Data[0]: Subcommand 0x19
    • Data[1]: Status
      • 0: Failure.
      • 1: Success.
    Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.

    (Optional) Get GNSS positioning information (0x71 1A)

    The MCU integration protocol must be v1.1.3 or later.

    The MCU sends the following data.

    Field Bytes Description
    Header 2 0x55aa
    Version 1 0x03
    Command 1 0x71
    Data length 2 0x0001
    Data 1 Subcommand: 0x1A
    Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.

    The module returns the following data.

    Field Bytes Description
    Header 2 0x55aa
    Version 1 0x00
    Command 1 0x71
    Data length 2 0x0002/0x0014
    Data 2/20
    • Data[0]: Subcommand 0x1A
    • Data[1]: Status
      • 0: Failure. There is no following data. If latitude and longitude are returned, but other values fail, the result is 0.
      • 1: Success.
    • Longitude: 4-byte value in floating-point format.
    • Latitude: 4-byte value in floating-point format.
    • Signal strength: 1-byte value.
    • Number of satellites: 1-byte value.
    • Speed: 2-byte value, in the unit of 100 m/h.
    • Heading: 2-byte value, 10 times the actual value.
    • HDOP: 2-byte value, 10 times the actual value.
    • Orthometric height: 2-byte value, 10 times the actual value.
    Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.