Introduction

Bevywise IoT Simulator helps you simulate real time iot devices that can help you test your IoT Platform, IoT Application and IoT Devices. The simulator runs on Windows, Linux, and Mac. The simulator can be used to simulate tens of thousands of devices in a single commodity hardware.

System Requirements

OS - Windows 7 or Windows 8 & 8.1, Ubuntu 14.04 or higher, Mac 10.1 or higher

CPU - Pentium 4 or higher.

Memory - 512 MB RAM or more.

Hard drive - 100 MB of free disk space

Database - MySQL

Installation and Setup

Windows Installation and setup

  • Just Double click the downloaded"Bevywise_IoTSimulator_Win_64.exe" file to open the Installation window.

  • In Installation Window, give the installation path and install it.

  • Next you must Configure MySQL (refer MySQL configuration below).

  • Click the  IoTSimulator icon in the Desktop (search IoTSimulator in start menu), IoTSimulator UI will open in the default Web browser.

Linux / Mac Installation

  • Unzip the downloaded  "Bevywise_IoTSimulator__Linux.zip.zip"  or  "Bevywise_IoTSimulator_Mac.zip" file and extract to the location you want, Now Bevywise folder will created in the extracted location.

  • Next, Configure MySQL (refer MySQL configuration below) 

  • Open the Linux/Mac terminal and go to  bin  folder(/Bevywise/bin)

  • Run the "runsimulator.sh"by "sh" command, then IOTSimulator User Interface will open in the Default web browser.

   $ sh runsimulator.sh


MySQL Configuration

  • Bevywise IoTSimulator will use MySQL for store and retrieve data, So MySQL server 5.7 or above should be installed in your system.

  • Once you installed MySQL, Give the MySQL password  in the db.conf (/Bevywise/IoTSimulator/conf).

  • IoTSimulator will create databases in MySQL automatically.

Note: Please use wordpad or sublime to open db.conf in Windows

MySQL Configuration

Ports used by Bevywise IOTSimulator and MySQL

  • Port for sending data to the client on data publish from the devices via 12345
  • MySQL service will run on default port and simulator will connect via  3306

You can change the MySQL port and do the necessary changes on the db.conf. But you cannot change the port 12345.

Simulator Settings

1. Broker Address

  • You must need a MQTT Broker, which is one of the central server for M2M Communication, to test your IoT Devices. You can Connect Bevywise IoT Simulator to any Standard MQTT Broker or use our built-in Broker bundle inside the IoT Simulator. To use our MQTT Broker in Windows OS run the  Broker application inside the Bevywise folder and in Linux/Mac OS run "runbroker.sh" which is inside the bin folder to start the MQTT Broker. 

  • Provide the broker details in the IoT Simulator name a qualified DNS Name or the IP Address. If you are running the MQTTBroker in the local machine, you can specify it as "localhost".
  • Bevywise IoT Simulator will connect to any Cloud based IoT platform or to any IoT manager application like Bevywise device manager. For that you must give the broker address as provided by the Platform to connect the Bevywise IoT Simulator to their platform. 

  • For example: If you want to connect Bevywise device manger to the IoT Simulator, then give the Global URL "broker.bevywise.com" to connect IoT Simulator to Bevywise Device manager.

  • To configure your MQTT Route or Broker, Click the      icon on the top bar and select Settings.

  • In "Broker IP Address" text filed, give the Server or PC IP Address.

simulator setting broker address
simulator setting broker address

2. TLS/SSL

  • SSL and TLS are both cryptographic protocols that provide data encryption. The Simulator can be configured to send data over a secure SSL / TLS layer. 

  • To enable TLS/SSL, click the     icon on the top left conner.

  • In TLS/SSL drop down box, Select "Enabled" value.

  • Make sure the port number is change to "8883". If you are running the broker in any specific port other than the standard ones, you can update the port number accordingly.

  • For SSL/TLS communication, We provide certificates with Key files in Certificate/ folder.

  • For your self signed certificates, follow the steps below,

  • Client certificate and Key file MUST be present in ./Certificate/client folder.

  • CA Certificate MUST present in ./Certificate/root folder.

  • Broker and Client certificates MUST be signed by same CA.

  • For reference refer our blog  "Creating SSL Certificates for Secure MQTT communication"

iot simulator setting TLS/SSL

3.Broker Ports

  • MQTT Broker without TLS/SSL enabled will runs on 1883 default, but if you're MQTT Broker runs on any other port give that Port number here.

  • MQTT Broker With TLS/SSL enabled will runs on 8883. , but if you're MQTT Broker with TLS/SSL runs on any other port give that Port number here and make sure TLS/SSL enabled.

4. Clean Session

  • If clean session enabled, the broker will delete all the session related information of the clients after the disconnection from the Broker. so if the client connect next time it will be like a new device to the broker and the actions it done on previous session won't affect it in current session. 
  •  
  • Clean Session = 0, means Clean Session is disabled.

  • Clean Session = 1, means Clean Session is enabled.

Create an IoT Network Simulation

  • To Create Network, click the      icon on the top bar and Select " + New Network"

  • Provide Network name & Descrption of the Network.  Network name should be Alphanumeric and can have underscore.

  • After providing the details, hit Create. This will create an empty network.

  • Creating an IoT Network Simulation
  • New network will be created by the given network name. In that we can create IOT Device by "Add a Blank Device" button or we can add IOT Device from the Template by "Add Device from Template".
 

Create an IoT Device

  • Click the same    icon on top left conner and select “Blank Device” option.

  • In the following dialogue, fill the Device name (Device name should be in Alphanumeric and in underscore) without any Space.

  • Fill unique Device ID (may be in Special Character, Alphanumeric), which will give a identifier for your Devices.

  • Fill Description or Function about the Device and hit Save button.

  • A Blank device will be created without any Events on the Corresponding Network.

Creating an IoT Device

Configure IoT Authentication

  • This feature will make the IoTDevices connect to the broker in a Secure way by using the Access Key and Access Token. You can create Access key and Access Token Credentials in the Bevywise Device Manager and Copy the Authentication Credential and Paste in the Authentication tab.

  • Suppose you are using any other IoT cloud Platform, you can give that Authentication Credentials to connect Bevywise IoT Simulator to that Cloud platform.

  • To enable Authentication, Select the Device from the Device list and Click the Red  Check box below to Authentication box, it will enable the Authentication Configuration.

  • Copy the Access key and Access token from Bevywise Device Manager, 

  • Click the  icon and Paste Access Key and Access Token and Save it

Humidity-sensor

Configure WILL Messages

  • In case, if one of the IoT device disconnected due to some issue it can publish the events to the application (who subscribe the WILL topic of that device) only when the WILL message is enabled. To enable the WILL message, Select the WILL checkbox and give the topic, message, QoS & Retain. 

  • To enable Will message, Select the Device from the Device list and Click the Red  Check box next to the WILL, it will enable the WILL configuration.

  • Click the  icon and give the Topic and Message. 

  • We can enable QoS and Retain for Will messaging like Device Events.

Ultra-sonic-sens

Configure IOT Events

  • Events are used to create a time-based publishing Message for the IoT devices. Based on the time-based publishing Message, Broker will collect the data from IoT Device and send the data to subscriber.

  • There are Six different types of events with Customized time based publishing.

  • To Create Events, Click  icon on the top right conner

  • Select the features which is below the Event block 

  • We can create more than one Events for a Device.

Configuration of IOT Events

Before Configuring the IoT Events you must Know about the Following Parameters

  • Topic: It is a UTF-8 string format, which is used by the broker to filter messages for each connected client. A topic consists of one or more topic levels and each topic level is separated by a forward slash (topic level separator).

  • QoS: It guaranteed that the events will reach the subscriber.

  • Retain message: Basically retain means keep or hold something. Likewise, in events if the retain flag is one then the broker will hold or keep the corresponding details and message of that events. So it will help newly subscribed clients to get a status update 

  • Events Type: Format of the events to be published that is single string of text as events or a JSON string as events

  • Variant: It defines how the events will be sent to the subscriber. It has four types of value they are,

  • Constant - This value is used to publish the events in Alphabet and numbers

  • System variables – This value is used to publish the events with the System variables like $Client_ID, $Current_time etc.

  • Random – This value is used to publish the events in random like when the is ON|OFF

  • Range – This value is used to publish the events for certain range of numbers like 1-100

  •  
  • Message: The data which are written here will be published, which can in text or Jason to be published.

  • JSON & Nested JSON 

  • By using JSON, one can easily read the Published message and we can enclosed multiple data in a single message.

  • In Nested JSON, we can enclose multiple Object or multiple Device data in a single Message. Refer the below example.

  • To create JSON, click the     icon and Just enter the Key & Value and Click "Add", JSON will create automatically.

  • To Create Nested JSON, click the    icon and Just enter the Key & Select Value as "Object" and Click "Add".

  • Object will be added, click the    icon below that Object and add the Keys and Values. Take the below example, there "Accelerometer" is the Object, below that Keys and Values are nested by {} like this you can add multiple objects.

 

JSON syntax

{ “ KEY 1” : “ VALUE1 ” , “KEY2” : “ VALUE2 “ , “ KEY 3“ : “VALUE 3” }

 

Example For Nested JSON

 
    { 

    "Accelerometer": 

    {

        "Status": "On|Off-RANDOM",

        "Vibration_level": "50-55-RANGE",

        "Sensor_On_Time": "$Client_uptime-SYSTEMVARIABLE"

    },

    "Gas_Sensor"

    {

        "Status":"On|Off-RANDOM",
	 
        "Methane_level": "10-20-RANGE",

        "Sensor_On_Time": "$Client_uptime-SYSTEMVARIABLE"

    }

    }


1. On connect Events

  • This Event will make the IOT Devices to Publish the data when it connected to the Broker.

  • If we want know the status of the Device when it is connected from the broker, We can use this Event.

  • Select a Device from the Device list on the left side and Click the  icon on the top left conner and Select "On Connect"

  • In the following Dialogue, Fill the Topic, QoS, Retain & Select Text or JSON for Message type and Save it.

  • "On Connect" event will create below the Event tab with the given Topic name, Data and Time. If you want to delete the events Click the the  Delete  button.

  •  

Parameters

  • Topic: Coal_Mines/Humidity_Sensor/Temperature_Level
  • QoS level: 1 At least once
  • Retain: 1 Set Retain Flag
  • Events Type: JSON Format

On connect Events

2. On Disconnect

  • This Events will make the IoT Device to Publish the data before disconnecting to the Broker. 

  • If we want know the status of the Device when it is disconnected from the broker, We can use this Event.

  • Select a Device from the Device list on the left side and Click the  icon on the top right Conner and Select "On Disconnect"

  • In the following Dialogue, Fill the Topic, QoS, Retain & Select Text or JSON for Message type and Save it.

  • "On Disconnect" event will create below the Event tab with the given Topic name, Data and Time. If you want to delete the events Click the Delete  button. 

 

Parameters

  • Topic: Coal_Mines/Ultra_Sonic_Sensor/Depth
  • QoS level: 0 Atmost once
  • Retain: 0 Set Retain Flag
  • Events Type: JSON Format

On Disconnect

3. Specific Time

  • This feature will make the IoT Device to Publish the data for a Specific time.

  • We can time any time on AM & PM to Publish the data in "Publish On" text box.

  • Select a Device from the Device list on the left side and Click the   icon on the top left conner and Select "Specific Time"

  • In the following Dialogue, Fill the Topic, QoS, Retain & Select Text or JSON for Message type and save it.

  • "Specific Time" event will create below the Event tab with the given Topic name, Data and Time. If you want to delete the events Click the Delete button.

Parameters

 
  • Publish on: 9:00 AM
  • Topic: Coal_Mines/Humidity_Sensor/Temperature_Level
  • QoS level: 0 At most once
  • Retain: 0 Set Retain Flag
  • Events Type:JSON

 Specific Time
 

4. Instant 

  • If we like to test our IoT Device after configuring the Events, you can use this Event.

  • After configuring the events, click the     action button  on the right side next to time column, the message will be Published and we can verify it in the "Device log". But make sure that the IoTSimulator is connected to MQTT Broker.

  • Select a Device from the Device list on the left side and Click the icon on the top left conner and Select "Instant"

  • In the following Dialogue, Fill the Topic, QoS, Retain, & Select Text or JSON for Message type and Save it.

  • "Instant" event will create below the Event tab with the given Topic name, Data and Time,if you want to test it click the action     button. You can delete the events by Click the Delete  button.

  •  

Parameters

  • Topic: Coal_Mines/Testing/Switch
  • QoS level: 0 Atmost once
  • Retain: 0 Set Retain Flag
  • Variant: Random
  • Message: ON|OFF

 
instant-LSM303
events

5. Specific Duration

  • If we like to configure the IoT Device to Publish the Data for a Specific Duration like 9.00 AM to 10:00 AM with Interval Every 10sec or Every min, we can use this Event. 

  • Select a Device from the Device list on the left side and Click the   icon on the top left conner and Select "Specific Duration"

  • In the following Dialogue, select Interval like "Every 5 sec" in the "Interval" drop down box and Type the Duration in "Starts at" & "Stops at"

  • Next, fill the Topics, QoS, Retain, & Select Text or JSON for Message type and Save it.

  • "Specific Duration" event will create below the Event tab with the given Topic name, Data and Time. If you want to delete the events Click the Delete  button. 

 

Parameters

  • Interval: Every 30 Seconds
  • start at: 9:00 AM | Stop at: 1:00 PM
  • Topic: Coal_Mines/Oxygen_Sensor/Oxygen_Percent
  • QoS level: 0 Atmost once
  • Retain: 0 Set Retain Flag
  • Events Type: JSON

Specific Duration

6. Whole Day

  • Using this Event, we can configure our IOT Device to publish the data for Every hour or Every min or sec in a day.

  • Select a Device from the Device list on the left side and Click the  icon on the top left conner and Select "Whole day".

  • In the following Dialogue, select Interval like "Every 20 sec" in the "Interval" drop down box and fill the Topics, QoS, Retain, & Select Text or JSON for Message type and Save it.

  • "Whole day" event will create below the Event tab with the given Topic name, Data and Time. If you want to delete the events Click the Delete  button.

  •  
 

Parameters

  • Interval: Every 20 Seconds
  • Topic: Coal_Mines/Gas_Sensor/Harmful_gases_Level
  • QoS level: 0 Atmost once
  • Retain: 0 Set Retain Flag
  • Events Type: JSON

Whole Day

Configure MQTT Subscription

  • When you create an actuator or a device that performs an action, it needs to be sent with the command. In MQTT, a particular device need to place a subscription for the command to receive a message. You can subscribe to any number of commands.

  • Here there are two types of "Subscribe on" value, one is "on start" and another one is "Specific Time". If you want to receive the data for whole day you can select the "on Start" value or If you want to receive the data for a specific time you can select "Specific Time" value. In Topics give the same topic which was given in the Events, so that broker can identify easily identify the topic and send the data to the subscriber. You can add more than one topic in this tab. 

  • To Create, Select a Device from the Device list on the left side and click the   icon on the top right conner and select the “Subscribe to command” option 

  •  
  • In the following Dialogue, type the existing Event Topic name to subscribe that topic & Specify QoS Level and Save it.

  • "Subscribe to command" will create below the 'Subscribe to Command" tab with topic name, QoS level and time. You delete the "Subscribe to command", Click the delete  button. 

  •  

Example Topics

First Topic Second Topic
Subscribe on: On Start Subscribe on: Specific Time
Topic:Coal_Mines/Gas_Sensor/Harmful_gases_Level Time: 10:00 AM
Topic:Coal_Mines/Oxygen_Sensor/Oxygen_Percent
QoS: At most Once QoS: At most once m,,

Configuring MQTT Subscription

Configure Device Response (Real time Behavior)

  • In realtime the actuators should send an acknowledgement once the action is completed. This acknowledgement is not based on the messge receipt which the protocol specififes. Bevywise IoTSimulator has an option to configure automatic response which will response to the Subscriber based on the received messages & topics. The device will publish a defined message if the required message received on the required topic. 

  • A client which want to set request response have to subscribe to the topic it want’s to set response property.  

  • Make sure Existing Event topic which you like create "response" must be subscribed in the "Subscribe to Command".

  • To create Behavior or Response, Select a Device from the Device list on the left side and Click  on the top right conner, in that Select "Behavior"

  • In the following Dialogue, give the same existing event topic in the "Command Topic" and give the "Command Data" for which you like get response, but make sure Command Data will be same or within th range as existing event Publishing data. Then give the response topic and response message. 

  • On the same client subscribe the response topic ie ("Event Topic") by "subscribe to command". So it can receive the response message.

  • Note that,"Behavior" will not work on JSON message type. It will work only for Text message type.

Configuring IOT Device Response

Simulating Device Uptime

  • Bevywise IoT Simulator will automatically Start and Stop the IoT Device based on the Minium uptime using the "Random Start/Stop" Feature.

  •   
  • For example, if you specify the minimum uptime as 91%, then the devices will have a uptime between 91% & 100%. The devices will be automatically stop and restart multiple times to maintain an uptime of the specified range.

  •  
  • To configure this feature, Click the     icon on the top left conner and select Settings.

  •  
  • In the following Dialogue, Enable the "Random Start/Stop" and give the "Minimum Uptime".

  •  
  • Range for Minimum Uptime should be 1 to 100, based on this IoTSimulator will automatically start or stop the Device.

  •  
Simulating Device Uptime

Running Simulated IOT Network

  • To start/stop the Network i.e all device at a time, then click the dashboard and Click the start  button on the top right conner. If the IOT Simulator connected to the MQTT Broker Red color button will change to Green color. so,Make sure that IOTSimulator is connected to the MQTT Broker. 

  •  
  • Once you Start the whole Network, you can see the all Published Events in the "Network Log".

  •  
  • In the "Network log", Published topics message are in "Green Color" and Subcribe topic message are in "Orange Color".

  •  
  • To Stop the whole Network, click the Start  button on the top right conner, now it will change to red color.

  •    

Running Simulated IOT Device

  • To start/stop the particular IoTDevice, select the any one Device from the right side Device list and Click the start  button next to the selected device. If the IoT Simulator Connected to the MQTT Broker Red Color button changes to green color. Make sure that IoTSimulator is connected to the MQTT Broker.

  • Once you Start the IoT Device, you can see the Published Events in the "Device Log".

  • In the "Network log", Published topics message are in "Green Color" and Subcribe topic message are in "Orange Color".

  • To Stop the whole Network, click the Start  button on the top right conner, now it will change to red color.

Creating IOT Device Templates

  • To Create a new Template click the    icon on the top left Conner and select Templates and select the "Add New Template" option to Create a New Template.

  • lists
  • Click the "Add Template" button and give the Template name & Template ID without any space and Click "Create" button.

  • Template will create without any events. We can create events for the Template same as the Device (For more refer Configuration of IOT Events above).

  • Like Device we can also Configure Authentication and Will message for Templates. 

 
templates
 

Bulk Device Creation

  • If we are implementing IoT Device in large scale Industry, we should connect large or bulk amount of Device, so if we add one by one, it's take time. For that, we can create a bulk amount of device in a network by means of "Add Device from Template".

  • We can add upto 10000 Devices by a single click. 

  • To Create Bulk IoT Device, open the Existing Network or Create a New Network, then Click "Add device from Template" button if you created New network or Click the  icon on the top left conner and select "Device from Template" option.

empty-device
create-device-from-template
  • In the following Dialogue, Select template from the drop down list box, Give the number of device in "No of Device" box (maximum 10000), Enter the "Device Perfix Name" and hit "Create" button.
  • Advanced Python Interceptor

    • Advance Python Interceptor is used to customize the response based on the incoming messages.  Suppose, If a user as client python code, he can use the our Advanced Python Interceptor to add his client to Bevywise IoTSimulator.

    • To add the client via Python interceptor, first merge user python code to our python file. For that open the "default_interceptor.py" file which is inside the lib folder(/Bevywise/lib) and merge User Client code inside "default_interceptor.py" file.

    • Click the     icon on the top left conner and select Settings.  

    • In the following Dialogue, Enable the "Python interceptor" and specify the "default_interceptor.py" file path in "Python File"

    • Next, User-defined publish i.e Client python code will be published in the network on which you configure the Python interceptor.

    Advanced Python Interceptor

    For More Assistance