This section gives you a quick understanding of how to connect your device to WSO2 IoT Server and start using it. For this purpose, let's use the virtual fire alarm.
The virtual fire alarm is a virtual device that mimics the functionality of a real fire alarm. Therefore, for this use case you do not need a real device. Once you start the virtual fire alarm, it will connect to the WSO2 IoT Server and push the temperature readings it collects. The device supports MQTT and XMPP communications and is configured to use MQTT by default.
The following subsections explain how you can work with the virtual fire alarm:
Download WSO2 IoT Server
Tip: If you want to try out the advanced device search capabilities, download the WSO2 IoT Server 3.10-Update1 pack and try it out.
Copy the downloaded file to a preferred location and unzip it. The unzipped file is called
<IOTS_HOME>
throughout this documentation.The downloaded WSO2 IoT Server file is large. Therefore, when unzipping, it might extract halfway through and stop. To avoid this, we recommend that you unzip the file via the terminal.
Example:unzip wso2iot-3.1.0.zip
- The maximum character count supported for a file path in the Windows OS is 260. If this count is exceeded when extracting the pack into a directory, you will get the
Error 0x80010135: Path too long
error. To overcome this issue use the commands given below:Create a substring and map the current file path to it.
In the example given below, the WSO2 IoT Server.zip
file is located in theC:\Users\Administrator\Downloads\pre-beta
directory.C:\Users\Administrator\Downloads\pre-beta>subst Y: C:\Users\Administrator\Downloads\pre-beta
Copy the IoT Server Server zip folder to the new path you created and unzip the file there.
Example: Unzip the file in theY:
directory.
Sign into the Device Management console
Follow the instructions given below to start WSO2 IoTS, and sign into the IoTS device management console:
Navigate to the WSO2 IoT pack plugins and run the
plugins-deployer.xml
.
Example:cd <IoT_HOME>/plugins mvn clean install -f plugins-deployer.xml
Start WSO2 IoT Server by starting the three profiles in the following order:
Start the broker profile, which corresponds to the WSO2 Message Broker profile.
cd <IoTS_HOME>/broker/bin ./wso2server.sh
The default port assigned for the broker is 9446.
Start the core profile, which corresponds to the WSO2 Connected Device Management Framework (WSO2 CDMF) profile.
cd <IoTS_HOME>/core/bin ./wso2server.sh
The default port assigned for the core is 9443.
Start the analytics profile, which corresponds to the WSO2 Data Analytics Server profile.
cd <IoTS_HOME>/analytics/bin ./wso2server.sh
The default port assigned for analytics is 9445.
Access the device management console by navigating to
https://<HTTPS_HOST>:<HTTPS_PORT>/devicemgt
.
Example:https://localhost:9443/devicemgt
Enter your username and password.
If you are new to using WSO2 IoTS, you need to first register with IoTS before you can to log into the WSO2 IoTS device management console.Click LOGIN.
Start the virtual fire alarm
Follow the steps given below to start the virtual fire alarm device:
- Click Enroll New Device.
- Click Try to try out the Virtual Firealarm.
- Download the device:
- Click Download Agent to download the device agent.
Enter a preferred name for your device, select the simple or advanced agent option, and click DOWNLOAD NOW.
- Using the Simple Agent you can try out the functions mentioned under Try out the virtual fire alarm.
- Using the Advanced Agent, you can define policies on the device based on the policy enforcement criteria and also try out the functions mentioned under Try out the virtual fire alarm.
Navigate to the location of the unzipped device agent file.
Example: Navigate to the device agent file, which is in the<IOTS_HOME>/device_agents/virtual_firealarm
directory.cd <IOTS_HOME>/device_agents/virtual_firealarm
Start the virtual fire alarm.
sh start-device.sh
Once you start your virtual fire alarm, the fire alarm emulator will pop up.
If you set the Protocol to XMPP, you need to enable XMPP communication on WSO2 IoTS, as it is disabled by default. To enable XMPP communication, open the
xmpp.properties
file that is in the<IoTS_HOME>/
repository/conf/etc
directory and configure XMPP by definingenabled=true
as shown below:enabled=true host=localhost port=5222 admin.username=admin admin.password=admin serverName=localhost
Try out the virtual fire alarm
Once you start your virtual fire alarm, you can try out the following actions:
Action | Description |
---|---|
View device details | Click the menu icon , and click Device Management. Select the virtual fire alarm device you created from your devices, and view the device details, carry out operations, and monitor real-time data. |
Ring the fire alarm |
|
View real-time and historical data
When you adjust the temperature and humidity values in the virtual fire alarm emulator you can see the data in real-time or view historical data by following the steps given below:
Click
What's next?
Follow the options given below to see what you can do next:
- Do you have an Android device? Try out the Android Sense device type supported by default on WSO2 IoTS. For more information, see Android Sense.
- Want to try out more devices? Connect the devices listed below to WSO2 IoTS and try them out.
- Need to create a new device type and connect it to WSO2 IoTS? For more information, see the Device Manufacturer Guide.