You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/iot-hub/troubleshoot-error-codes.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -128,8 +128,8 @@ This error can occur because the [SAS token used to connect to IoT Hub](iot-hub-
128
128
129
129
Some other possibilities include:
130
130
131
-
* The device lost underlying network connectivity longer than the [MQTT keep-alive](../iot/iot-mqtt-connect-to-iot-hub.md#default-keep-alive-timeout), resulting in a remote idle time-out. The MQTT keep-alive setting can be different per device.
132
-
* The device sent a TCP/IP-level reset but didn't send an application-level `MQTT DISCONNECT`. Basically, the device abruptly closed the underlying socket connection. Sometimes, bugs in older versions of the Azure IoT SDK might cause this issue.
131
+
* The device lost underlying network connectivity longer than the [MQTT keep-alive](../iot/iot-mqtt-connect-to-iot-hub.md#default-keep-alive-time-out), resulting in a remote idle timeout. The MQTT keep-alive setting can be different per device.
132
+
* The device sent a TCP/IP-level reset but didn't send an application-level `MQTT DISCONNECT`. Basically, the device abruptly closed the underlying socket connection. Sometimes, this issue is caused by bugs in older versions of the Azure IoT SDK.
133
133
* The device side application crashed.
134
134
135
135
Or, IoT Hub might be experiencing a transient issue. For more information, see [500xxx Internal errors](#500xxx-internal-errors).
|[C#](https://github.com/Azure/azure-iot-sdk-csharp/tree/main/iothub/device/samples)|`TransportType.Mqtt`|`TransportType.Mqtt` falls back to MQTT over WebSockets if MQTT fails. To specify MQTT over WebSockets only, use `TransportType.Mqtt_WebSocket_Only`|
68
-
|[Python](https://github.com/Azure/azure-iot-sdk-python/tree/main/samples)| Uses MQTT by default |Add `websockets=True` in the call to create the client|
|[C#](https://github.com/Azure/azure-iot-sdk-csharp/tree/main/iothub/device/samples)|[TransportType](/dotnet/api/microsoft.azure.devices.client.transporttype).Mqtt | TransportType.Mqtt falls back to MQTT over WebSockets if MQTT fails. To specify MQTT over WebSockets only, use TransportType.Mqtt_WebSocket_Only |
68
+
|[Python](https://github.com/Azure/azure-iot-sdk-python/tree/main/samples)| Uses MQTT by default |To create the client, add `websockets=True` in the call |
69
69
70
70
The following fragment shows how to specify the MQTT over WebSockets protocol when you use the Azure IoT Node.js SDK:
In order to ensure a client connection to an IoT hub connection stays alive, both the service and the client regularly send a *keep-alive* ping to each other. If you use one of the device SDKs, the client sends a keep-alive message at the interval defined in the following table:
90
90
@@ -98,7 +98,7 @@ In order to ensure a client connection to an IoT hub connection stays alive, bot
98
98
99
99
*The C# SDK defines the default value of the MQTT KeepAliveInSeconds property as 300 seconds. In reality, the SDK sends a ping request four times per keep-alive duration set. In other words, the SDK sends a keep-alive ping once every 75 seconds.
100
100
101
-
Following the [MQTT v3.1.1 specification](http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc398718081), IoT Hub's keep-alive ping interval is 1.5 times the client keep-alive value. However, IoT Hub limits the maximum server-side timeout to 29.45 minutes (1,767 seconds).
101
+
Following the [MQTT v3.1.1 specification](http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html#_Toc398718081), IoT Hub's keep-alive ping interval is 1.5 times the client keep-alive value; however, IoT Hub limits the maximum server-side time-out to 29.45 minutes (1,767 seconds).
102
102
103
103
For example, a device using the Java SDK sends the keep-alive ping, then loses network connectivity. 230 seconds later, the device misses the keep-alive ping because it's offline. However, IoT Hub doesn't close the connection immediately - it waits another `(230 * 1.5) - 230 = 115` seconds before disconnecting the device with the error [404104 DeviceConnectionClosedRemotely](../iot-hub/iot-hub-troubleshoot-error-404104-deviceconnectionclosedremotely.md).
104
104
@@ -181,7 +181,7 @@ The [IoT MQTT Sample repository](https://github.com/Azure-Samples/IoTMQTTSample)
181
181
182
182
The C/C++ samples use the [Eclipse Mosquitto](https://mosquitto.org) library, the Python sample uses [Eclipse Paho](https://projects.eclipse.org/projects/iot.paho), and the CLI samples use `mosquitto_pub`.
183
183
184
-
To learn more, see [Tutorial - Use MQTT to develop an IoT device client](./tutorial-use-mqtt.md).
184
+
To learn more, see [Tutorial - Use MQTT to develop an IoT device client without using a device SDK](./tutorial-use-mqtt.md).
To authenticate using a device certificate, update the previous code snippet with the changes specified in the following code snippet. For more information about how to prepare for certificate-based authentication, see the [Get an X.509 CA certificate](../iot-hub/iot-hub-x509ca-overview.md#get-an-x509-ca-certificate) section of [Authenticate devices using X.509 CA certificates](../iot-hub/iot-hub-x509ca-overview.md).
251
+
To authenticate using a device certificate, update the previous code snippet with the changes specified in the following code snippet. For more information about how to prepare for certificate-based authentication, see the [Get an X.509 CA certificate](../iot-hub/authenticate-authorize-x509.md#get-an-x509-ca-certificate) section of [Authenticate identities with X.509 certificates](../iot-hub/authenticate-authorize-x509.md).
252
252
253
253
```python
254
254
# Create the client as before
@@ -281,7 +281,7 @@ This `{property_bag}` element uses the same encoding as query strings in the HTT
281
281
If you're routing D2C messages to an Azure Storage account and you want to use JSON encoding, you must specify the Content Type and Content Encoding information, including `$.ct=application%2Fjson&$.ce=utf-8`, as part of the `{property_bag}` mentioned in the previous note.
282
282
283
283
> [!NOTE]
284
-
> The format of these attributes is protocol-specific. IoT Hub translates these attributes into their corresponding system properties. For more information, see [System properties](../iot-hub/iot-hub-devguide-routing-query-syntax.md#system-properties).
284
+
> The format of these attributes is protocol-specific. IoT Hub translates these attributes into their corresponding system properties. For more information, see the [System properties](../iot-hub/iot-hub-devguide-routing-query-syntax.md#system-properties) section of [IoT Hub message routing query syntax](../iot-hub/iot-hub-devguide-routing-query-syntax.md).
285
285
286
286
The following list summarizes IoT Hub MQTT implementation-specific behaviors:
287
287
@@ -295,7 +295,7 @@ The following list summarizes IoT Hub MQTT implementation-specific behaviors:
For more information, see [Send device-to-cloud and cloud-to-device messages with IoT Hub](../iot-hub/iot-hub-devguide-messaging.md).
298
+
For more information, see [Send and receive messages with IoT Hub](../iot-hub/iot-hub-devguide-messaging.md).
299
299
300
300
## Receive cloud-to-device messages
301
301
@@ -325,7 +325,7 @@ When a device application subscribes to a topic with **QoS 2**, IoT Hub grants m
325
325
326
326
First, a device subscribes to `$iothub/twin/res/#`, to receive the operation's responses. Then, it sends an empty message to topic `$iothub/twin/GET/?$rid={request id}`, with a populated value for **request ID**. The service then sends a response message containing the device twin data on topic `$iothub/twin/res/{status}/?$rid={request-id}`, using the same **request ID** as the request.
327
327
328
-
The request ID can be any valid value for a message property value, and status is validated as an integer. For more information, see [Send device-to-cloud and cloud-to-device messages with IoT Hub](../iot-hub/iot-hub-devguide-messaging.md).
328
+
The request ID can be any valid value for a message property value, and status is validated as an integer. For more information, see [Send and receive messages with IoT Hub](../iot-hub/iot-hub-devguide-messaging.md).
329
329
330
330
The response body contains the properties section of the device twin, as shown in the following response example:
331
331
@@ -348,7 +348,7 @@ The possible status codes are:
348
348
|Status | Description |
349
349
| ----- | ----------- |
350
350
| 200 | Success |
351
-
| 429 | Too many requests (throttled). For more information, see [IoT Hub throttling](../iot-hub/iot-hub-devguide-quotas-throttling.md)|
351
+
| 429 | Too many requests (throttled). For more information, see [IoT Hub quotas and throttling](../iot-hub/iot-hub-devguide-quotas-throttling.md)|
352
352
| 5**| Server errors |
353
353
354
354
For more information, see [Understand and use device twins in IoT Hub](../iot-hub/iot-hub-devguide-device-twins.md).
@@ -380,7 +380,7 @@ The possible status codes are:
380
380
| ----- | ----------- |
381
381
| 204 | Success (no content is returned) |
382
382
| 400 | Bad Request. Malformed JSON |
383
-
| 429 | Too many requests (throttled), as per [IoT Hub throttling](../iot-hub/iot-hub-devguide-quotas-throttling.md)|
383
+
| 429 | Too many requests (throttled), as per [IoT Hub quotas and throttling](../iot-hub/iot-hub-devguide-quotas-throttling.md)|
384
384
| 5**| Server errors |
385
385
386
386
The following Python code snippet demonstrates the twin reported properties update process over MQTT using the Paho MQTT client:
@@ -433,6 +433,6 @@ For more information, see [Understand and invoke direct methods from IoT Hub](..
433
433
To learn more about using MQTT, see:
434
434
435
435
*[MQTT documentation](https://mqtt.org/)
436
-
*[Use MQTT to develop an IoT device client without using a device SDK](./tutorial-use-mqtt.md)
436
+
*[Tutorial - Use MQTT to develop an IoT device client without using a device SDK](./tutorial-use-mqtt.md)
0 commit comments