This section gives you a quick understanding of how to connect your device to WSO2 IoT Server as an enterprise IoT solution 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:
Before you begin
- Install Oracle Java SE Development Kit (JDK) version 1.8.* and set the
JAVA_HOME
environment variable. For more information on setting upJAVA_HOME
on your OS, see Installing the Product. - Check out system requirements section and ensure that you have all the appropriate prerequisite software installed on your system.
Download WSO2 IoT Server
Copy the downloaded file to a preferred location and unzip it. The unzipped file will be 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.2.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 IoT Server, and sign into the device management console:
Navigate to the WSO2 IoT Server pack's samples directory and run the
device-plugins-deployer.xml
file.Why is this needed?
Before enrolling devices with WSO2 IoT Server you need to have the device type plugins created. The Android, Android Sense, Windows, and Android Virtual Device sample device type plugins are available by default on WSO2 IoT Server. You need to run the command given below to create the Raspberry Pi, Arduino, and Virtual Fire Alarm sample plugins.
For more information on writing your own device plugin, see Writing Device Types.
Example:
cd <IOTS_HOME>/samples mvn clean install -f device-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.
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.
The default port assigned for the core is 9443.
Start the analytics profile, which corresponds to the WSO2 Data Analytics Server profile.
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 IoT Server, you need to first register before you can to log into the WSO2 device management console.Click LOGIN.
Start the virtual fire alarm
Follow the steps given below to start the virtual fire alarm device:
If you are a new user, click Enroll New Device.
If you have enrolled devices before, click Add under Devices.
- Click Try to try out the Virtual Firealarm, which is listed under Virtual Device Types.
- Download the device:
- Click Download Agent to download the device agent.
Enter a preferred name for your device and click DOWNLOAD NOW.
Unzip the downloaded agent file and navigate to its location via the terminal.
Start the virtual fire alarm.
./start-device.sh --> For Linux/Mac/Solaris start-device.bat --> For Windows
Once you start your virtual fire alarm, the fire alarm emulator will pop up.
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 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 to monitor real-time data via the Device Details pages.
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 IoT Server. For more information, see Android Sense.
- Want to try out more devices? Connect the devices listed below to WSO2 IoT Server and try them out.
- Need to create a new device type and connect it to WSO2 IoT Server? For more information, see the Device Manufacturer Guide.