This topic describes common errors that may occur when you configure Link SDK for C to connect devices to IoT Platform.
You can use the following methods to check the internal status and identify the cause when a connection fails.
View logs by calling the callback function in the SDK.
The following table describes common error codes. For the complete list of error codes, see aiot_state_api.h.
Error codes for MQTT connections
Error code | Description |
The Message Queuing Telemetry Transport (MQTT) server rejected the connection, and the service is unavailable. Try again later. | |
The username or password is invalid. | |
The MQTT server failed to authenticate the client because the password is invalid. Check whether the device authentication information is valid. |
Error codes for HTTPS connections
Error code | Description |
The system failed to parse a valid status code from the received HTTPS message. The | |
When the system parses the received HTTPS message, the message body is obtained but no additional data is available. | |
The returned HTTPS status code is not 200 and the authentication failed. Check whether the signature is valid. | |
The HTTPS response is not received and the authentication failed. | |
The system failed to parse the token from the HTTPS response and the authentication failed. |
Error codes for the network layer
Error code | Description |
The system failed to resolve the TCP domain name. Check whether the domain name or IP address is valid. | |
The TCP connection failed to be established. | |
The maximum length of a Transport Layer Security (TLS) message cannot be set to 0. Check and modify the settings. | |
The TLS server certificate is invalid. Check the server certificate. | |
The TLS client certificate is invalid. Check the client certificate. | |
The TLS client key is invalid. Check the client key. | |
The system failed to resolve the TLS domain name. Check whether the domain name or IP address is valid. | |
The TLS socket failed to be created. | |
The connection that is established by using the TLS socket failed. | |
The received SSL message is invalid. Check whether the size of the TLS frame is too small. |