0% found this document useful (0 votes)
255 views

Internship Report

The document discusses L&T Technology Services (LTTS), an engineering services company and subsidiary of Larsen & Toubro. LTTS provides design, development and engineering solutions to clients across various industries. It has over 15,100 employees spread across global design centers, sales offices and innovation labs in India. LTTS aims to deliver innovative solutions for its customers which include many Fortune 500 companies.

Uploaded by

Arshiya Banu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
255 views

Internship Report

The document discusses L&T Technology Services (LTTS), an engineering services company and subsidiary of Larsen & Toubro. LTTS provides design, development and engineering solutions to clients across various industries. It has over 15,100 employees spread across global design centers, sales offices and innovation labs in India. LTTS aims to deliver innovative solutions for its customers which include many Fortune 500 companies.

Uploaded by

Arshiya Banu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 35

VISVESVARAYA TECHNOLOGICAL UNIVERSITY

Jnana Sangama, Machhe, Belagavi – 590018

An Internship Report On
“IOT PLATFORM INTEGRATION”
Submitted in partial fulfillment for the award of the degree of
Bachelor of Engineering in
Electronics and Communication Engineering
Submitted by

NAME: ARSHIYA BANU S USN: 1AT16EC017

Under the guidance of

Internal Guide Internship Coordinator


Prof. Jayanth U Prof. Annappa C & Prof. Ajay Shiva
Assistant Professor Assistant Professor
Department of ECE, AIT Department of ECE, AIT

Atria Institute of Technology


Department of Electronics and Communication Engineering
2019 – 2020
Atria Institute of Technology
Affiliated to Visvesvaraya Technological University

Anandnagar, Hebbal, Bangalore-560024

Department of Electronics and Communication


Engineering

CERTIFICATE
Certified that the internship work on “IOT PLATFORM INTEGRATION” presented
by “ARSHIYA BANU S” (1AT16EC017), of Atria Institute of Technology, Bangalore in
partial fulfillment for the award of Bachelor of Engineering in Electronics and Communication
Engineering of Visvesvaraya Technological University, Belagavi during 2019-20. It is certified
that all corrections/ suggestions indicated during internal assessment have been incorporated in the
report. The internship report has been approved and it satisfies the academic requirements with
respect to the internship report as prescribed for the said Degree.

Signature of Guide Signature of Coordinators Signature of HOD


Prof. Jayanth U Prof. Annappa C & Prof. Ajay Shiva Dr. Arun Balodi
Asst.Professor, Dept. Of ECE Asst.Professor, Dept. Of ECE HOD, Dept. Of ECE

External Viva
Internal Examiner External Examiner

Name: Name:

Date: Date:

Signature: Signature:
DECLARATION

I, Arshiya Banu S (1AT16EC017) a student of Eighth Semester, Department of Electronics and


Communication Engineering, Atria Institute of Technology, hereby declare that this internship
work on “IOT PLATFORM INTEGRATION” has been carried out at “L&T Technology
Services”, under the guidance of Prof. Jayanth U Assoc. Professor, Dept, of ECE. This internship
work is submitted to Visvesvaraya Technological University in partial fulfillment of the
requirement for the award of degree of Bachelor of Engineering in Electronics and Communication
Engineering for the academic year 2019-2020.

I declare that the work submitted in this report is my won and has not been previously
submitted for the fulfilment of the B.E degree at the Visvesvaraya Technological University,
Belagavi or any other Institution/University.

Place: Bangalore Arshiya Banu S

Date:
ACKNOWLEDGMENT

The foundation for any successful venture is laid out not just by the individual accomplishing the
task, but also by several other people who believe that the individual can excel and put in their
every bit in every endeavor he/she embarks on, at every stage in life. And the success is derived
when opportunity meets preparation, also supported by a well-coordinated approach and attitude.

I would like to express our sincere gratitude to the respected principal Dr. K.V. Narayanaswamy,
for providing a congenial environment to work in.
I also like to express our sincere gratitude to Dr. Arun Balodi, Head of Department, Electronics
and Communication, for his continuous support and encouragement.
I am indeed indebted to Mr.Pavan S, our coordinator , for his continued support, advice and
valuable inputs during the course of this internship work.
I also express my sincere gratitude to my guide, Prof. Jayanth U, for the support and help
extended by him.

My sincere gratitude goes out to all our comrades and well-wishers who have supported me
through all the ventures.
Contents
Chapter-1 About the organization .............................................................................................. 1
1.1 INTRODUCTION .......................................................................................................... 1
Chapter-2 About the Department ............................................................................................... 3
2.1 Introduction ....................................................................................................................... 3
2.2 Vision .................................................................................................................................. 3
2.3 Mission................................................................................................................................ 3
2.4 Integrated Community Development ................................................................................ 4
2.5 Diversity and Equal Opportunity ...................................................................................... 5
2.6 TECHNOLOGY SERVICES ............................................................................................. 6
2.7 Services ................................................................................................................................. 6
2.8 UBIQWEISE 2.0 ................................................................................................................. 7
2.9 KEY DIFFERENTIATORS ............................................................................................... 8
2.10 BENEFITS OF OUR IOT CLOUD PLATFORM ......................................................... 8
Chapter-3 Task performed ........................................................................................................ 10
3.1. Doxygen Documentation .................................................................................................. 10
3.2 Node-RED .......................................................................................................................... 16
Table of Figures

Figure 1: L&T Technology Services ........................................................................................... 2


Figure 2: Ubiqweise ...................................................................................................................... 8
Figure 3: Doxygen ....................................................................................................................... 10
Figure 4: : Doxyfile generated by doxygen ............................................................................... 13
Figure 5: Commenting the code to generate Doxygen document ........................................... 14
Figure 6: Doxygen Task Output 1 ............................................................................................. 15
Figure 7: Doxygen Task Output 2 ............................................................................................. 15
Figure 11: Node-Red ................................................................................................................... 16
Figure 12: Running node-red command to start Node-RED in terminal. ............................. 17
Figure 13: Nodes used in Node-Red .......................................................................................... 18
Figure 14: Node-Red Editor ....................................................................................................... 20
Figure 15: : Passing message through JavaScript function ................................................... 22
Figure 16: Configuring MQTT server node ............................................................................. 23
Figure 17: Node properties ........................................................................................................ 24
Figure 18: Node-red-contrib-mqtt-broker ............................................................................... 25
CHAPTER-1

ABOUT THE ORGANISATION


IOT PLATFORM INTEGRATION

Chapter-1 About the organization

1.1 INTRODUCTION

L&T Technology Services Limited (LTTS) is a listed subsidiary of Larsen & Toubro
Limited. The Company is a leading global pure-play Engineering Research &
Development (ER&D) services company. It offers design and development solutions
throughout the product development chain and provides services and solutions in the areas
of mechanical and manufacturing engineering embedded systems engineering analytics
and plant engineering. Headquartered in India LTTS has over 15100 employees spread
across 17 global design centers 28 global sales offices and 49 innovation labs in India as
of March 31 2019. Its customer base includes 69 Fortune 500 companies and 51 of the
world's top ER&D companies across industrial products medical devices transportation
telecom & hi-tech and the process industries .L&T Technology Services Limited was
incorporated as L&T Technology and Engineering Services Company Limited on June 14
2012 at Mumbai as a public limited company. The Company received the certificate of
commencement of business on June 20 2012. Subsequently the name of the company was
changed to L&T Technology Services Limited pursuant to a special resolution passed by
Shareholders at the EGM held on July 19 2012. As the engineering services business of the
Company is sub-set of technology services the name of the Company was changed to L&T
Technology Services Limited to more appropriately describe its business in line with the
company's main objects. In 2014 L&T Technology Services acquired the product
engineering services (PES) business (except the unit in Germany) from Larsen & Toubro
Infotech Limited.In 2015 L&T Technology Services acquired the unit of PES business in
Germany from L&T Infotech GmbH. During the year the company acquired the integrated
engineering services (IES) business from L&T. Also during the year the company acquired
74% stake in Thales Software India Private Limited (TSIPL). The company also acquired
the engineering services division of Dell India during the year. It also acquired the
engineering services division of Dell USA through its wholly owned subsidiary LTTS
LLC. In September 2016 L&T Technology Services was listed on the bourses after
promoter L&T sold 1.04 crore shares of the company through an initial public offer during

Dept. of ECE,AIT 2019-2020 Page 1


IOT PLATFORM INTEGRATION

the period from 12 to 15 September 2016 via book building. On 6 October 2016 L&T
Technology Services announced a Digital Engineering Transformation partnership with
Microsoft Corporation to deliver Microsoft Azure Engineering Solutions for global
enterprises across industries.

Figure 1: L&T Technology Services

Dept. of ECE,AIT 2019-2020 Page 2


CHAPTER-2

ABOUT THE DEPARTMENT


IOT PLATFORM INTEGRATION

Chapter-2 About the Department

2.1 Introduction

L&T Technology Services Limited (LTTS) is a global leader in Engineering and R&D (ER&D)
services. With 472 patents filed for 51 of the Global Top 100 ER&D spenders, LTTS lives and
breathes engineering. Our innovations speak for itself – World’s 1st Autonomous Welding Robot,
Solar ‘Connectivity’ Drone, and the Smartest Campus in the World, to name a few.
LTTS’ expertise in engineering design, product development, smart manufacturing, and
digitalization touches every area of our lives - from the moment we wake up to when we go to bed.
With 49 Innovation and R&D design centers globally, we specialize in disruptive technology
spaces such as 5G, Artificial Intelligence, Collaborative Robots, Digital Factory, and Autonomous
Transport.

LTTS is a publicly listed subsidiary of Larsen & Toubro Limited, the $18 billion Indian
conglomerate operating in over 30 countries

2.2 Vision
L&T shall be a professionally-managed Indian multinational company, committed to total
customer satisfaction and enhancing shareholder value.
L&T-shall be an innovative, entrepreneurial and empowered team constantly creating value and
attaining global benchmarks.
L&T shall foster a culture of caring, trust and continuous learning while meeting expectations of
employees, stakeholders and society.

2.3 Mission
Building India’s Social Infrastructure – Our Goals & Activities
Focusing on many social challenges in the communities, we propose to work towards the following
outcomes from our Social Infrastructure programs, based on need assessment and feasibility.

Dept. of ECE,AIT 2019-2020 Page 3


IOT PLATFORM INTEGRATION

Water & sanitation - Ensuring availability of safe drinking water and water for agriculture,
constructing and ensuring use of toilets, and electrification of villages (off-grid renewables)

Education - Improved access to education (increased enrollment in pre-school, children


attending neighborhood schools) and improving quality of learning through better school
infrastructure and better teaching-learning processes.

Health - Improved access to quality health care, through expanding infrastructure of


health centers, increased number of people accessing quality health care.

Skill building - through our Construction Skills Training Institute (CSTI). Enhancing employ-
ability of youth through increased training capacity, improved infrastructure of skill
development centers, as well as vocational training courses for women and physically challenged
persons.

We also work to build a collaborative eco-system comprising L&T, the community, our
employees, their families, NGOs, government agencies, chambers of commerce and academic
institutes to fulfill a larger social commitment.

2.4 Integrated Community Development

L&T has an integrated approach to its water security and sanitation projects. Our
CSR programs help fulfill water needs first for drinking, followed by sanitation and then for
agriculture. In parallel, the program includes initiatives to develop underprivileged communities
that have suffered decades of water-stress. L&T, in consultation with experts, identified water-
stressed village clusters in Rajasthan, Tamil Nadu, Maharashtra and Gujarat and now works in
three states. The project currently covers 11,006 households, and an area of 9,337 hectares in these
states.
Objective

Dept. of ECE,AIT 2019-2020 Page 4


IOT PLATFORM INTEGRATION

L&T is a team of more than 50000 professionals spread across the globe. We combine a proven
track record and professional skills, woven together with a culture of trust & caring. Consistently
rated among the best employers in the country, L&T offers unmatched leadership opportunities &
growth. Our approach is built on empowering employees to take on challenging assignments and
explore their potential.

With over 50% of its workforce below the age of 30, L&T is a young company that is over 75
years old. Every year we induct large batches of fresh engineering graduates.

There is one thing that unites our large and cosmopolitan team - we love what we do. We also
believe that diversity provides the environment for original thought. At every step of our
employees' careers, we invest in them by offering learning avenues, thus expanding their skill sets
to serve clients need better.

2.5 Diversity and Equal Opportunity


We welcome diversity at the workplace. Our efforts are therefore focused on sustaining and
enhancing this diverse work environment. It introduces fresh perspectives and enables our people
to integrate better in society.

We are an equal opportunity employer and adhere to statutory & regulatory norms. Our egalitarian
work culture fosters diversity and equal opportunity. We do not discriminate on the basis of caste,
religious or political affiliation, gender, nationality, age, sexual orientation or disability
Growing with L&T
At L&T Learning & Development is a strategic business function contributing significantly
to organizational, group and individual effectiveness & growth by fostering a strong learning
culture.

We focus our energies on the following thrust areas:

Dept. of ECE,AIT 2019-2020 Page 5


IOT PLATFORM INTEGRATION

 Deliver results and impact organizational performance


 Constantly scan the rapidly changing environment and equip employees at all times with
the required knowledge, skills and qualities.
 Leadership development.
 Develop corporate citizens.
 Deliver a global MNC and global leaders.
 Focus on action-oriented training.
 Synergize & optimize efforts - avoiding overlap and duplication and build a uniform
curriculum.
 A culture of continuous learning and development exists through structured core
developmental programs, conducted by reputed institutions for employees to develop
superior management skills and capabilities. A host of strategic and behavioral programs
are also conducted to address specific training and developmental needs of employees.

2.6 TECHNOLOGY SERVICES


L&T Technology Services provides leading-edge engineering solutions to multiple industry
sectors like automotive, aerospace, consumer electronics, consumer packaged goods, marine,
medical devices, off-highway equipment, railways, pharmaceuticals, oil & gas, utilities,
infrastructure and industrial products. With its global headquarters at Vadodara, the Company
operates through dedicated engineering centers in tandem with onsite teams worldwide. Its client
base includes several Fortune 500 companies.
Social infrastructure is indispensable for progress; L&T, as India’s leading builder of major
infrastructure projects, is equally committed to developing projects that will contribute to the
quality of life. This includes schools, hospitals, skill training institutes, water supply & dis

2.7 Services

L&T leads in nearly every sphere of business it operates in. Serving customers in more than 30
countries, across various industries. L&T Business structure includes:-
 Hydrocarbon engineering
Dept. of ECE,AIT 2019-2020 Page 6
IOT PLATFORM INTEGRATION

 Transport infrastructure
 Heavy civil infrastructure
 Buildings & factories
 Power transmission & distribution
 Metallurgical &material handling
 Power
 Heavy engineering
 Ship building
 Electrical & Automation
 Information technology
 Technological service
 Machinery & Industrial Products
 Infrastructure development
 Financial services
 Sanitation facilities.

2.8 UBIQWEISE 2.0


UBIQWeise 2.0ᵀᴹ, L&T Technology Services’ proprietary cloud IoT platform, is built to empower
our customers to rapidly customize and seamlessly deploy IoT products. With the ability to
integrate with best-in-class big data and analytics tools, the built-in rules engine supports stream
processing to generate business insights in real time.
UBIQWeise 2.0ᵀᴹ can facilitate frictionless connectivity with enterprise applications by
leveraging a range of APIs. To support varying business needs, we offer flexible pricing models –
from pay per use to full-scale licensing – allowing companies to maximize their return on
investment (ROI) within short cycles.

Dept. of ECE,AIT 2019-2020 Page 7


IOT PLATFORM INTEGRATION

Figure 2: Ubiqweise

2.9 KEY DIFFERENTIATORS

 Device to cloud IoT platform with built-in rule engine, stream processing and big data
support

 Empowers customers for rapid customization and quick deployment of IoT products

 Supports multiple devices and connectivity protocols to address all industries

 Industry leading analytics framework integration

 Enterprise applications connectivity via API

 End to end secured connectivity from edge to cloud to application

2.10 BENEFITS OF OUR IOT CLOUD PLATFORM

 Deploy your IoT solutions on a public or private cloud, or even on your local servers

Dept. of ECE,AIT 2019-2020 Page 8


IOT PLATFORM INTEGRATION

 Securely transmit data to the Cloud by utilizing AES 256 encryption

 Ensure interoperability and connectivity with different industrial and wired/wireless


methods like PROFIBUS and Wi-Fi

 Add multiple devices, gateways, protocols, and cloud platforms and remotely manage
connectivity using a simple unified administration console

 L&T Technology services wins IoT platforms leadership award 2018 for its integrated
MCare Solution Powered by UBIQWEISE 2.0

Dept. of ECE,AIT 2019-2020 Page 9


CHAPTER 3

TASKS PERFORMED
IOT PLATFORM INTEGRATION

Chapter-3 Task performed

3.1. Doxygen Documentation


Doxygen is a tool to create documentation for your program/project written in the languages like
C, C++, Java, python and so on. It reads the well formatted and special doxygen comments to
create the required documentation.
Doxygen is the de facto standard tool for generating documentation from annotated C++ sources,
but it also supports other popular programming languages such as C, Objective-C, C#, PHP, Java,
Python, IDL (Corba, Microsoft, and UNO/Open Office flavours), Fortran, VHDL and to some
extent D.

Figure 3: Doxygen
Doxygen can help you in three ways:
 It can generate an on-line documentation browser (in HTML) and/or an off-line
reference manual (in ) from a set of documented source files. There is also support for
generating output in RTF (MS-Word), PostScript, hyperlinked PDF, compressed
HTML, and Unix man pages. The documentation is extracted directly from the sources,
which makes it much easier to keep the documentation consistent with the source code.
 You can configure doxygen to extract the code structure from undocumented source
files. This is very useful to quickly find your way in large source
distributions. Doxygen can also visualize the relations between the various elements by

Dept. of ECE,AIT 2019-2020 Page 10


IOT PLATFORM INTEGRATION

means of include dependency graphs, inheritance diagrams, and collaboration


diagrams, which are all generated automatically.

 You can also use doxygen for creating normal documentation (as I did for
the doxygen user manual and web-site).

Download and Installation of Doxygen in Linux Platform

DOXYGEN DOWNLOAD
 $ git clone https://github.com/doxygen/doxygen.git
 $ cd doxygen
 $ mkdir build
 $ cd build
 $ cmake -G "Unix Make files" ..
 $ make
NOTE: To force a fresh build after an earlier check-out simple remove the build directory and redo
the above steps.
 After the binaries have been built, you can use
 $ make install
If you have the necessary build tools installed (i.e. g++, python, cmake, flex, bison), you should
do the following to get the initial copy of the repository:

DOXYGEN INSTALL

 $ sudo apt-get update


 $ sudo apt-get install doxygen
To create the documentation using the graphical user interface then you can use this command
 $ sudo apt-get install doxygen-gui
GUI can be run using the command
 $ doxywizard

Dept. of ECE,AIT 2019-2020 Page 11


IOT PLATFORM INTEGRATION

Documenting the code


We put comments in the code such that doxygen incorporates them in the documentation it
generates.
There are different ways to start a comment in a file
/** ———– comments */
1. /// single line comment in Doxygen
2. “”” special comment block for python “””
3. /*! comment */

While writing the comments we have to follow a pattern with the tags i.e. before every tag we
should have something special so that Doxygen can understand what are we creating.

So the two common sign used are


1. @
2. \
To generate the configuration file for the project and to create a separate folder for
the doxygen content use this command.
$ doxygen -g filename

NOTE: From above command filename is optional, if no filename is given a file named Doxyfile is
generated.

Dept. of ECE,AIT 2019-2020 Page 12


IOT PLATFORM INTEGRATION

Figure 4: : Doxyfile generated by doxygen

The entire doxygn documentation depends on the configuration of this Doxyfile. The file
describes the settings to be used by the documentation system. All text after hash ( # ) is
considered a comment and will be ignored.

The format is:

TAG = value [value, . . ..]

The tag specifies the encoding used for all characters in the config file that follow. The default is
UTF-8 which is also which is also the encoding used for all text before the first occurrence of
this tag. Doxygen uses libconv for transcoding

The above figure is a sample Doxyfile with only few TAGs.

Dept. of ECE,AIT 2019-2020 Page 13


IOT PLATFORM INTEGRATION

Figure 5: Commenting the code to generate Doxygen document

In order to edit this file and add the content according to your needs following code will be helpful.
For example you can give a name to your project using this file.
$ vim Doxyfile
Edit the Doxyfile and give the input path @ (INPUT) for the source file
Mention the type of the code (FILE_PATTERNS) for the source file

e.g. For :INPUT = /home/meiheru/doxygen/print


For: FILE_PATTERNS = *.c, *.cc, *.cxx, *.cpp, *.c++, *.java

Now this is the time to generate the Documentation


$ Doxygen Doxyfile
NOTE: Doxygen is the name of file we generated earlier.
Use these commands to see the generated html documentation.
$ cd html
$ Firefox index.html
Task Output

Dept. of ECE,AIT 2019-2020 Page 14


IOT PLATFORM INTEGRATION

Figure 6: Doxygen Task Output 1

Figure 7: Doxygen Task Output 2

Dept. of ECE,AIT 2019-2020 Page 15


IOT PLATFORM INTEGRATION

3.2 Node-RED
Node-RED is a programming tool for wiring together hardware devices, APIs and online services
in new and interesting ways.

It provides a browser-based editor that makes it easy to wire together flows


using the wide range of nodes in the palette that can be deployed to its runtime
in a single-click.

Figure 8: Node-Red

Running Node-RED locally in Linux Platform


Prerequisites
To install Node-RED locally you will need a supported version of node.js
Installing with npm
To install Node-RED you can use the npm command that comes with node.js:
$ sudo npm install -g --unsafe-perm node-red

Running
Once installed as a global module you can use the node-red command to start Node-RED in your
terminal. You can use Ctrl-C or close the terminal window to stop Node-RED.

Dept. of ECE,AIT 2019-2020 Page 16


IOT PLATFORM INTEGRATION

Figure 9: Running node-red command to start Node-RED in terminal.

You can then access the Node-RED editor by pointing your browser at http://localhost:1880.
The log output provides you various pieces of information:
 The versions of Node-RED and Node.js
 Any errors hit when it tried to load the palette nodes
 The location of your Settings file and User Directory
 The name of the flows file it is using.
Node-RED uses flows_<hostname>.json as the default flows file. You can change this by
providing the flow file name as argument to the node-red command.
Command-line Usage
Node-RED can be started using the command node-red. This command can take various
arguments:

Dept. of ECE,AIT 2019-2020 Page 17


IOT PLATFORM INTEGRATION

Node-RED uses flows_<hostname>.json as the default flows file. If the computer you are running
on may change its hostname, then you should ensure you provide a static file name; either as a
command-line argument or using the flowsFile option in your settings file.
Passing arguments to the underlying Node.js process
There are occasions when it is necessary to pass arguments to the underlying Node.js process. For
example, when running on devices like the Raspberry Pi or BeagleBone Black that have a
constrained amount of memory.
Upgrading Node-RED
If you have installed Node-RED as a global npm package, you can upgrade to the latest version
with the following command:
$ sudo npm install -g --unsafe-perm node-red

Core Nodes of Node-Red

Figure 10: Nodes used in Node-Red


Dept. of ECE,AIT 2019-2020 Page 18
IOT PLATFORM INTEGRATION

There are 8 main categories of nodes in the default install: inputs, outputs, functions, social,
storage, analysis, advanced and Raspberry Pi (See Figs 4.1 and 4.2) Let’s take a look at each
category in turn.

Input nodes
There are 7 basic input nodes installed by default. They cover the basic communications
mechanisms that IoT applications are likely to use. Ranging from lower-level internet protocols
such as UDP and TCP through to the higher-level HTTP and the publish/subscribe MQTT.

Output nodes
The output nodes are essentially the mirror images of the basic set of input nodes and provide a
way to send data on the same set of protocols, i.e. mqtt, http, udp etc.

Function nodes
The function category contains a variety of nodes that carry out specific processing functions.
These range from the simple delay and switch nodes to the programmable function node that can
be adapted to almost any programming need.

Social nodes
The basic social media nodes support interaction with email and with Twitter. They enable flows
to send or receive email, or to send or receives tweets.

Dept. of ECE,AIT 2019-2020 Page 19


IOT PLATFORM INTEGRATION

Node-Red Editor

Figure 11: Node-Red Editor

The Node-RED editor consists of four main parts:

 Main workspace
 Node palette
 Information and Debug pane
 Menu and settings

Main Workspace

 The Main Workspace is where flows that you create from nodes reside. All of your
programming and interconnecting of devices happens here.

Dept. of ECE,AIT 2019-2020 Page 20


IOT PLATFORM INTEGRATION

Node Palette

 The left pane is your node palette. It has a searchable list of all the nodes that are currently
installed in neat, collapsible sections.

 Typically, you'll drag in and import a node. It's the most common way to initiate your
program logic.

 To get a node into your flow, left click the inject node and drag it into the main workspace,
then release to place it.

 Once it's placed, left click on it.

Information and Debug Pane

The right pane is the Information and Debug pane with these tabs:

 Information, which displays information about the selected node


 Node Help
 Debug, which displays errors and debug information

Menu and Settings

 Finally, there is the menu and Deploy button on the top right, where you can manage
Runtime and the settings.

Creating the first flow

1. Access the editor


With Node-RED running, open the editor in a web browser.
If you are using a browser on the same computer that is running Node-RED, you can access it with
the url: http://localhost:1880.
2. Add an Inject node
The Inject node allows you to inject messages into a flow, either by clicking the button on the
node, or setting a time interval between injects.
3. Add a Debug node
Dept. of ECE,AIT 2019-2020 Page 21
IOT PLATFORM INTEGRATION

The Debug node causes any message to be displayed in the Debug sidebar. By default, it just
displays the payload of the message, but it is possible to display the entire message object.
4. Wire the two together
Connect the Inject and Debug nodes together by dragging between the output port of one to the
input port of the other.
5. Deploy
At this point, the nodes only exist in the editor and must be deployed to the server.
6. Add a Function node
The Function node allows you to pass each message though a JavaScript function.

Figure 12: : Passing message through JavaScript function

Click done to close the edit dialog and then click the deploy button.
Now when you click the Inject button, the messages in the sidebar will now be formatted is
readable timestamps.

Dept. of ECE,AIT 2019-2020 Page 22


IOT PLATFORM INTEGRATION

Configuring the node

Figure 13: Configuring MQTT server node

Double click on the node to configure it. The main configuration screen is shown above. The main
setting is the broker or server setting.We can select a previously configured server which you can
edit by clicking on the edit button, or add a new broker by selecting the add new mqtt
server option from the server list.

Dept. of ECE,AIT 2019-2020 Page 23


IOT PLATFORM INTEGRATION

Figure 14: Node properties

The server name that appears in the server list is a combination of the client ID and Broker
name or IP address.

Note: The MQTT specification originally used the term broker but it has now been changed
to server.
You can also configure the topic address,the QOS for the message and the retain flag.
The topic address,the QOS and the retain flag can also be provided by the preceding node as
part of the message object using:

 msg.topic =mytopic
 msg.qos =0,1 or 2
 msg.retain =true or false

Dept. of ECE,AIT 2019-2020 Page 24


IOT PLATFORM INTEGRATION

node-red-contrib-mqtt-broker
Configuring the MQTT Publish and Subscribe Nodes in Node-Red.
MQTT Broker server on Node-RED. Mosca MQTT broker is implemented by Node.js, you can
use MQTT-in and MQTT-out nodes without MQTT environment like Mosquitto.

Figure 15: Node-red-contrib-mqtt-broker

Here the inject node is a timestamp which consists of date and time which is published to the
mosca broker depending on the configuration of the server node and then the timestamp is relayed
to the msg.payload.
After wiring up of all nodes is done then on clicking on deploy button, MQTT Broker will run on
your Node-RED. Both publisher and subscriber gets connected by indicating green colour buttons
near publisher and subscriber.
Thus, MQTT nodes have been published and subscribed using Node-Red.

Dept. of ECE,AIT 2019-2020 Page 25

You might also like