EMQ – publish a message to singletopic
Publish a message to the system singlepubtopic. singlepubtopic is a predefined topic for single-
subscription systems, where the host is not expected to register a publish topic with +EMQPUBOPEN.
The publish topic and QoS (singlepubtopicqos) are defined in the configuration file. For more
information, see the [MQTT] section, Using the Quectel BG96 module configuration file on page62. The
index is not required.
Type Syntax Returned Result
Test
AT+EMQ=? OK
Read
AT+EMQ? OK
or
ERROR
Write
AT+EMQ=<pubdata>
where
<pubdata> – is the published message. If
<pubdata> is not contained within quotes,
it is sent as text with no modification. The
maximum payload length is 1000
characters. All characters must be printable.
If "<pubdata>" is contained within quotes,
it is handled as either ASCII-hex or text.
ETM handles "<pubdata>" as ASCII-hex if
it contains an even number of valid ASCII-
hex characters (0-9, a-f, A-F). ASCII-hex is
converted to binary for transmission.
ETM handles all other data as text. For text
messages, \ (escape characters) are
removed.
OK – command result
SEND OK – subsequent URC that is sent
when publish occurs. This will not happen
immediately if ETM is offline.
or
ERROR – check that [MQTT]
singlepubtopic is configured in the
configuration file. For more information,
see singlepubtopic on page67.
Example:
AT+EMQ="{\"BatteryPower\": \"Low\"}"
OK
SEND OK
45
Eseye-enabled Quectel BG96 module Developer Guide v1.8
MQTT telemetry ATcommands