Versions Compared

Key

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

...

Excerpt
  1. Download the WSO2 IoT Server.

    Note

    If you are running WSO2 IoT Server, stop the server before proceeding to the next step.

  2. Navigate to the <IOTS_HOME>/wso2/analytics/scripts directory via the terminal and run the following command. This installs the geo extension feature to WSO2 IoT Server.

    Code Block
    mvn clean install -f siddhi-geo-extention-deployer.xml
  3. Open the <IOTS_HOME>/conf/cdm-config.xml file and enable the GeoLocationConfiguration and PublishLocationResponse configurations.

    This enables the geo extension feature in WSO2 IoT Server.

    Code Block
    languagexml
    <GeoLocationConfiguration>
        <Enabled>true</Enabled>
    </GeoLocationConfiguration>
    <OperationAnalyticsConfiguration>
        <PublishLocationResponse>true</PublishLocationResponse>
        <PublishDeviceInfoResponse>false</PublishDeviceInfoResponse>
        <PublishOperationResponse>
            <Enabled>false</Enabled>
            <Operations>
                <!-- Publish specific operation responses -->
                <!--
                    <Operation>BATTERY_LEVEL</Operation>
                    <Operation>CHECK_LOCK_STATUS</Operation>
                -->
                <!-- use wildcard '*' to publish all responses -->
                <Operation>*</Operation>
            </Operations>
        </PublishOperationResponse>
    </OperationAnalyticsConfiguration>
  4. Start the WSO2 IoT Server broker, core, and analytics profiles, and sign in to the WSO2 IoT Server Device Management Console.

    Expand
    titleClick here for more information.
    Panel
    borderColor#11375B
    bgColor#ffffff
    borderWidth2
    1. Start the WSO2 IoT Server broker profile.

      Code Block
      cd <IOTS_HOME>/bin
      sh broker.sh
    2. Start the WSO2 IoT Server core profile.

      Code Block
      cd <IOTS_HOME>/bin
      sh iot-server.sh
    3. Next, start the WSO2 IoT Server analytics profile.

      Code Block
      cd <IOTS_HOME>/bin
      sh analytics.sh
    4. Access the device management console.

      • For access via HTTP: http://<IOTS_HTTP_HOST>:9763/devicemgt/ 

        For example: http://localhost:9763/devicemgt/
      • For access via secured HTTP: https://<IOTS_HTTPS_HOST>:9443/devicemgt/ 
        For example: https://localhost:9443/devicemgt/ 
    5. Enter the username and password, and sign in.

      Info

      The system administrator will be able to log in using admin for both the username and password. However, other users will have to first register with WSO2 IoT Server before being able to log into the IoT Server device management console. For more information on creating a new account, see Registering with WSO2 IoT Server.

    6. Click LOGIN. The respective device management console will change, based on the permissions assigned to the user.
      For example, the device management console for an administrator is as follows:

    Tip
    titleDeploying in a multi-tenant environment

    The geo analytics artifacts are deployed by default in the WSO2 IoT Server super tenant. However, if you are setting up geofencing in a multi-tenant environment, you have to deploy the geo analytics artifacts in each tenant. 

    1. Log in to the device management console using the tenant credentials.

    2. Click the button and select Configuration Management > Platform Configurations.

    3. Click the Deploy Geo Analytics Artifacts button. If required, you can use this button to re-deploy the geo analytics artifacts in the super tenant mode.

Enroll devices with WSO2 IoT Server

Follow the steps given below to enroll a device:

  1. Enroll a device. Let's enroll an Android device for this tutorial.

    Info

    For more information on how to enroll an Android device, see Android.

    For more information on how to enroll other sample device types, see Enrolling Devices

  2. Access the geofencing map for the device you just enrolled:
    1. Click theImage Modified icon, and then click Device Management.
    2. Click view on the device you just enrolled and select the Location tab. 

Setting alerts

Geofencing alerts allow users to set pop-up alerts when a device enters or exits the defined geometry boundaries. You can set up the following alerts using the WSO2 IoT Server geo extensions.

...