This topic describes how to use the device trace query feature of Message Queue for MQTT to troubleshoot issues when a device is in an abnormal state. When a device is in an abnormal state, you can use the device trace query feature to query the connection history of the device. This helps you locate the exception and identify the cause of the exception.

Procedure

  1. Log on to the Message Queue for MQTT console.
  2. In the left-side navigation pane, click Instances.
  3. In the top navigation bar, select a region.
  4. Find the instance on which you want to query the status of a device in the instance list. In the Actions column, choose More > Device Trace Query.
  5. On the Device Trace Query page, set the Group ID, Device ID, and Time Range parameters and click Search.
    Note The maximum time span is one day.
    Parameter Description
    Channel ID The ID of a connection.
    Device Action
    • connect: The Message Queue for MQTT client requests a connection to the Message Queue for MQTT broker.
    • close: The TCP connection is closed.
    • disconnect: The Message Queue for MQTT client sends a request to disconnect from the Message Queue for MQTT broker.
    Action Description
    • accepted: The Message Queue for MQTT broker receives the connection request from the Message Queue for MQTT client.
    • not authorized: The TCP connection is closed because the permission verification of the client to access the instance fails.
    • clientId conflict: The TCP connection is closed due to a conflict in the ID of the Message Queue for MQTT client.
    • topic auth failed: The TCP connection is closed because the permission verification of the client to access topics fails.
    • no heart: The TCP connection is closed due to no heartbeat.
    • closed by client: The TCP connection is closed due to an exception on the Message Queue for MQTT client.
      Note The Message Queue for MQTT client does not send a disconnect message.
    • disconnected by client: The Message Queue for MQTT client requests a disconnection.
    Time The time when the device action occurred.