Last Updated on : 2024-06-04 06:16:47download
This topic describes the data format and basic features for the cellular standard protocol. The serial protocol is used for serial communication between Tuya’s LTE Cat.1 module and the third-party MCU.
Field | Bytes | Description |
---|---|---|
Header | 2 | It is fixed to 0x55aa. |
Version | 1 | It is used for updates and extensions. |
Command | 1 | The frame type. |
Data length | 2 | Big-endian format. |
Data | N | - |
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
All data greater than one byte is transmitted in big-endian format.
Typically, one command is sent by one party and received by the other party synchronously. That is, one party sends a command and waits for a response from the other party. If the sender does not receive a correct response packet within a specified time period, the transmission times out.
If the module does not respond to the MCU command within two minutes, the MCU must restart it. After the MA510 module completes an OTA update, it will restart without notifying the MCU. If the MA510 module starts with uart3_tx
high, it will fail to start and require the MCU to trigger a restart.
Both command sending and status reporting use asynchronous transmission. Assume that the module sends a control command X and the MCU reports status Y. The data transmission is performed as shown below.
The module sends a control command:
The MCU reports status:
The module returns the following data.
Field | Bytes | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0xFF |
Data length | 2 | 2+N (version information) |
Data | 2+N |
|
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 FF 00 07 70 24 31 2E 30 2E 31 87
The module sends heartbeats to the MCU every 15 seconds. If the MCU does not respond within the 90-second timeout period, the module considers a communication exception occurred and will restart the software.
The MCU can determine whether the module works properly by the regular heartbeat check. If the MCU does not receive a heartbeat packet as expected, it can use the reset pin to reset the module.
The module sends the following data.
Field | Bytes | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x00 |
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. |
Example: 0x55aa 00 00 0000 ff
The MCU returns the following data.
Field | Bytes | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x03 |
Command | 1 | 0x00 |
Data length | 2 | 0x0001 |
Data | 1 |
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
Example:
The MCU returns 0x55aa 03 00 0001 00 03
after a restart.
The MCU returns 0x55aa 03 00 0001 01 04
except for the first response after a restart.
Product information consists of the product ID (PID) and the MCU software version number.
x.x.x
where x
is a decimal digit between 0 and 99.The module sends the following data.
Field | Bytes | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x01 |
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. |
Example: 0x55aa 00 01 0000 00
The MCU returns the following data.
Field | Bytes | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x03 |
Command | 1 | 0x01 |
Data length | 2 | N |
Data | N | {“p”:“AIp08kLIftb8x2x0”, “v”:“1.0.0”, “m”:1, “apn”:“cniot”, “mht”:60, “qr”:1, “slave”:1, “ext_ota”:[{ “ch”:1, “v”:“0.1.1” }, … { “ch”:n, “v”:“0.1.n” }], “U”:0, “dp_cache”:1, “cops”:“xxx” “dp_ack”:1, “online_tts”:0 } apn is optional. If apn is not specified, the system will configure the APN settings automatically. mht , qr , and slave are optional. |
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
Example: {"p":"AIp08kLIftb8x2x0", "v":"1.0.0", "m":1}
p
indicates the PID is AIp08kLIftb8x2x0
.
v
indicates the MCU version is 1.0.0.
m
indicates the power consumption of the module.
0
: standard power.1
: low power. The period of the provided timer is one second.mht
: the MQTT heartbeat interval for the module, in seconds. The default value is 300 seconds.
qr
: specifies whether to get the short URL of the QR code for pairing.
1
: get the short URL.0
: not get the short URL. If a device has been paired, the short URL will not be pulled.slave
: specifies whether the LTE Cat.1 module works in tandem with a Bluetooth LE module.
ext_ota
: OTA update for subordinate MCU firmware. v
: version information. The maximum length is 10 bytes, with up to six update channels supported. The update channels dedicated to the application firmware and basic firmware must not be used.
U
: specifies the protocol for MCU OTA updates.
0
: protocol version 0
1
: protocol version 1
slave
is set and U
is not set, protocol version 0 is used.slave
and U
are set, 0 and 1 represent protocol version 0 and protocol version 1 respectively.slave
and U
are not set, protocol version 0 is used.slave
is not set and U
is set, 0 and 1 represent protocol version 0 and protocol version 1 respectively.dp_cache
: specifies whether to enable DP cache. DP cache requires an additional cloud-based feature. For more information, contact your account manager.
1
: Enable.(Optional) cops
: specifies the public land mobile network (PLMN) of the mobile operator. The value must be numeric encoding. For example, cops:"20416"
is equivalent to AT command AT+COPS=1,2, "xxxxx"
. If you are using LTE Cat-M1 modules, check with your product manager to decide if this field needs to be set.
(Optional) dp_ack
: specifies whether to enable acknowledgment (ACK) response. Set it to 1
to enable ACK. If the module does not receive an ACK message after it sends DP data to the MCU, it will transmit the packet again. A packet can be retransmitted up to three times, with an ACK wait time of 500 ms.
online_tts
: setting it to 1
indicates that online text-to-speech (TTS) is supported. This feature applies when the module supports the audio service.
gps
: GPS model, defaulting to Unicore UFirebird. Allystar’s GPS module also applies. When using the assisted GNSS (AGNSS) service, you need to specify the GPS model. The MCU integration protocol must be v1.1.3 or later.
env_pre
: 1
for the staging environment, and other values for the production environment. The MCU integration protocol must be v1.1.3 or later.
net_type
(for MA510 only): The MCU integration protocol must be v1.1.4 or later.
0
or empty: Auto1
: GSM2
: LTE4
: CATM5
: NB-IoTWhen specifying this field, check the supported network types of the module.
The working mode indicates how the network status is indicated and the way to trigger module reset. Theoretically, the module can work in the following two modes:
The MCU works with the module to process network events.
The module processes network events itself.
NET_MODE
pin on the module drives the LED indicator to indicate the network status.In the module self-processing mode, the LED indicator can only be defined by NET_MODE
. In this case, the module does not report network status.
The module sends the following data.
Field | Bytes | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x02 |
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. |
Example: 0x55aa 00 02 0000 01
The MCU returns the following data.
Field | Bytes | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x03 |
Command | 1 | 0x02 |
Data length | 2 |
|
Data | 0/2 | The data length is 2 bytes. The first byte indicates the GPIO pin of the LED indicator. The fixed value is 0 . The second byte indicates the GPIO pin of the reset button. |
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
Example:
0x55aa 03 02 0000 04
is returned.0x55aa 03 02 0002 0c0d 1f
is returned. 0x0c
indicates the LED indicator is connected to GPIO12. 0x0d
indicates the reset button is connected to GPIO13.Network status | Description | Status value | LED indicator in module self-processing mode |
---|---|---|---|
Status 1 | The SIM card is not connected. | 0x00 | Steady on |
Status 2 | The module searches for cellular networks. | 0x01 | On for 0.1 seconds and off for 0.3 seconds |
Status 3 | The module is registered with the cellular network but not connected to the network. | 0x02 | On for 0.1 seconds and off for 1 second |
Status 4 | The module is connected to the network and gets an IP address. | 0x03 | On for 0.1 seconds and off for 2 seconds |
Status 5 | The module has been connected to the cloud. | 0x04 | On for 0.1 seconds and off for 3 seconds |
Status 6 | SIM card registration is denied, which might be because it is not subscribed to a cellular service provider. | 0x05 | On for 0.1 seconds and off for 0.1 seconds |
Status 7 | The device is ready for pairing. | 0x06 | On for 0.1 seconds and off for 2 seconds |
Status 8 | Unknown status | 0xFF | - |
1
: The SIM card is not connected.2
: The module searches for cellular networks.3
: The module is registered with the cellular network but not connected to the network.4
: The module is connected to the network and gets an IP address.5
: The module has been connected to the cloud.6
: SIM card registration is denied, which might be because it is not subscribed to a cellular service provider.7
: The device is ready for pairing.The module sends the following data.
Field | Bytes | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x03 |
Data length | 2 | 0x0001 |
Data | 1 | See the description of network status. |
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
Example: 0x55aa 00 03 0001 00 03
The MCU returns the following data.
Field | Bytes | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x03 |
Command | 1 | 0x03 |
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. |
Example: 0x55aa 03 03 0000 05
When the LTE Cat.1 module receives the reset command, it unbinds the device from the cloud.
The MCU sends the following data.
Field | Bytes | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x03 |
Command | 1 | 0x04 |
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. |
Example: 0x55aa 03 04 0000 06
The module returns the following data.
Field | Bytes | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x04 |
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. |
Example: 0x55aa 00 04 0000 03
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: 0x41 |
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 | n |
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
After receiving the short URL of the QR code from the cloud, the module proactively sends it to the MCU. This feature is usually used on devices that have a screen to show the QR code.
The module sends the following data.
Field | Bytes | Description |
---|---|---|
Header | 2 | 0x55aa |
Version | 1 | 0x00 |
Command | 1 | 0x72 |
Data length | 2 | 0x0001 + N |
Data | 1 + N |
|
Checksum | 1 | Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder. |
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback