# MXMesh Command

#AT+XMSVC

Function: Set and query services in the MXMesh attribute database.

Query Command:

AT+XMSVC?

Response:

+XMSVC:<svc-idx>,<type>

OK

Paramter:

Refer to Set Command Parmater.

Set Command:

AT+XMSVC=<svc-idx>,<type>

Response:

OK

Paramter:

  • svc-idx: Number Type. Service number,Range 0-7.
  • type: String Type. Service type, the string form of a 2-bit hexadecimal number.

Description:

  • If AT+SYSSTORE=1, the configuration changes will be saved in the KV area.
  • Setting the same service number will remove the previous service with the same number.
  • If there are multiple services, the query will display multiple rows, with each row displaying one service.

#AT+XMATT

Function: Set and query attributes in the MXMesh attribute database.

Query Command:

AT+XMATT?

Response:

+XMATT:<att-idx>,<type>,<rw>,<upload>,<format>,[length],[cp]

OK

Paramter:

Refer to Set Command Parmater.

Set Command:

AT+XMATT=<att-idx>,<type>,<rw>,<upload>,<format>,[length],[cp]

Response:

OK

Paramter:

  • att-idx: Number type. Attribute number, range 0-7
  • type: String Type. Service type, the string form of a 4-bit hexadecimal number.
  • rw: Number Type.

Same function as the "OPT" key in the configuration file.

<span class="ne-text" style="font-size: 14px">Function options, each BIT bit of the number represents different functions, and multiple functions can be selected.</span>

*   <span class="ne-text" style="font-size: 14px">BIT (0): The attribute can be read.</span>
*   <span class="ne-text" style="font-size: 14px">BIT (1): Attributes can be written.</span>
*   <span class="ne-text" style="font-size: 14px">BIT (2): Core attribute. When reading an attribute, if it does not include the type of attribute being read, the core attribute is used as the response for the read.</span>
  • upload: Number Type.

The function is the same as the "UP" key in the configuration file.

When updating the attribute value through the AT instruction

(AT+XMUPDATE instruction), the module automatically sends the new

value to the multicast address (D003) or gateway address behavior

definition:

*   <span class="ne-text" style="font-size: 14px">0: NONE, disable the automatic sending of attributes after updates.</span>
*   <span class="ne-text" style="font-size: 14px">1: TRIGGER, immediately sent to the multicast address (D003), is usually used to trigger linkage, and can continuously trigger linkage after updating the same value.</span>
*   <span class="ne-text" style="font-size: 14px">2: LOGGER, regardless of whether the attributes have changed, is randomly delayed and then sent to the gateway through unicast. If the gateway does not exist, it will not be sent.</span>
*   <span class="ne-text" style="font-size: 14px">3: PUBLISH, after a random delay and comparing the attribute values again to see if they have changed, is sent to the multicast address.</span>
*   <span class="ne-text" style="font-size: 14px">4: State TRIGGER, if the device value changes, immediately send to the multicast address. Therefore, compared to TRIGGER, the same linkage cannot be triggered continuously.</span>
  • format: Number/Sting Type.

The function is the same as the "F" key in the configuration file. If it is a

number type, it represents a single attribute type, ranging 0-13.

If it is a string type, the character form is "format, format,...", indicating

that the attribute type is a structure, and the format of the elements

common to the structure is represented by format

Attribute definition:

0: BOOLEAN, 1: UINT8, 2: UINT16, 3: UINT32, 4: INT8, 5: INT16, 6: INT32

7: UINT16_ 1F, 8: UINT16_ 2F, 9: INT16_ 1F, 10: INT16_ 2F, 11: FLOAT,

12: DATA, 13: STRING

  • length: Number Type. If the attribute format is DATA or STRING, it indicates the data length of the attribute. Other attribute format data is not required.
  • cp: Number Type. Optional, 0/Empty: Normal attribute, 1: Control point attribute.

Note: Although control attributes can be defined, reading and writing of

such attributes is currently not supported.

Description:

  • If AT+SYSSTORE=1, the configuration changes will be saved in the KV area.
  • If there are multiple attributes, the query will display multiple rows, with each row displaying one attribute.

Demo:

AT+XMATT?
+XMATT:0,"0100",7,3,0,1,0
+XMATT:1,"010A",3,3,1,1,0
+XMATT:2,"0116",3,3,2,2,0
+XMATT:3,"0119",3,3,4,1,0
+XMATT:4,"010E",3,3,9,2,0
+XMATT:5,"0102",3,3,13,16,0
+XMATT:6,"0160",3,3,"8 8 11",8,0

OK
AT+XMATT=0,"0100",7,3,0,1,0

OK

#AT+XMINS

Function: Set and query attribute instances in the MXMesh attribute database.

Query Command:

AT+XMINS?

Response:

+XMINS:<svc-idx>,<att-idx>

OK

Paramter:

Refer to Set Command Parmater.

Set Command:

AT+XMINS=<svc-idx>,<att-idx>[,<svc-idx>,<att-idx>...]

Response:

OK

Paramter:

svc-idx: Number Type. Range 0-7.

att-idx: Number Type Range 0-7

Description:

  • If AT+SYSSTORE=1, the configuration changes will be saved in the KV area.
  • When setting attribute examples, it is necessary to write all attributes at once, rather than setting one instance at a time.
  • When querying attribute examples, if there are multiple instances, the query will display multiple rows, with each row displaying one instance.

Demo:

AT+XMINS?
+XMINS:0,0,0
+XMINS:1,0,1
+XMINS:2,0,2
+XMINS:3,0,3
+XMINS:4,0,4
+XMINS:5,0,5
+XMINS:6,0,6

OK
AT+XMINS=0,0,0,1,0,2,0,3,0,4,0,5,0,6

OK

#AT+XMINSPRI

Set and query the primary attribute instance in the MXMesh attribute database. The primary attribute instance will be included in the heartbeat packet. To ensure network performance, the data length of the primary attribute instance should not exceed 5 bytes to prevent fragmentation of the heartbeat packet.

Query Command:

AT+XMINSPRI?

Response:

+XMINSPRI:<ins-idx>

OK

Paramter:

Refer to Set Command Parmater.

Set Command:

AT+XMINSPRI=<ins-idx>

Response:

OK

Paramter:

ins-idx: Number Type. Attribute instance number.

Description:

  • If AT+SYSSTORE=1, the configuration changes will be saved in the KV area.

#AT+XMUPDATE

Function: Update the value of the property instance.

Set Command:

AT+XMUPDATE=[<ins-idx>, <value>,...]

Response:

OK

Paramter:

ins-idx: Number Type. Attribute instance number.

value: String Type. Attribute value.

Description:

  • The MXMesh system needs to be running before it can be executed. It can be set to start automatic operation or send the AT+XMSTART command to start the MXMesh system. Before starting the MXMesh system, ensure that the attribute database has been set up.
  • An instruction can contain multiple 'attributes/values' to update data for multiple attributes.
  • The attribute values are filled in according to the true values, and there is no need to convert them into the actual values transmitted in the MXMesh protocol based on the attribute format. For example, a format is uint16_ If you want to send a value of 23.4 for the attribute of 1f, the value should be "23.4" instead of "234".
  • If the attribute format is of type Struct, value contains multiple attributes separated by spaces. That is, the format of the attribute value is' value1 value2 value3... '.
  • If the attribute format is of String type, the attribute value can be any character.
  • If the attribute format is a Data type, the attribute value is a string converted from hexadecimal data, for example: sending two bytes of data, 0x12 and 0x34, and the value value is a character with a length of 4 bytes: "1234".

Demo:

AT+XMUPDATE=0,"0",1,"1",2,"4332",3,"-33",4,"26.9"

OK
AT+XMUPDATE=5,"Hello world" //Update string type properties

OK
AT+XMUPDATE=6,"220 2.5 550" //Update Structure Type Properties

OK

#AT+XMSEND

Function: Actively send attribute instances.

Set Command:

AT+XMSEND=<addr>,[<ins-idx>]

Response:

OK

Paramter:

addr: Number Type.

  • 0: Multicast address D003.
  • 1: The unicast address of the gateway must be discovered by the device before it can be executed successfully.

ins-idx: Number Type. Attribute instance number. If empty, all attributes will be sent.

Description:

  • 发送到组播地址 D003 数据可以到达网络中的其他所有设备,只要 XMMesh 启动后就执行。不仅可以通过网关上报到云端还可以触发本地设备的联动。
  • 发送到网关的单播地址,必须在设备发现网关后才能执行成功。单播发送数据,带有等待应答并且重发机制,所以消息的发送成功率比组播发送高。
  • Send to multicast address D003, data can reach all other devices in the network, as long as XMMesh is started and executed. Not only can it be reported to the cloud through the gateway, but it can also trigger the linkage of local devices.
  • Send to unicast address of the gateway, it must be discovered by the device before it can be executed successfully. Unicast sends data with a waiting for response and resending mechanism, so the success rate of message sending is higher than multicast sending.

#AT+XMSHADOW

Function: Obtain the data contained in the attribute instance stored in the XMMesh database. Use query instructions to obtain all attribute values, and use setting instructions to obtain attribute values for specific attribute instances.

Query Command:

AT+XMSHADOW?

Response:

OK

Paramter:

Please refer to Set Command parameter.

Set Command:

AT+XMSHADOW=<ins-idx>,[<ins-idx>,...]

Response:

+XMSHADOW:[<ins-idx>, <value>,...]

OK

Paramter:

ins-idx: Number Type. Attribute instance number.If empty, all attributes will be sent.

value: String Type. Attribute value.

Demo

AT+XMSHADOW?
+XMSHADOW:0,"0",1,"1",2,"4332",3,"-33",4,"26.9",5,"Hello world",6,"220.00 2.50 550.000000"

OK
AT+XMSHADOW=4
+XMSHADOW:4,"26.9"

OK

#AT+XMERASE

Function: Erase the distribution network information from Flash.

Execute Command:

AT+XMERASE

Response:

OK

#AT+XMPROV

Function:Put the device into distribution mode and erase the distribution information from Flash. After executing the current command, it will cause the module to restart.

Execute Command:

AT+XMPROV

Response:

OK

#AT+FACTORY

Function: Erase all configuration information from Flash and restore it to the factory state.

Execute Command:

AT+FACTORY

Response:

OK

#AT+XMSTART

Function: Start the MXMesh system and assign initial values to attribute instances.

Execute Command:

AT+XMSTART

Response:

OK

Set Command:

AT+XMSTART=[<ins-idx>, <value>,...]

Response:

OK

Paramter:

ins-idx: Number Type. Attribute instance number.

value: String Type. Attribute value.

Description:

  • The method of assigning initial values to attribute instances in setting instructions. Please refer to the method for updating attribute values in AT+XMUPDATE.
  • If the MXMesh attribute database device is incorrect, it will cause the XMMesh system to run abnormally.

Demo:

AT+XMSTART=0,"0",1,"1",2,"4332",3,"-33",4,"26.9"

OK
+XM_STARTED

#AT+XMAUTO

Function:Automatically start the MXMesh system when the device starts.

Set Command:

AT+XMAUTO=<auto>

Response:

OK

Paramter:

auto: Number Type.

  • 0: Powering on does not automatically start the MXMesh system
  • 1: Automatically start MXMesh system when powered on

Description:

  • If the MXMesh attribute database device is incorrect, it will cause the XMMesh system to run abnormally.

#AT+XMEVENT

Function: Query and set event feedback for MXMesh system.

Query Command:

AT+XMEVENT?

Response:

+XMEVENT:<event>

OK

Paramter:

Please refer to Set Command parameter.

Set Command:

AT+XMAUTO=<auto>

Response:

OK

Paramter:

event: Number Type.

  • BIT [0]:+WRITE event format

    • 0: A+WRITE event contains multiple attributes written at once. No+XM generated_ WRITE_ START and+XM_ WRITE_ FINISHED event
    • 1: A+WRITE event contains an attribute that generates+XM when writing begins_ WRITE_ START event, generating+XM after writing ends_ WRITE_ FINISHED event.

#AT+BLENAME

Function: Query/Set Bluetooth LE Device Name

Query Command:

AT+BLENAME?

Response:

+BLENAME:<device_name>

OK

Paramter:

Please refer to Set Command parameter.

Set Command:

AT+BLENAME=<device_name>

Response:

OK

Paramter:

device_name: String Type.

Description:

  • If AT+SYSSTORE=1, the configuration changes will be saved in the KV area.

Demo:

AT+BLENAME="Hello"

OK
AT+BLENAME?
+BLENAME:"Hello"

OK

#AT+BLEADDR

Function:Query the BLE public static address of the device, which is also the built-in MAC address of the device.

Query Command:

AT+BLEADDR?

Response:

+BLEADDR:<public_addr>

OK

Paramter:

public_addr: String Type.

Demo:

AT+BLEADDR?
+BLEADDR:"D0:BA:E4:8F:07:E2"

OK

#AT+FOGKEY

Function: Set up and query access credentials for the FogCloud cloud platform.

Query Command:

AT+FOGKEY?

Response:

+FOGKEY:<PK>,<PS>,<DN>,<DS>

OK

Paramter:

Please refer to Set Command parameter.

Set Command:

AT+FOGKEY=<PK>,<PS>,<DN>,<DS>

Response:

OK

Paramter:

PK: String Type. Product key.

PS: String Type. Product Secret.

DN: String Type. Device name

DS: String Type. Device secret

Description:

  • If AT+SYSSTORE=1, the configuration changes will be saved in the KV area.
  • If the device writes both Fogkey and Linkkey, it is found in the device's distribution network that the broadcast package contains the product type of the Feiyan platform.

Demo:

AT+FOGKEY="e64e9016","48b7954abfa5456fb6846a6b7f454603","00000000","3044720584c05fa1ec0aa6fe57ebcba3"

OK

AT+FOGKEY?
+FOGKEY:"e64e9016","48b7954abfa5456fb6846a6b7f454603","00000000","3044720584c05fa1ec0aa6fe57ebcba3"

OK

#AT+LINKKEY

Function: Set up and query the access credentials of Alibaba Cloud Life Platform (Feiyan).

Query Command:

AT+LINKKEY?

Response:

+LINKKEY:<PK>,<DN>,<DS>,<PS>,<PID>

OK

Paramter:

Please refer to Set Command parameter.

Set Command:

AT+LINKKEY=<PK>,<DN>,<DS>,<PS>,<PID>

Response:

OK

Paramter:

PK: String Type. Product key.

DN: String Type. Device name

DS: String Type. Device secret

PS: String Type. Product Secret.

PID: String Type. Product ID

Description:

  • If AT+SYSSTORE=1, the configuration changes will be saved in the KV area.
Last Updated: 11/29/2023, 1:52:34 PM