Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Due to various reasons, the devices registered with WSO2 IoT Server might not be able to communicate with the server continuously. When the device is not actively communicating with the server, you need to know of it to take necessary actions, such as checking if the device has any malfunctions and repairing it or checking if the device is was stolen.

To get a clear understanding, let's look at how this works in WSO2 IoT Server.

  • If the device and the server are actively communicating, the device is shown as active.

    Expand
    titleClick here to see how the status is displayed.
    Panel
    borderColor#11375B
    bgColor#ffffff
    borderWidth2

    In the device management console, click View under Devices. You can now see all your registered devices and their device statuses.

  • If the server is unable to communicate with the device within a defined time period, the device is shown as unreachable.

    Expand
    titleClick here to see how the status is displayed.
    Panel
    borderColor#11375B
    bgColor#ffffff
    borderWidth2

    In the device management console, click View under Devices. You can see all your registered devices and their device statuses.

    Image Added

  • If the server is still unable to communicate with the device after a defined time period, the device is shown as inactive.

    Expand
    titleClick here to see how the status is displayed.
    Panel
    borderColor#11375B
    bgColor#ffffff
    borderWidth2

    In the device management console, click View under Devices. You can now see all your registered devices and their device statuses.

  • If the device starts to communicate with the device after some time, the device status is updated back to active.

...

  1. Open the <IOTS_HOME>/conf/cdm-config.xml file and make sure the DeviceStatusTaskConfig is enabled. This configuration is enabled by default.

    Info

    If the DeviceStatusTaskConfig is enabled (or enabled on a node that is in a clustered setup) it will run the status monitoring task in the server. If the configuration is disabled, the server will not monitor the status of the devices.

    Anchor
    step1
    step1

    Code Block
    <DeviceStatusTaskConfig>
    	<Enable>true</Enable>
    </DeviceStatusTaskConfig>
  2. Configure the device type to go into the unreachable state and then to the inactive state after a specified time.
    Navigate to the <IOTS_HOME>/repository/deployment/server/devicetype directory, open the <DEVICE_TYPE>.xml file, and configure the fields given below:
    The default configuration in the android.xml file is shown below:

    Code Block
    <DeviceStatusTaskConfig>
       <RequireStatusMonitoring>true</RequireStatusMonitoring>
       <Frequency>300</Frequency>
       <IdleTimeToMarkUnreachable>300</IdleTimeToMarkUnreachable>
       <IdleTimeToMarkInactive>600</IdleTimeToMarkInactive>
    </DeviceStatusTaskConfig>
    RequireStatusMonitoring

    If the value is set to true, it enables the status monitoring task for the device type. Else it will not monitor the status of the device type.

    Info

    For the task to run on the specified device type it must be enabled on the server as shown in step 1 above.

    Frequency
    Define how often the server needs to communicate with the devicethis task should run for the specified device type. The value needs to be given in seconds.

    Make sure to have the value above 60 seconds.

    IdleTimeToMarkUnreachable
    Define after how long the device needs to be marked as unreachable. The value needs to be given in seconds.
    IdleTimeToMarkInactive
    Define after how long the device needs to be marked as inactive. The value needs to be given in seconds.

...