Location-based services (LBS) uses real-time location or geo-data from devices to monitor and track devices. The geo extension in WSO2 IoT Server provides real-time information about geospatial objects. It processes spatial data from an external source of events and analyzes/manipulates this data to produce meaningful information to end users. You can interact with it to generate a variety of alerts and warnings.
Alert type | Description | |||
---|---|---|---|---|
Exit fence alert | )You can specify a geo area and if the configured device | comes intoleaves the specified area, an alert is generated.Exit | ||
Within alert (Enter fence alert) | You can specify a geo area and if the configured device | leavescomes into the specified area | , an alert is generated.Speed alert | You can specify a maximum speed limit for the movement of the device. If the device exceeds the specified speed, an alert is generated. |
Stationery alert | You can specify a geo area, a fluctuation radius, and a time, which generates an alert if the configured device is located in that area during the specified time. The fluctuation radius is used to minimize the fluctuation effect of the device. | |||
Speed alert | You can specify a maximum speed limit for the movement of the device. If the device exceeds the specified speed, an alert is generated. |
The following sections guide you through installing the geo extension, using geofencing, and setting up alerts.
...
Note If you are running WSO2 IoT Server, stop the server before proceeding to the next step.
Navigate to the
<IOTS_HOME>/wso2/analytics/scripts
directory and run the following command. This installs thegeo the geo extension feature to WSO2 IoT Server.Code Block mvn clean install -f siddhi-geo-extention-deployer.xml
Open the
cdm-config.xml
file found in the<IOTS_HOME>/conf
folder and set the following properties under the<GeoLocationConfiguration>
tag to true.
This enables thegeo the geo extension feature in WSO2 IoT Server.Code Block <GeoLocationConfiguration> <isEnabled>true</isEnabled> <PublishLocationOperationResponse>true</PublishLocationOperationResponse> </GeoLocationConfiguration>
Start the WSO2 IoT Server core and analytics profiles and sign in to the WSO2 IoT Server Device Management Console.
Expand title Click here for more information. Panel borderColor #11375B bgColor #ffffff borderWidth 2 Start the WSO2 IoT Server broker profile.
Code Block cd <IOTS_HOME>/bin sh iot-serverbroker.sh
Start the WSO2 IoT Server core profile.
Code Block cd <IOTS_HOME>/bin sh iot-server.sh
Next, start the WSO2 IoT Server analytics profile.
Code Block cd <IOTS_HOME>/bin sh analytics.sh
Access the device management console.
For access via HTTP:
For example:http://<IOTS_HTTP_HOST>:9763/devicemgt/
http://localhost:9763/devicemgt/
- For access via secured HTTP:
https://<IOTS_HTTPS_HOST>:9443/devicemgt/
For example:https://localhost:9443/devicemgt/
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.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 title Deploying 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.
Log in to the device management console using the tenant credentials.
Click the button and select Configuration Management > Platform Configurations.
- 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 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.
- Access the geofencing map for the device you just enrolled:
- Click the icon, and then click Device Management.
- Click view on the device you just enrolled and select the Location tab.
...