Function Control

Last Updated on : 2024-07-17 02:19:28download

This topic describes the commands for function control.

Turn on/off control over Bluetooth (0x72 89)

Turn on or off the Bluetooth connection after the device is registered. It is turned on by default.

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: 0x89
  • Control command:
    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: 0x89
  • 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 module’s MAC address (0x2d)

The MCU sends the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x03
Command 1 0x2d
Data length 2 0x0000
Data 0 None
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 0x2d
Data length 2 0x0007
Data 7
  • Data[0]: indicates whether the MAC address is obtained successfully.
    • 0x00: Success. The next 6 bytes denote a valid MAC address.
    • 0x01: Failure. The next 6 bytes denote an invalid MAC address.
  • Data[1] to Data[6]: indicates the valid MAC address of the module on a success.

Enable/disable low voltage shutdown (0x72 88)

Enable or disable low voltage shutdown for battery-powered devices. This feature is disabled by default.

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: 0x88
  • Control command:
    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: 0x88
  • 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.

Set the timeout for network exceptions (0x72 96)

If the module fails to attach to the network or dial up within the specified time period, the device will restart.

  • The minimum timeout is 180 seconds, with a deviation of 60 seconds.
  • If the timeout is set to 0, it indicates this feature is disabled. The device will not restart if it is in airplane mode, has no SIM card inserted, or does not start dialing.

The MCU sends the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x03
Command 1 0x72
Data length 2 0x0003
Data 3
  • Data[0]: Subcommand 0x96
  • Data[1] to Data[2]: The timeout in seconds, high byte first.
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: 0x96
  • 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.

Restart the module (0x72 98)

The MCU sends the following data.

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

The module restarts after receiving the command.

Report cellular network alerts (0x71 9a)

The module sends the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x00
Command 1 0x71
Data length 2 0x0002
Data 2
  • Data[0]: Subcommand 0x9A
  • Data[1]: Types of alerts
    • 1: Network registration error.
    • 2: Packet data protocol (PDP) activation error.
    • 3: TCP connection failure, which occurs after the device has been connected to the cloud.
Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.

Set the external wake-up pin (0x72 9b)

Configure the external wake-up pin for the module. LZ501, LZ201, and LZ211 have the default external wake-up pin configured, so this command is not needed for them.

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: 0x9B
  • GPIO pin: 1 byte
  • Low-level duration: 1 byte, in the unit of 10 ms.
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: 0x9B
  • 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.

Enable/disable remote logging (0x72 9c)

By default, this feature is disabled. The configuration is stored in the key-value storage.

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: 0x9C
  • 00: Disable.
  • 01: Enable.
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: 0x9C
  • 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.

Notify the MCU of restarting the device (0x72 9d)

This feature applies to the MA510 module only.

The module sends the following data.

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

The MCU returns the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x03
Command 1 0x72
Data length 2 0x0002
Data 2
  • Subcommand: 0x9D
  • 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.

Enable SIM card hot swapping (0x72 9e)

The default state is based on the actual state of the module. The configuration is stored in the key-value storage.

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: 0x9E
  • Control command:
    • 1: Enable
    • 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: 0x9E
  • 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.

Control ADC (0x72 A0)

  • Scheduled ADC reading will be stopped if you set the interval to 0 or choose a one-time reading task.
  • 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 + 2/1/3/0
Data 0x0003 + 2/1/3/0
  • Subcommand: 0xA0
  • Command:
    • 0x0: ADC initialization
    • 0x1: One-time ADC reading
    • 0x2: Scheduled ADC reading
    • 0x4: ADC deinitialization
  • Port (1 byte)
  • When the command is 0:
    • Reference voltage (2 bytes)
  • When the command is 1:
    • Number of readings (1 byte)
  • When the command is 2:
    • Reading interval (2 bytes) in milliseconds
    • Number of readings (1 byte)
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 + 2/(2+2N)/1/(2+2N)/1
Data 0x0003 + 2/(2+2N)/1/(2+2N)/1
  • Subcommand: 0xA0
  • Command:
    • 0x0: ADC initialization
    • 0x2: Scheduled ADC reading
    • 0x1 and 0x3: ADC reporting
    • 0x4: ADC deinitialization
  • Port (1 byte)
  • When the command is 2 or 4:
    • Result (1 byte): 0 for success, and 1 for failure.
  • When the command is 1 or 3 (1 + 2N bytes):
    • Result (1 byte): 0 for success, and 1 for failure.
    • Number of readings (1 byte): N
    • ADC value (2 bytes × N)
Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.

Control GPIO (0x72 A1)

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 + 3/0/1/0/5
Data 0x0003 + 3/0/1/0/5
  • Subcommand: 0xA1
  • Command:
    • 0x0: GPIO initialization
    • 0x1: GPIO deinitialization
    • 0x2: Writing GPIO
    • 0x3: Reading GPIO
    • 0x4: Periodic output
  • Pin number (1 byte)
  • When the command is 0:
    • Set the direction (1 byte): 0 for input and 1 for output.
    • Set the mode (1 byte):
      • Input mode: 0 for pull-up. 1 for pull-down. 2 for high impedance.
      • Output mode: 4 for push-pull.
    • The initial level (1 byte): 0: Low level. 1: High level. In input mode, this parameter is invalid.
  • When the command is 2 (1 byte):
    • 0: Low level
    • 1: High level
  • When the command is 4:
    • Initial level (1 byte):
      • 0: Low level
      • 1: High level
    • High-level duration (2 bytes) in milliseconds.
    • Low-level duration (2 bytes) in milliseconds.
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 + 1/1/1/2/1
Data 0x0003 + 1/1/1/2/1
  • Subcommand: 0xA1
  • Command:
    • 0x0: GPIO initialization
    • 0x1: GPIO deinitialization
    • 0x2: Writing GPIO
    • 0x3: Reading GPIO
    • 0x4: Periodic output
  • Pin number (1 byte)
  • When the command is 0, 1, 2, or 4:
    • Result (1 byte): 0 for success, and 1 for failure.
  • When the command is 3 (1 byte):
    • Result (1 byte): 0 for success, and 1 for failure.
    • Voltage level (1 byte)
Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.

Enable reset status notification (0x34 04)

The module supports local reset, reset via the app, and factory reset. This feature enables the module to proactively send its reset status to the MCU.

The MCU sends the following data.

Field Length Description
Header 2 0x55aa
Version 1 0x03
Command 1 0x34
Data length 2 0x0001
Data 1 0x04 (subcommand)
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 0x34
Data length 2 0x0002
Data 1
  • 0x04 (subcommand)
  • Result:
    • 0x00: Success.
    • 0x01: Failure.
Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.

Notify the MCU of reset status (0x34 05)

After the first attempt fails, the module will try two more times with a one-second interval.

The module sends the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x00
Command 1 0x34
Data length 2 0x0002
Data 2 0x05 (subcommand)
The reset status:
  • 0x00: Local reset.
  • 0x01: Reset via app.
  • 0x02: Factory reset via app.
Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.

The MCU returns the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x03
Command 1 0x34
Data length 2 0x0001
Data 1 0x05 (subcommand)
Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.

Send update in progress status (0x34 0A)

  • This command applies to MA510 modules only. The MCU integration protocol must be v1.1.4 or later.
  • When the module is updating its firmware, it will respond with this status upon receiving a command from the MCU instead of executing it. The MCU must wait for the update to complete.
  • During a firmware update, the module will automatically stop reporting all data except for the update status. If the module restart depends on the MCU controlling uart3_tx, the MCU should pull down uart3_tx when receiving the update status. After the module restarts, the MCU should restore the configuration of uart3_tx when receiving a heartbeat from the module.

The module sends the following data.

Field Bytes Description
Header 2 0x55aa
Version 1 0x00
Command 1 0x34
Data length 2 0x0002
Data 2 0x0A (subcommand)
The update status: 0x01 indicates the module is updating its firmware.
Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.