SARA-R4/N4 series-AT Commands Manual
UBX-17003787 - R09

24MQTT
Page 249 of 307
Parameter Type Description
<client_id> String Uniquely identifies this client connection to a given MQTT message broker. If a new
connection request is received with the same unique client ID as a current connection,
the MQTT message broker disconnects the previous connection and responds to
(and uses the parameters from) the new connection request. If this parameter is not
defined, the module will attempt to create a unique client ID, based on the module's
IMEI value.
<local_port> Number MQTT client TCP port; if the MQTT client port number is not specified, the port
number defaults to the IANA assigned port of 1883 for non-TLS MQTT and 8883 for
TLS MQTT.
<server_name> String Indicates the remote server name. The default value is an empty string.
<IP_address> String Indicates the remote server IP address. The default value is an empty string.
<username> String User name for the MQTT login procedure. The maximum length is 30 characters. The
default value is an empty string.
<password> String Password for the FTP login procedure. The maximum length is 30 characters. The
default value is an empty string.
<timeout> Number Indicates the inactivity timeout expressed in seconds. According to the MQTT
specification, an MQTT server must disconnect a client if it receives nothing from
the client within 1.5x the inactivity timeout. An inactivity timeout value of 0 indicates
no timeout. The default value is 0 s. The maximum value corresponds to 18 hours, 12
minutes and 15 seconds.
<server_port> Number Remote MQTT server listening port; it must be a valid port value. The range goes
from 1 to 65535; the default value is 1883 for non-TLS MQTT and 8883 for TLS
MQTT.
<MQTT_secure> Number Enables / disables the secure option of MQTT service:
• 0 (default value): no TLS encryption
• 1: enable the MQTT TLS encryption
<USECMNG_profile> Number USECMNG profile (number). Defines the USECMNG profile which specifies the SSL/
TLS properties to be used for the SSL/TLS connection. The range goes from 0 to 4. If
no profile is set a default USECMNG profile is used (see USECMNG section).
<clean_session> Number Clean Session value. Allowed values:
• 0: indicates that the client subscription and delivered messages received by the
client should be remembered across disconnects by both the MQTT client and the
MQTT server
• 1: indicates that disconnects clean all session state information
<param1> Number /
String
Type and supported content depend on the related <op_code> parameter (details are
given above). If <param1> is not specified the value of the corresponding parameter
<op_code> is reset to the default value.
<param2> Number /
String
Type and supported content depend on the related <op_code> parameter (details are
given above). If <param2> is not specified the value of the corresponding parameter
<op_code> is reset to the default value.
<result> Number
• 0: failure
• 1: success
24.1.4î™–î™–î™–î™–Notes
• The information text response to the read command does not display the password.
• The MQTT server IP address and the MQTT server name are mutually exclusive. If value for <op_code>=
2 is specified by the user, then the value for <op_code>=3 is reset or vice versa.
• Some network operators do not allow Secure MQTT. In this case the +UMQTTC=1 command (MQTT login)
will return a failure response by means of the +UUMQTTC URC after an TLS timeout of 30 s.
SARA-R4 / SARA-N4
• The information text response to the read command provides a continuation string, (more), if more
information remains to be displayed. By issuing again the read command, the MQTT will attempt to
continue the previous display attempt.
• For individual MQTT parameter fields, especially the string fields (double-quote delimited), the
continuation symbol + indicates whether the current display is a continuation from a previous display or
whether the current display has more information to be displayed.
• If the continuation symbol precedes the first double-quote, e.g., Topic: +"is continuing from previous
display", then this MQTT parameter field continues from a previous display command. If the continuation
symbol trails the last double-quote, e.g., Topic: "This message won't fit within the limita"+, then it