If a device fails to establish MQTT connections with IoT Platform, you can troubleshoot the problem based on the error code.

IoT Platform uses the standard MQTT protocol. For more information about the MQTT protocol, see Standard MQTT protocol.

The following table lists the response codes.

Response code Response message Description
0 0x00 Connection Accepted 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.