If a device fails to establish a Message Queuing Telemetry Transport (MQTT) connection to IoT Platform, you can troubleshoot the issue based on the error code.

IoT Platform uses the standard MQTT protocol. For more information about the MQTT protocol, see the MQTT 3.1 or 3.1.1 documentation and MQTT 5.0 documentation.

The following tables describe the codes that may be returned by IoT Platform.

  • MQTT 3.1 and 3.1.1
    Return code Return message Description
    0 0x00 Connection Accepted The message returned when the connection is established.
    1 0x01 Connection Refused, unacceptable protocol version The error message returned because the server does not support the MQTT protocol version that is used by the device.
    2 0x02 Connection Refused, identifier rejected The error message returned because the server does not support the UTF-8 encoded client ID.
    3 0x03 Connection Refused, Server unavailable The error message returned because the MQTT service is unavailable even though the network connection has been established.
    4 0x04 Connection Refused, bad user name or password The error message returned because the format of the username or password parameter is invalid.
    5 0x05 Connection Refused, not authorized The error message returned because the device is not authorized.
  • MQTT 5.0
    Return code Return message Description
    0 0x00 Success The message returned when the connection is established.
    128 0x80 Unspecified error The error message returned because an unspecified error occurred.
    129 0x81 Malformed Packet The error message returned because a malformed packet was received.
    130 0x82 Protocol Error The error message returned because a protocol error occurred.
    132 0x84 Unsupported Protocol Version The error message returned because the protocol version is not supported.
    136 0x88 Server unavailable The error message returned because the server is unavailable.
    137 0x89 Server busy The error message returned because the server is busy.
    138 0x8A Banned The error message returned because the access is prohibited.
    140 0x8C Bad authentication method The error message returned because the authentication method is invalid.
    141 0x8D Keep Alive timeout The error message returned because a keep-alive timeout occurred.
    144 0x90 Topic Name invalid The error message returned because the topic name is invalid.
    147 0x93 Receive Maximum exceeded The error message returned because the number of received messages exceeds the limit.
    148 0x94 Topic Alias invalid The error message returned because the topic alias is invalid.
    149 0x95 Packet too large The error message returned because the packet length exceeds the limit.
    150 0x96 Message rate too high The error message returned because the message transmission rate is too high.
    151 0x97 Quota exceeded The error message returned because the quota is exceeded.
    152 0x98 Administrative action The error message returned because of an administrative action.
    153 0x99 Payload format invalid The error message returned because the payload format is invalid.
    154 0x9A Retain not supported The error message returned because messages cannot be retained.
    155 0x9B QoS not supported The error message returned because the QoS is not supported.
    156 0x9C Use another server The error message returned because another server needs to be used.
    157 0x9D Server moved The error message returned because the server is removed.
    158 0x9E Shared Subscription not supported The error message returned because shared subscription is not supported.
    159 0x9F Connection rate exceeded The error message returned because the connection rate exceeds the limit.