Home About us Support Partners SIGN UP NOW
Text Copied

Getting Started Guide

Introduction

Bevywise IoT Simulator is a GUI based, data simulation tool which is used to load and test the MQTT/IoT Application to know the performance level of that Application. In IoT simulator, you can create virtual IoT network and device, publish events with normal or complex JSON payload, create subscription and more. IoT simulator help documentation will let you know how to simulate IoT networks & IoT devices. For reference, refer to our introduction video tutorial.

System_requirements

OS – Windows 7 or Windows 8 & 8.1, Ubuntu 14.04 or higher.

CPU – Pentium 4 or higher.

Memory – 512 MB RAM or more.

Hard drive – 100 MB of free disk space

Installation
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, open command prompt and go to the “bin” folder( < Installation path>/Bevywise/Iotsimulator/bin).
  • Now type “runsimulator.bat” and hit enter to start the IoT Simulator. Once you start the IoT simulator user interface will open in your default web browser. If not you can directly go to your browser and navigate to http://localhost:9000/
  • For reference, refer to our installation video.
Linux Installation
  • Unzip the downloaded “Bevywise_IoTSimulator__Linux.zip” file and extract to the location you want, Now Bevywise folder will be created in the extracted location.
  • Open the Linux terminal and go to the bin folder( < Installation path>/Bevywise/Iotsimulator/bin)
  • To run the simulator, enter the following command : “sh runsimulator.sh”.
  • Once you start the IoT simulator, user Interface will open in the Default web browser, in which you can see the sample IoT network called Health_care. If not you can directly go to your browser and navigate to http://localhost:9000/

$ sh runsimulator.sh

Default running configuration and port

  • Default Data storage – SQLite
  • Default user interface port – 9000
  • Websocket Port -12345

Creating an IoT Network

  • To create a Network, click the bar icon on the top bar and select ” New Network”
  • Provide Network name & Description of the Network. The network name should be Alphanumeric and can have underscore.
  • After providing the details, hit create. After creating a network, the Simulator Setting window will pop-up.

create new network
Simulator Settings
1. Broker Details settings
Manager Application:

Manager Application has four options, they are

  • Azure: This option is used to connect the IoT simulator to Azure IoT Hub.
  • AWS: This option is used to connect the IoT simulator to the AWS IoT core.
  • Other: If you want to connect the IoT simulator to any other MQTT Application or Broker, choose this option.
  • Bevywise IoT Platform: This option is used to connect the IoT simulator to the Bevywise IoT platform.
manager application
broker details setting
Broker IP address
  • Here you should specify the PC IP address where Broker is running or DNS/Hostname of the MQTT Application. For example, if you want to connect to AWS IoT core, you must specify the Host or DNS name of the AWS IoT Core and suppose if you want to connect to the MQTT broker which is running in your localhost or in any server, then you must give the IP address of the PC or server where MQTT broker is running. If IoT simulator and MQTT Broker are running in the same PC or server, then give “Broker IP address” as “localhost”.

Note: The Manager Application and Broker IP address settings will not be modified after saving the Simulator settings.


TLS/SSL
  • Enable this option if the Broker or your MQTT Application is running with TLS/SSL enabled.

Broker Ports
  • Specify the Broker or MQTT Application port number. By default, if your Broker runs without TLS/SSL then the port will be 1883 and if TLS/SSL is enabled, then the port should be 8883.

Root Certificates
  • Here you should upload the root certificate of the MQTT Application or MQTT Broker. This will enable only for TLS/SSL.

Clean Session
  • If the clean session is enabled, the broker will delete all the details about the clients after the disconnection. As a result, when the client connects next time, it will look like a new device to the broker and the actions that are in the previous session won’t affect the current section. By default, clean session will be 0.
  • Clean Session = 0, means Clean Session is disabled.
  • Clean Session = 1, means Clean Session is enabled.
Auto Reconnect
  • If ‘Auto Reconnect’ is enabled, when a network gets disconnected due to any issues, it will automatically get connected.
2. Advanced Settings

Client IP address:

This feature will assign a separate IP address for each client in the Network. For example, if you create 5 devices, then by default the 5 devices will connect to the MQTT broker with the same IP address. But, when you enable “Client IP address” and give IP address range [like 192.168.1.2 to 192.168.1.5] in First & Last IP address, then the IoT simulator will automatically assign separate IP address for each created client or device. Now the device will connect to the MQTT Application with a different IP address. To enable, follow the below steps :


  • Click the setting button on the top left corner.
  • In the Settings window of Simulator, click Advanced tab and enable the Client IP Adrress.
  • Next, specify your IP range in First IP address and Last IP address.[Support only IPV4]
  • Now the simulator will assign separate IP address for each created device

Random Start/Stop:

Bevywise IoT Simulator will randomly stop and start the created IoT Devices based on the minimum uptime or runtime using the “Random Start/Stop” feature. For example, if you specify the minimum uptime as 50%, then the devices will randomly stop when it reaches 50% running or uptime. To enable, follow the below steps :


  • Click the setting button on the top left corner.
  • In Simulator setting window click Advanced tab and enable the “Random Start/Stop”.
  • Next, specify Minimum Uptime [range for Minimum Uptime should be 1 to 100 percent].
  • Now the Simulator will randomly stop and start the created IoT devices.

advanced settings

Advanced Python Interceptor:

Bevywise IoT Simulator can be customized using a python-based interface called Python interceptor. This interceptor provides all the created clients’ information and its received payload via python file called “default_interceptor.py”. In that python file, you can write your own code based on the received payload and also it allows you to call API to simulate complex scenarios. To enable, please follow the below steps :


  • Click the setting button on the top left corner.
  • In Settings window of Simulator, click Advanced tab and enable Python interceptor.
  • Specify the default_interceptor.py file path in Python File. Default path should be [./extensions/default_interceptor.py]
  • Start writing your code in default_interceptor.py file to customize the simulator based on received payload.
  • For reference, refer to our Simulator settings video tutorial.
Creating an IoT Device
  • Click the same Plus Symbol icon on the top left corner and select the “Blank Device” option
  • In the following dialogue box, fill the Device name (Device name should be in Alphanumeric and in underscore) without any Space.
  • Fill unique Device ID (maybe in Special Character, Alphanumeric), which will give an identity for your Devices.
  • Fill Description or Function about the Device and hit the Save button.
  • A Blank device will be created without any Events on the Corresponding Network.
create new device
Configuring Authentication

Edge device authentication will provide a secure connection between the MQTT application and device. Likewise, Bevywise IoT Simulator supports edge device authentication to connect the created device to the MQTT application securely. To enable Authentication,


  • Select the Device from the Device list.
  • Click the Red checkbox next to Authentication to enable the Authentication.
  • Next, give the MQTT username in Access Key and MQTT password in Access Token.

IoT simulator has two types of Authentication which help you to connect to different MQTT/IoT applications. They're :


SAS : With a SAS token, you can grant created clients access to your MQTT Application. It will be useful when you connect to MQTT Applications like Azure.


Self Signed : If your MQTT application allows access to clients with client or device certificate and key, then you can select Self Signed. Here you should upload the client certificate and key which you have got from the MQTT Application.


Note: This Authentication type will appear when you select Azure and AWS in Manager Application on Simulator Settings.


For other MQTT Application, you can directly copy & paste the client.certificate and key inside the client folder[./Bevywise/IotSimulator/Certificate]. After pasting the certificate and key, you must rename the certificate client.crt and client.key. For Root certificate, you can add it via simulator settings.

Configure Authentication
Configuration of MQTT Will Message

In case, if one of the IoT devices got disconnected due to some issue it can publish the events to the subscriber(who subscribes to the topic in that device) only when the WILL message is enabled. To enable the WILL message, select the WILL checkbox and give the topic, message, QoS, etc.

  • To enable Will message, select the device from the Device list and click the Red Checkbox parallel to the Authentication tab, it will change to the Green Checkbox.
  • Click the edit icon and give the Topic and Message.
  • We can enable Qos and Retain for Will messaging like Device Events
WILL topic
Configuration of 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 that data to the subscriber.

  • There are Six different types of events with Customized time-based publishing.
  • To create Events, click the plus icon on the top right corner.
  • Select any features which are below the Event title.
  • We can create more than one Event for a Device.
event list

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 ensures that the events will reach the subscriber. For more information, refer to our Time based publish events video.
  • Retain message: Basically retain means keep or hold something. Likewise, in events, if the retain flag is on, then the broker will hold or keep the corresponding details and message of those events. So it will help the newly subscribed clients to get the status update
  • Events Type: Format of the events or messages to be published. Simulator support two types of events or message type, they are Text [Normal message] and JSON message.
  • Variant: It defines how the events will be sent to the subscriber. It has four types of value. They are :

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

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

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

4.  Constant – This value is used to publish the events in Alphabet and numbers

  • Message: The data which are written here will be published. It will published either in Text or JSON format, based on the message type you’ve selected.

JSON & Nested JSON
  • By using JSON, we can easily read the Published message and enclose multiple data in a single message.
  • In the Nested JSON, we can enclose multiple Object data in a single message. Refer the example below.
  • To create JSON, click the Plus Symbol icon and just enter the Key & Value and Click “Add”, JSON will be created automatically.
  • To Create Nested JSON, click the Plus Symbol below the Message and Just enter the Key & Select Value as “Object” and Click “Add”.
  • An object will be added. Click the Plus Symbol icon below that Object and add the Keys and Values. Take the below example. “Accelerometer” is the Object and below that Keys and Values are nested by {}. You can add multiple objects like this.

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 publish the data when it is connected to the Broker.
  • If you want to know the status of the device when it is connected to the broker, you can use this Event.
  • Select a Device from the Device list on the left side and click the Plus Symbol icon on the top left corner and Select “On Connect”.
  • In the following Dialogue box, fill the Topic, QoS, Retain & select Text or JSON for Message type and save it.
  • “On Connect” event will be created below the Event tab with the given Topic name, Date and Time. If you want to delete the events, click the Delete button.

Parameters

  • Topic: AC_meter
  • QoS level: 0 Atmost once
  • Retain: 0 Set Retain Flag
  • Events Type: JSON Format
event on connect
2. On Disconnect
  • These Events will make the IoT Device to publish the data before disconnecting from the Broker
  • If you want know the status of the Device when it is disconnected from the broker, you can use this Event
  • Select a device from the Device list on the left side and click the add icon on the top right corner and select “On Disconnect”
  • In the following Dialogue box, fill the Topic, QoS, Retain & select Text or JSON for Message type and save it.
  • “On Disconnect” event will get created 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: Ultrasonic_sensor
  • QoS level: 0 Atmost once
  • Retain: 0 Set Retain Flag
  • Events Type: JSON Format
event on disconnect
3. Specific Time
  • This feature will make the IoT Device to publish the data for a specific time.
  • You can set any time on AM & PM to publish the data in the “Publish On” text box.
  • Select a device from the Device list on the left side and click the add icon on the top left corner and select “Specific Time”
  • In the following Dialogue box, fill the Topic, QoS, Retain & select Text or JSON for Message type and save it.
  • “Specific Time” event will be created below the Event tab with the given Topic name, Data and Time. If you want to delete the events, just click the Delete button.

Parameters

  • Publish on: 03:05 PM
  • Topic: Humidity_Sensor
  • QoS level: 0 At most once
  • Retain: 0 Set Retain Flag
  • Events Type: JSON Format
event for specific time
4. Instant
  • If you 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 IoT Simulator is connected to MQTT Broker.
  • Select a device from the Device list on the left side and click the add icon on the top left corner and select “Instant”
  • In the following Dialogue box, fill the Topic, QoS, Retain, & select Text or JSON for Message type and save it.
  • “Instant” event will get created 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 clicking the Delete button.

Parameters

  • Topic: CO2_level
  • QoS level: 0 Atmost once
  • Retain: 0 Set Retain Flag
  • Events Type: Text
  • Variant: Random
  • Message: ON|OFF
instant event
5. Specific Duration
  • If you like to test our IoT Device after configuring the Events, you can use this Event.If you 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 of 10sec or Every min, you can use this Event.
  • Select a device from the Device list on the left side and click the '+' icon on the top left corner and select “Specific Duration”
  • In the following Dialogue box, 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 get created below the Event tab with the given Topic name, Data and Time. If you want to delete the events, just click the Delete button.

Parameters

  • Interval: Every Seconds
  • Start at: 02:30 PM | Stop at: 04:45 PM
  • Topic: SM_Meter
  • QoS level: 0 Atmost once
  • Retain: 0 Set Retain Flag
  • Events Type: JSON
event for specific duration
6. Whole Day
  • Using this Event, you can configure our IoT Device to publish the data for Every hour or Every min or sec of a day.
  • Select a device from the Device list on the left side and click the' +' icon on the top left corner and select “Whole day”.
  • In the following Dialogue box, 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 be created 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 Seconds
  • Topic: Power_usage
  • QoS level: 0 Atmost once
  • Retain: 0 Set Retain Flag
  • Events Type: JSON
event for whole day
7. From CSV
  • In this event, you can upload the CSV file with different payloads.
  • Based on the number of payloads in the CSV file, you can create events.
  • Select a Device from the Device list on the left side and click the '+' icon on the top right corner and select “From CSV”.
  • In the following Dialogue box, select start time, and fill the Topic, QoS, Retain, select the interval, upload the CSV file and click save.
  • Now “From CSV” event will create below the Event tab with the given Topic name, Qos, and Retain. If you want to delete the events, click the Delete button.
  • For more information, refer to our create events by CSV file video tutorial.

Parameters

  • Interval: Start at: 02:21 PM
  • Topic: Temperature/Room
  • QoS level: 0 Atmost once
  • Retain: 0 Set Retain Flag
  • Once in: Every minute
  • CSV upload: CSV file
  • Number of Events: 1
event from csv
Configuring MQTT Subscription
  • After the event configuration, the broker will collect data from the Sensors and store in the data in DB. But the data will not be sent to the receiver. To send the data to the receiver side, you must want to Subscribe to the existing topic i.e the topic created while configuring the events.
  • 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 the whole day, you can select “on Start” value. If you want to receive the data for a specific time, then you can select the “Specific Time” value. In Topics, give the same topic which was given in the Events, so that the MQTT Broker can 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 Plus Symbol icon on the top right corner and select the “Subscribe to command” option
  • In the following Dialogue box, type the existing Event Topic name to subscribe to that topic & specify QoS Level and save it.
  • “Subscribe to command” will get created below the ‘Subscribe to Command” tab with topic name, QoS level and time. You delete the “Subscribe to command” by clicking 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
subscribe for command
Configuring IoT Device Response (Behavior)
  • Bevywise IoT Simulator has an automatic response engine that will respond to the Subscriber based on the messages & topics received. The device will publish a defined message if the required message is received on the required topic.
  • A client, who wants to set a request-response, has to subscribe to the topic it wants to set response property.
  • Make sure the Existing Event topic in which you like to create “response” is subscribed in the “Subscribe to Command”.
  • To create Behavior or Response, select a device from the Device list on the left side and click '+' icon on the top right corner, in that select “Behavior”.
  • In the following Dialogue box, give the same existing event topic in the “Command Topic” and give the “Command Data” for which you like to get a response. But make sure Command Data will be the same or within the range as existing event Publishing data. Then give the response topic and response message.
  • The client can also subscribe to the response topic i.e, “Event Topic”, by choosing “Subscribe to command” and can receive the response message.
  • Note that, “Behavior” will not work on the JSON message type. It will work only on the Text message type.
  • For more information, refer to our create behavior simulation video tutorial.
add new behvaior
Start / Stop Simulator
  • To start/stop the Network i.e all device at a time, then click the dashboard and click the red icon start button on the top right corner. If the IoT Simulator is connected to the MQTT Broker, then the Red color button will change to green color.
  • Once the whole network gets started, you can see all the Published Events in the “Network Log”.
  • In the “Network log”, Published topics message will appear in “Green Color” and Subscribe topic message will appear in “Orange Color”.
  • To stop the whole Network, click the green button on the top right corner. Now it will change to red color.
Start / Stop Simulated IoT Device
  • To start/stop the simulated IoT Device, select any one device from the right side Device list and click the start button on the top right corner. If the IoT Simulator is connected to the MQTT Broker, then the Red Color button changes into green color. Make sure that the IoT Simulator is connected to the MQTT Broker.
  • Once the IoT Device gets started, you can see the Published Events in the “Device Log”
  • In the “Network log”, Published topics message will appear in “Green Color” and subscribe topic message will appear in “Orange Color”.
  • To stop the whole Network, click the start button on the top right corner. Now it will change to red color.
Creating IoT Device Templates

In Templates, you can create a pre-defined device with events, subscription and device response. This will save time by creating a new device and also help you to add a bulk number of devices.

  • To create a new template click the icon on the top left corner and select Templates. Select the “Add New Template” option to create a new template.
templates
templates
  • Click the “Add Template” button and give the Template name & Template ID without any space and Click “Create” button.
  • A template will be created without any events. You can create events for Template, the same as the Device (For more, refer Configuration of IoT Events above).
  • Like Device, you can also Configure Authentication and Will message for Templates.
Creating Bulk IoT Devices
  • If we are implementing IoT Devices in large scale Industries, we should connect the large or bulk amount of Devices, so if we add one by one, it will take more time. For that, we can create a bulk amount of devices in a network using “Add Device from Template”.
  • You can add up to 10000 devices by a single click.
  • To create Bulk IoT Device, open the Existing Network or create a New Network. Then click the “Add device from Template” button if you’ve created New network or Click the '+' icon on the top left corner and select “Device from Template” option.
dashborad

create device from template
  • In the above Dialogue box, Select template from the drop-down list box and give the number of devices in the “No of Device” box (maximum 10000). Enter the “Device Prefix Name” and hit “Create” button.
  • For more information, refer to our Device templates & Bulk device creation video tutorial .
Connecting Bevywise IoT Simulator to Microsoft Azure IoT Hub

Microsoft Azure has a built-in IoT application called IoT Hub. Azure will allow the client via TLS/SSL connection only. Message Broker will run with TLS/SSL at port 8883. There are two methods to connect to Azure IoT over TLS/SSL.

They’re as follows :


  • Self-signed Certificates
  • CA Certificate

Requirements :

  • Open SSL to generate self-signed certificates
  • Azure IoT hub C SDK


Self-signed

Azure configuration
  • First, you must create IoT Hub in the Azure cloud platform. For reference, check this link .
  • Once you’ve created it, open Azure IoT HUB portal.
Azure portal
  • In the IoT Hub portal, select “IoT Devices” from the left side panel and create a new device by clicking the ‘+’ button.
  • Specify the name[Name should be unique] and select authentication type as “X.509 Self Signed”
create a device

  • Next, to add the Primary Thumbprint and Secondary Thumbprint, you must need a self-signed client certificate. Follow the below steps to create a self-signed certificate and thumbprint for that certificate.

1. Install OpenSSL in your environment. For windows user, please set an environmental variable for OpenSSL

2. Open the terminal or command prompt and give the below command

openssl req -x509 -sha256 -nodes -days 365 -newkey rsa:2048 -keyout private.key -out certificate.crt

3. Next, skip the all other steps by clicking enter and only give the Common Name as the device name

4. Now certificate.crt and private.key will be generated in the current location.

5. Next, you must get the fingerprint for the created certificate which is to be uploaded in Azure IoT Hub device as a thumbprint. Use the below command to get a fingerprint for the created certificate.

openssl x509 -noout -fingerprint -sha1 -inform pem -in certificate.crt

6. Output will be similar to

SHA1 Fingerprint= D7:A8:16:71:AF:22:DA:E0:AA:26:7A:48:4A:52:A5:83:B7:89:C7:96

7. Now, copy the fingerprint alone and paste it in any text editor and remove ‘:’

[For example, D7A81671AF22DAE0AA267A484A52A583B789C796]

8. Now copy the fingerprint from the text editor and paste it in both Primary and Secondary thumbprint.

9. Click save to create a Azure IoT Hub device.


Before starting the Simulator, you must need an Azure root certificate. To create, follow the below steps :

1. Clone or download the zip in the Azure IoT SDK for C from github

2. Extract the downloaded zip and go to the certs folder

3. Inside the certs folder, open certs.c and you can see many root Certificates for Azure IoT Hub.

4. Next, create the file with the name root.crt and copy & paste any one certificate [including the lines BEGIN CERTIFICATE and END CERTIFICATE, also remove“,\\r,\\n from all lines].


Simulator Configuration

After creating a device in Azure IoT Hub, you can run the IoT Simulator in your environment.


  • Create a new network.
  • After creating a new network, the Simulator Setting windows will appear.
  • In that, change the Manager application as Azure IoT.
  • Next, give the Azure IoT hub Hostname in Broker IP Address.
  • In Root-Certificate, browse and upload the root.crt file which you’ve copied & pasted from Azure IoT SDK github.
  • Once you’re done, click save to save the configuration.
azure
  • Next, create a device with the same name which you have given while creating IoT device in IoT Hub.
  • After creating the device, enable authentication by clicking the red checkbox next to Authentication
  • In the drop-down, select the Authentication type as Self Signed.
  • In the drop-down, upload the created certificate.crt & private.key file and click upload.
  • Next, give Access Key by using the below syntax and click save

“ < hostname>/ < devicename>“

1. hostname – Azure IoT Hub hostname

2. devicename – The name of the device


Leave the Access Token tab empty. Next, create events for the device by using the below topic syntax.


  • Publish event topic – “devices/{devicename}/messages/events/ ”
  • Subscribe topic – “devices/{devicename}/messages/devicebound/#”

Note: Change the device name alone. Other than that don’t change any other field.


Start the network by clicking the start button and if the connection is successful, you can see the published message in the simulator Network log or device log.

Connecting Bevywise IoT Simulator to AWS IoT core.

AWS platform as a built-in IoT platform is called as AWS IoT core. AWS will allow client via TLS/SSL connection only and has Message Borker running with TLS/SSL at port 8883. Below steps will help you to connect IoT Simulator to AWS IoT core

AWS Configuration

  • Login to AWS account
  • Click on services and select AWS IoT core
AWS Iot core services
  • Create a device policy by clicking “Security” on the left side. Then select policies
AWS Iot core security

1. Give policy name and in the action section select *

2. In the 'Resource ARN' field give *

create a policy
  • Create Things by clicking “All devices” on the left side.
creating AWS and IoT things
  • By Clicking 'Create single thing', you will be asked to give a name to the device in the “THING NAME” field [Note: "THING NAME" is considered to be Device name] & select “THING TYPE” if you’ve already created or create a new one and select that. After that, click Next.

Follow the below steps to create “Thing TYPE” :


  • Click the “Create a type” button next to the Thing type drop-down box.
  • In “Create a type” window give the type name and description. Except this every fields are optional.
  • Click “create thing type” to create a thing type.
  • Now select the created thing type in the “THING TYPE” drop-down box.
  • Click “Create Certificate” to download TLS/SSL certificate for AWS IoT Core.
create a thing
  • AWS IoT itself generate certificates for you as AWS uses TLS for device communication
create a thing
  • Select "Attach policies to certificate" and then select a created policy or create new policy.
  • Select "Create a thing" and the certificate download page will open.
  • Click on the Done button to activate the created device.
certificate creation

Certificates needed to be downloaded :


  • Device Certificate - To establish device certificates, download and rename the initial ***pem.crt file as client.crt. For subsequent device or thing creations, download the respective ***pem.crt and rename it as client1.crt, client2.crt, and so forth (as shown in the image below).
  • Key files - Utilize the Private key by renaming the initial ****private.pem.key as client.key. For additional device or thing setups, download the corresponding ***private.pem.key and rename it as client1.key, client2.key, etc. (refer the below image)
ADD policies
  • Root CA Certificate - Utilize the Amazon Root CA 1 & rename this root certificate as root.crt and you can use the same root.crt for every device connection.

Simulator Configuration

  • As an initial step, upload the AWS IoT Device Certificate, Key files and root certificate in the depended path of IoT simulator side.
  • To upload the Device Certificate, Key files, go to ./Bevywise/IoTSimulator/Certificate/client. For each Device, you have to upload the Device Certificate, and Key files. (Refer the below image)
  • To upload the root certificate, go to ./Bevywise/IoTSimulator/Certificate/root. By uploading the renamed root.crt which you get from AWS IoT, you can simply replace the old root.crt inside the root folder.
custom end point
  • Run the IoT simulator in your environment and open the UI of the IoT simulator.
  • Create a new network
  • After creating a new network, the Simulator Setting windows will appear.
  • In that, change the Manager application as AWS IoT
  • Device data end point in AWS Iot core is considered as Broker IP address ( Refer the below image)
custom end point
  • In Root-Certificate, browse and upload the root.crt file which is downloaded from the AWS IoT & renamed as root.crt.
  • Next, change “Clean session” as “1″ and save the configuration (Refer the below image for IoT simulator configuration settings)
  • custom end point
  • Next, Create a device with the same name, which you have given while adding Device to AWS registry in AWS configuration. The "Thing Name" is considered as the device name.
  • Enabling the authentication button, you will be asked to upload the client.crt and client.key files to the particular device.

Note: Enabling authentication requires uploading individual client certificates and keys, each renamed for specific devices as client.crt, client.key, client1.crt, client1.key, client2.crt, client2.key, and so on.

custom end point
  • Create events for the created device.
  • Start the network by clicking the red colour start button and if the connection is successful, you can see the published message either in the simulator Network log or device log.

Follow the below steps to create “Thing group”:

  • Create a Thing group by clicking “All devices” on the left side and select thing group
custom end point

custom end point
  • Add things to the things group by selecting the created things
custom end point
  • To see the message published by simulator in AWS, we have to run the test client in AWS and subscribe to that specific topic
custom end point

custom end point

Following the steps above, the IoT simulator has been configured to connect seamlessly with AWS IoT Core.

Connecting Bevywise IoT Simulator to Bevywise IoT platform

Bevywise IoT platform configuration

Follow the below steps to connect IoT Simulator to the Bevywise IoT Platform.


  • Sign-in and login to the IoT Platform. After login, you can see the Device Manager User Interface.
  • In the user interface, click the Client Management, which is the Security tab’, that is seen on the left side panel.
  • In the security window, click the + symbol to add new devices which automatically generate new authentication keys.
  • In the ‘Add a client’ window, select the ‘Client Type’ and provide ‘Client ID’, ‘Client Name’, and ‘Description’.
  • Fill in the ‘Can’ tab which is nothing but the permissions tab.
add a client

There are three types of permission. They’re :


  • Send and Receive Messages – Can send as well as receive messages
  • Send Messages – Can only send messages
  • Receive Messages – Can only receive messages

Click the ‘Add’ button.


Once you’re done, the newly created device along with its auth key and auth token will be displayed in the Authentication key list.

added clients

Here the Auth key will act as the username and Auth token as the password.


IoT Simulator Configuration

  • Run the simulator by opening …/Bevywise/IoTSimulator/bin in terminal using the command "sh runsimulator.sh"
  • Create a new network.
  • After creating a new network, the Simulator setting windows will appear.
  • In that, change the Manager application as ‘Bevywise-IoT Platform’.
  • Then in the Broker IP Address, enter the IP address of the platform.
  • Leave the other settings as default and save the configuration.
  • Create a device and enable the authentication by clicking the red checkbox next to Authentication.
  • Click the edit icon next to the Access key. Copy & paste the auth key from the Client Management tab in Platform. Then click save.
  • For Access token, copy & paste the auth token from the Client Management tab in Platform. Save it.
  • Create events and start the simulator.

Note : To know the steps to create events, please refer the Configuration of IoT Events section.


  • Start the network by clicking the start button. If the connection is successful, you can see the published message either in Simulator network log or device log and also in the dashboard of Platform.
broker details
Connecting Bevywise IoT Simulator to other MQTT/IoT Applications

If you’re using MQTT/IoT application other than AWS, Azure or Bevywise IoT platform,

  • You should download the root certificate, client certificate and client key from your IoT application.
  • Note down the hostname of the IoT application
  • Also if your IoT application has the option to create an IoT device with it, create the device and choose the suitable Authentication type which was supported by the IoT simulator.

Simulator Configuration

  • Rename the downloaded *****.crt file as client.crt and *******.key as client.key.
  • Also, rename the downloaded root certificate as root.crt.
  • Copy these certificates as instructed
  • Client.crt and .key file in Bevywise/IOTSimulator/Certificates/client
  • Next, run the IoT Simulator in your environment
  • Create a new network
  • After creating a new network, the Simulator Setting windows will appear.
  • In that, change the Manager application as Others
broker details
  • Next, give your MQTT/IoT Application hostname in Broker IP Address and enable TLS/SSL only if the MQTT application runs with TLS/SSL. After that mention the port number and save the configuration.
  • Create a device with the same name which you have given while creating an IoT device in your MQTT application. Suppose if you haven’t created any IoT device in your MQTT/IoT application, then create the device as per your wish.
  • Next, create events and publish messages and then start the simulator.

Note: If your MQTT Application has some topic restriction, then you must create an event with that topic format. For example, refer Azure IoT Hub.


  • Start the network by clicking the start red button and if the connection is successful, you can see the published message either in the simulator Network log or device log.

Note: For more help and support to connect IoT Simulator to your own MQTT Application, please contact Bevywise Support team.

Connecting IoT Simulator to MQTT Broker

This section helps you to connect IoT Simulator to MQTT Broker. Below, we have shown the connection of IoT simulator to MQTT Broker with TLS/SSL and to MQTT Broker without TLS/SSL.

For more information, refer to our video tutorial .


Connecting to MQTT Broker running with TLS/SSL enabled.
MQTT Broker configuration
  • The maximum number of MQTT brokers in the market will not provide client & root certificates. For that you can create your own self-signed root, server, and client certificates. To create TLS/SSL certificate, refer our TLS/SSL certificate creation blog. But if your MQTT Broker provides a client & root certificate, you can download and use it.
  • Once you got the certificates, rename the client certificate as client.crt and client key as client.key and paste the certificate as follows:
  • Paste Client certificate & key –> Bevywise/IotSimulator/Certificate/client
  • Also, rename the downloaded root certificate as root.crt and save it in any location.
  • Now, enable the TLS/SSL in MQTT Broker and check the port number[ by default 8883 port]

Simulator Configuration

  • Start the Simulator in your environment and it will lead you to an IoT simulator user interface.
  • Next, create a new network and the Simulator Setting windows will appear.
  • In the Simulator settings, choose as follows:

1. Manager Application – Others

2.Broker IP Address – IP address of PC or server where you run the MQTT Broker

3. TLS/SSL – Enable

4. Port – By default 8883, if your MQTT broker runs in a different port, specify here.

5. Root certificate – Upload the root.crt file which you have created or downloaded before[ Don’t forget to click upload]

broker details
  • Once you’re done, save the configuration.
  • Next, create devices and events with published messages.
  • [Only for Authentication enabled in the MQTT Broker] – If Authentication is enabled in the MQTT Broker side, then you can enable authentication by following the below steps. But if the Authentication is disabled in the MQTT Broker side, skip this step.
  • click the red checkbox next to Authentication.
  • In drop-down, click the edit icon next to the Access key and paste the username from MQTT Broker and then save it
  • For Access token, paste password from the MQTT Broker and save it.
  • Start the network by clicking the start button and if the connection is successful, you can see the published message either in the simulator Network log or device log.

Connecting to MQTT Broker running without TLS/SSL enabled.

MQTT Broker configuration
  • Start the MQTT Broker in your environment.
  • Check the running port of MQTT Broker[by default 1883]

Simulator Configuration

  • Start the Simulator in your environment and it will lead you to an IoT simulator user interface.
  • Next, create a new network and the Simulator Setting windows will appear.
  • In the Simulator settings, choose as follows:
  • Manager Application – Others
  • Broker IP Address – IP address of PC or server where you run the MQTT Broker
  • TLS/SSL – Disable
  • Port – By default 1883, if your MQTT broker runs in a different port, specify here.
  • Root certificate – Leave it as such
  • Once you’re done, save the configuration.
  • Only for Authentication enabled in MQTT Broker – If Authentication is enabled in the MQTT Broker side, then you can enable authentication by following the below steps. But if the Authentication is disabled in the MQTT Broker side, you can skip this step.

1. Click the red checkbox next to Authentication.

2. In drop-down, click the edit icon next to the Access key and paste the username from MQTT Broker and then save it

3. For Access token, paste password from the MQTT Broker and save it


  • Next, create devices and events with published messages
  • Start the network by clicking the start button and if the connection is successful, you can see the published message either in the simulator Network log or device log.
Using Protocol Buffers

Protocol buffers are Google’s structured format that are used to serialize and encode your data. You can specify how your data should be in a structured format and you can make such structured data easy to read & write using the language you prefer.

Here is the step by step procedure to use protocol buffers in python. You can follow the below steps to add Python support for MQTT payload of Protocol buffer type in Bevywise IoT Simulator.


Start compiling .proto file

  • Depending upon your requirement, create .proto file
  • Following is an example for .proto type file. As per your requirement, you can make your own .proto file

syntax = “proto2”;
ackage screen;
message Payload {
optional string contrast_ratio = 1;
optional string viewing_tech = 2;
optional string color_depth = 3;
optional string touch_type = 4;
optional int32 ntsc = 5;
optional int32 temperature = 6;
optional int32 backlight_longevity = 7;
optional int32 luminance = 8; }

Compiling the .proto file is the next step. You can compile it using protobuf compiler. The compiler then generates a python file.

Note : Protobuf compiler can be installed using the following command :

$ sudo apt install protobuf-compiler

For compiling the file use the following command :

$ protoc --python_out=. Documents/screen.proto

In the place of 'Documents' you have to give the path where your .proto file is located.


If you are using Bevywise MQTT Broker, you have to download binary MQTT broker to get utilized with the protocol buffer. The link to download binary MQTT broker is provided here. Then follow the similar steps of connecting Bevywise IoT simulator with MQTT broker. Before connecting the simulator, you have to add protocol buffer support to both simulator & MQTT broker. Let's start with it.

Add Protocol buffer support to MQTT broker :
  • Copy the protobuf class file which is generated by the compiler. Paste it in Bevywise/MQTTRoute/extensions/
  • Then copy the custom_store.py to Bevywise/MQTTRoute/extensions. Let the file undisturbed if it is already existing in the extensions folder.
  • In the next method, “handle_Received_Payload()” in Bevywise/MQTTRoute/extensions/custom_Store.py, replace the imported protobuf class name with the one already used. Modifications can be done if required. (Note: If the sample screen_pb2.py is used, modifications to custom_store.py are not required.)
  • In Bevywise/MQTTRoute/conf/data_store.conf, change the setting of custom storage from disabled to enabled. (CUSTOMSTORAGE = ENBALED)
  • Google protobuf needs to be installed in MQTTRoute/lib. This can be installed in two ways. First is by extracting the google.zip and copying the directory 'google' into MQTTRoute/lib. And the second way to install it via pip into the lib folder. For the second method, you can use the following command : $ pip install protobuf -t MQTTRoute/lib.
  • After completing this method, run the MQTT broker.
Add protocol buffer support to Bevywise IoT simulator :
  • Copy the protobuf class file which is generated by the compiler to Bevywise/IoTSimulator/lib.
  • Copy the file named default_interceptor.py to Bevywise/IoTSimualtor/extensions. Let the file undisturbed if it already exists in the 'Extensions' folder.
  • In the next method, "on_before_send()" in Bevywise/IoTSimulator/extensions/default_interceptor.py, replace the imported protobuf class file with the used one. Modifications can be made if needed. (Note: If the sample screen_pb2.py is used, modifications to default_interceptor.py are not required.)
  • Once the above step is done, you can run the simulator.
  • Then navigate to the user interface of IOT Simulator.
  • Go to the Python interceptor field which is present in the Advanced tab on the settings option. Enable interceptor and point to interceptor file by choosing 'Enabled' option. In the 'Python file' text box, add the path file to the new file if default interceptor is not used.

In the Simulator UI, choose an existing device or create a new device. Also create an event that corresponds to the .proto file which is used.


  • Choose a device or create a new device by selecting the '+' symbol.
  • Choose an event or create an event by choosing the '+' sign.
  • Give a topic to it.
  • In the 'Message type', choose JSON.
  • Enter the keys and values corresponding to the .proto file which is used.

For instance, paste the following commands into the message text area.

{“luminance”: “100-1000-RANGE”, “color_depth”: “65M-CONSTANT”, “temperature”: “1-100-RANGE”, “ntsc”: “45-60-RANGE”, “contrast_ratio”: “200:1-CONSTANT”, “backlight_longevity”: “20000-60000-RANGE”, “touch_type”: “capacitive-CONSTANT”, “viewing_tech”: “oled-CONSTANT”}

MySQL Configuration

By Default, IoT Simulator will run with SQLite. But for more device connection or load testing, SQLite is not efficient. For that case, you can change the storage configuration to MySQL. Before configuring MySQL in IoT Simulator, you must install MySQL 5.7 or higher on your PC. After installing MySQL, please follow the below steps.

For Linux Users:

  • Open the Terminal and go to ./Bevywise/IoTSimulator/bin.
  • Run “sh install_mysql_connector.sh”. This file will install all the dependence and MYSQL-connector
  • Install MySQL 5.7 server or higher.
  • Go to ./Bevywise/IoTSimulator/conf and db.conf
  • In db.conf, set DB_SERVER = MYSQL and give MYSQL username and password.

For Window/Windows server users:

windows users
  • Right-click on the ‘My Computer’ folder in the desktop.
  • Choose Properties from the context menu.
  • Click the Advanced system settings link.
advanced settings
  • Click the Environment Variables. In the System Variables section, find the PATH environment variable and select it. Choose Edit. If the PATH environment variable does not exist, click New.
system properties
environment variables

In the Edit System Variable (or New System Variable) window, specify the path where wget.exe is located. Click OK. Close all other remaining windows by clicking OK.

my computer
edit system variable
  • Open cmd and go to ./Bevywise/IoTSimulator/bin
  • Type install_mysql_connector.bat and hit enter.
  • Dependency gets installed after running the “install_mysql_connector.bat” file
  • Python 2.7
  • Pip 2.7
  • Mysql-connector-python

Note: The Above dependencies can skipped if it is already installed in PC.


  • Once the “install_mysql_connector.bat” got installed successfully, open db.conf [./Bevywise/IotSimulator/conf] in file.

In that file change the following :


  • DB_Server = MYSQL
  • Also, give the MySQL username and password below the DB details.

Note: Check whether MySQL is running on 3306 port.

db conf

Note: Please don’t use XAMPP or MAMP for MySQL.



Python installation in windows

If you run the install_mysql_connector.bat file, python2.7 will be downloaded automatically and the installation will start at once it gets downloaded. [The python installation step can be skipped if it is already installed]

Follow the below steps in order to install python2.7:


  • Following window will show up. In that, select the first option and click next
python for windows

customize python

install python

python setup

Having queries on Bevywise IoT Products?

Explore our FAQ Page