Versions Compared

Key

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

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.

...

  1. Click Enroll New Device.
  2. Click Try to try out the Virtual Firealarm.
  3. Download the device:
    1. Click Download Agent to download the device agent.
    2. Enter a preferred name for your device (e.g., "Fire_AlarmFireAlarm"), select the simple or advanced agent option, and click DOWNLOAD NOW.

      Tip

      Tip: Avoid using spaces or other characters for the device name.

      Info
    Localtabgroup
    Localtab
    activetrue
    titleSimple Agent

    Follow the steps below to start the Simple Agent.

    1. Navigate to the location of the unzipped device agent file on your terminal.
      Example: Navigate to the device agent file, which is in the <IOTS_HOME>/device_agents/virtual_firealarm directory.

      Code Block
      cd <IOTS_HOME>/device_agents/virtual_firealarm
    2. Start the virtual fire alarm.

      Code Block
      sh start-device.sh

      Once you start your virtual fire alarm, the fire alarm emulator will pop up.

    Localtab
    titleAdvanced Agent
    1. Define a policy for the device. Follow the steps below for a sample policy, or see Adding a Policy for more information on how to add your own policy.

      1. Click the menu iconImage Modified , and click Policy Management.

      2. Click Add New Policy Image Modified and select the Virtual Fire Alarm

      Image Removed platform. 
      1. platform.

      2. Configure a policy using the Siddhi Query Language and click Continue.
        The following is an example of a policy you can use for the Fire Alarm device.

        Code Block
        define stream fireAlarmEventStream (temp int);
        from fireAlarmEventStream#window.time(30 sec)
        select max(temp) as maxValue
        insert into analyzeStream for expired-events;
        from analyzeStream[maxValue < 50]
        select maxValue
        insert into bulbOnStream;
        from fireAlarmEventStream[temp > 50]
        select temp
        insert into bulbOffStream;
      3. Assign the policy to user roles or users and select an action to be triggered upon non-compliance.
        For example, you can assign the policy to the admin user role and select Enforce as the action upon non-compliance. For more information, see Adding a Policy.
        Image Added
      4. Enter a name and description for the policy and click Publish. Image Added
        When you start the fire alarm device, this policy will be assigned to the device.
    2. Navigate to the location of the unzipped device agent file on your terminal.
      Example: Navigate to the device agent file, which is in the <IOTS_HOME>/device_agents/virtual_firealarm directory.

      Code Block
      cd <IOTS_HOME>/device_agents/virtual_firealarm

       

    3. Start the virtual fire alarm.

      Code Block
      sh start-device.sh

      Once you start your virtual fire alarm, the fire alarm emulator will pop up.

      Image Added

Try out the virtual 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:

...