EMQREAD – read message from MQTT RX queue

AnyNet SMARTconnect™ can store up to three MQTT messages in a queue in the Quectel module’s volatile memory. For more information, seeMQTT Rx Queue.

AT+EMQREAD reads the stored messages.

Type Syntax Returned Result
Test

AT+EMQREAD=?

OK

Read

AT+EMQREAD?

OK

Write

AT+EMQREAD

+EMQREAD: S,<len>\r\n<data>

OK

or

+EMQREAD: <id>,<len>\r\n<data>

OK

or

+EMQREAD: NO MESSAGE

OK

where:

  • S is for singletopic only. Indicates data received on a single topic. For information about singletopic, see EMQ – publish a message to singletopic.

  • <id> is the subscribed topic index number, not for singletopic use
  • <len> is the length of the incoming data
  • <data> is the received data in either ASCII-hex format or as text, depending on both the urcautoformat setting in the configuration file, and if <data> appears within quotes.

    For example, if the urcautoformat setting = 1, then:

    • <id>,<len>\r\n"<data>" reports data in ASCII-hex format
    • <id>,<len>\r\n<data> reports data in text format

    For more information, see Using AnyNet SMARTconnect™ configuration file.

Example

AT+EMQREAD

+EMQREAD: 0,20

Example data message

OK