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 (singlepubtopic) and QoS (singlepubtopicqos) are defined in the configuration file. For more information, see the [MQTT] section, Using the Cinterion® PLS62‑W Wireless Module configuration file. The index is not required.

Type Syntax Returned Result
Test AT+EMQ=?

OK

 

+EMQ:"<pubdata>"

Read AT+EMQ?

OK

or

ERROR

Write

AT+EMQ=<pubdata>

where

<pubdata> – is the published message. The maximum payload length is 1000 characters. All characters must be printable.

AnyNet SMARTconnect™ 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.

AnyNet SMARTconnect™ 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 AnyNet SMARTconnect™ is offline.

or

ERROR

Example

AT+EMQ="{\"BatteryPower\": \"Low\"}"

OK

 

SEND OK