0% found this document useful (0 votes)
3 views29 pages

Mod 5

Constrained devices are low-power microcontrollers with limited resources, such as the Node MCU built on the ESP 8266 microcontroller, which supports various communication protocols like CoAP, MQTT, and REST API. CoAP is designed for small devices and uses UDP for communication, while MQTT is a lightweight publish-subscribe protocol ideal for IoT devices. REST APIs follow standard HTTP requests for database operations and are characterized by principles such as statelessness and client-server decoupling.

Uploaded by

Sarthak Rai
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)
3 views29 pages

Mod 5

Constrained devices are low-power microcontrollers with limited resources, such as the Node MCU built on the ESP 8266 microcontroller, which supports various communication protocols like CoAP, MQTT, and REST API. CoAP is designed for small devices and uses UDP for communication, while MQTT is a lightweight publish-subscribe protocol ideal for IoT devices. REST APIs follow standard HTTP requests for database operations and are characterized by principles such as statelessness and client-server decoupling.

Uploaded by

Sarthak Rai
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/ 29

WEB ENABLED

CONSTRICTED
DEVICES
WHAT ARE CONSTRAINED DEVICES
Constrained devices are microcontrollers, smart devices,..etc.
Constraints on such devices usually include - limited energy supply,
small battery power, little memory space (flash and RAM) and small
computing capabilities.
NODE MCU
It is a developmental Board built over ESP 8266 32Bit Microcontroller.

Specifications:

Microcontroller - ESP 8266


Clock Speed - 80Mhz
USB to Serial - CH340G

Operating Voltage - 3V
Input Voltage - 4.25V ~ 10V

GPIOs x 17
Analog Pins x1

Wifi Built -in: 802.11 b/g/n Standard

1xI2C interface | 2X UART interfaces | 2x SPI interfaces | 4 channel PWM


Software Specs
Software:

Modes: Station Mode || Soft Access Point Mode || Soft Access Point + Station Mode

Security: WPA/WPA2

Encryption: WEP/TKIP/AES

Network Protocols: IPv4,TCP/UDP/HTTP/FTP


Station Mode
Normal Mode for Connection ⇒ A device uses Station Mode to Connect to an existing network.

Soft Access Point Mode


Node MCU connects dynamically to any access point.

Under this mode Node MCU creates a hotspot to let other Wifi Stations
Connect to configure and reconnect it to the ISP’s Station.
Arduino UNO >> ESP8266
Transitioning from UNO to node MCU is not a tedious
journey, As one can program an ESP on Arduino IDE.

What was new?


Only the Wifi module, which works on the
wifi stack.

BTW, Hitler Meo Meo ===>


The Blink
“Doge” =====>

{ Blink } == “ Hello World! ” ;


Wifi Scan
Scanning
MQTT with Node MCU
In the current example, Node-MCU is the Publisher,
Hive MQ is Broker, The IDE is on the Application end.
Making Connection
Subscribing

Button Click
Publishing

On
OFF
WHY
COMMUNICATION
IS IMPORTANT

DISCLAIMER: WE DO NOT PROMOTE ANY OF THE ABOVE USED EXAMPLES


Few Communication Protocols

CoAP

MQTT

REST API
Constrained Application Protocol (CoAP)

What is CoAP?

● CoAP is a user-server based protocol.


● It is designed for small devices with low power.
● CoAP functions as a sort of HTTP for restricted devices,
enabling equipment such as sensors or actuators to
communicate on the IoT.
● It’s messages are sent and received over User
Datagram Protocol (UDP).
CoAP Characteristics

Features of CoAP

● Package is shared between various client nodes,


which are directed by the CoAP server.
● For communication, it uses a request-response
prototype.
● The Header size of CAOP is 4 bytes.
● It is RESTful (HTTP) based.
● It has a secured system, and its usability is in Utility
area networks.
CoAP Architecture
Advantages of CoAP

Few advantages are

● Reduced power consumption.


● Grass-root level usage.
● Security is well maintained.
● Multiple messages within
a short time frame.
Limitations of CoAP

Few limitations are

● It does not have persistence support.


● It has Low Latency and NAT issues.
● Longer processing time.
● Lousy implementation methods.
Message Queuing Telemetry Transport

What is MQTT?

● MQTT was developed in 1999 by IBM and Eurotech for


linking sensors on oil pipelines to satellites.
● It is a publish-subscribe protocol that enables brokers
to mediate one-to-many communication amongst IoT
devices.
● MQTT basically transmits messages across devices
using a small code footprint and limited network
bandwidth.
MQTT Architecture
Advantages of MQTT

Few advantages are

● Simple message encryption.


● Boasts of a reliable and professional message delivery
system.
● Clients are lightweight and do not need minimal
resources
● Easily scalable
Limitations of MQTT

Few limitations are

● Slower transmit cycles compared to CoAP.


● Lack of security encryption as MQTT uses Transport
Layer Security or Secure Sockets Layer (TLS/SSL).
● No multi-casting MQTT support.
REST API

What is REST API?

● A REST API is an API that conforms to the design


principles of the REST, or representational state
transfer architectural style.
● REST APIs communicate via HTTP requests to perform
standard database functions like creating, reading,
updating, and deleting records (also known as CRUD).
WORKING OF REST API
The state of a resource at any particular instant, or
timestamp, is known as the resource representation.

Request headers and parameters are also important in


REST API calls because they include important identifier
information such as metadata, authorizations, uniform
resource identifiers (URIs), caching, cookies and more.
Request headers and response headers, along with
conventional HTTP status codes, are used within well-
designed REST APIs.
DESIGNING REST API
● Uniform Interface
● Client-server decoupling
● Statelessness
● Cacheability
● Layered System Architecture
● Code on demand
THANK
YOU

You might also like