ES-IoT Unit 4
ES-IoT Unit 4
IoT devices are found everywhere and will enable circulatory intelligence in the future. For
operational perception, it is important and useful to understand how various IoT devices
communicate with each other. Communication models used in IoT have great value. The IoTs
allow people and things to be connected any time, any space, with anything and anyone,
using any network and any service.
• Publishers are the source of data. It sends the data to the topic which are
managed by the broker. They are not aware of consumers.
• Consumers subscribe to the topics which are managed by the broker.
• Hence, Brokers responsibility is to accept data from publishers and send it to the
appropriate consumers. The broker only has the information regarding the consumer
to which a particular topic belongs to which the publisher is unaware of.
3. Push-Pull Model
The push-pull model constitutes data publishers, data consumers, and data queues.
4. Exclusive Pair
• Simplicity: REST APIs are relatively simple to design and implement, making them a
popular choice for building APIs for web applications.
• Flexibility: REST APIs can be used to support a wide range of applications and
services, from simple web applications to complex enterprise systems.
• Caching: REST APIs can leverage caching to improve performance and reduce server
load.
• Stateless: REST APIs are stateless, meaning that each request is processed
independently of any previous requests, making them easy to scale and distribute.
• Limited real-time support: REST APIs do not support real-time communication between
the server and client, making them less suitable for applications that require real-time
updates.
• Performance overhead: REST APIs require more overhead than WebSocket APIs, as each
request and response must contain all the necessary information to complete the request.
• Complexity: REST APIs can be complex to design and implement for large, distributed
systems.
Web Socket APIs allow bi-directional, full-duplex communication between clients and servers.
It follows the exclusive pair communication model. This Communication API does not require
a new connection to be set up for each message to be sent between clients and servers. Once
the connection is set up the messages can be sent and received continuously without any
interruption. WebSocket APIs are suitable for IoT Applications with low latency or high
throughput requirements.
Advantages of WebSocket API:
• Complexity: WebSocket APIs are more complex to design and implement than REST
APIs, requiring additional programming skills and knowledge.
• Security: WebSocket APIs can be vulnerable to security threats if not properly secured.
• Compatibility: WebSocket APIs are not supported by all browsers, requiring fallback
mechanisms for older browsers.
• Both REST API and WebSocket API are used to build APIs for web applications.
• Both REST API and WebSocket API are standardized interfaces that enable
communication between the server and client.
• Both REST API and WebSocket API can be customized to suit the specific needs of a
particular application or system.
• Both REST API and WebSocket API can be secured using various authentication and
encryption methods.
Difference between Rest API and Web Socket API :
It is Stateless protocol. It will not store It is Stateful protocol. It will store the
1.
the data. data.
It depends upon the HTTP methods to It depends upon the IP address and
7.
retrieve the data.. port number to retrieve the data
It is slower than web socket regarding web socket transmits messages very
8.
the transmission of messages. fastly than REST API.
Message Queuing Telemetry Transport (MQTT): The message query telemetry transport
protocol is a communication-based protocol that is used for IoT devices. This protocol is based
on the publish-subscribe methodology in which clients receive the information through a
broker only to the subscribed topic. A broker is a mediator who categorizes messages into
labels before being delivered.
• Light-weight and reliable: The MQTT message is compact, which can realize stable
transmission on severely limited hardware equipment and network with low bandwidth
and high delay.
• Created for the IoT: It provides comprehensive IoT application features such as heartbeat
mechanism, testament message, QoS quality level
• Better ecosystem: It covers all-language platform's clients and SDKs, and it has mature
Broker server software, which can support massive Topic and ten-million-level device
access and provide rich enterprise integration capabilities.
CoAP
Constrained Application Protocol (COAP): The constrained application protocol is a client
server-based protocol. With this protocol, the COAP packet can be shared between different
client nodes which are commanded by the COAP server. The server is responsible to share the
information depending on its logic but has not acknowledged it. This is used with the
applications which support the state transfer model.
LoRaWAN
LoRaWAN refers to Long Rage Wide Area Network which is a wide area network protocol.
It is an optimized low-power consumption protocol design to support large-scale public
networks with millions of low-power devices. A single operator operates the LoRaWAN. The
LoRaWAN network is a bi-directional communication for IoT application with low cost,
mobility, and security..
An end device can connect to a network with LoRa WAN in two ways:
• Over-the-air Activation (OTAA): A device has to establish a network key and an application
session key to connect with the network.
• Activation by Personalization (ABP): A device is hardcoded with keys needed to communicate
with the network, making for a less secure but easier connection.
o Standard: LoRaWAN
o Frequency: Various
o Range: 2-5km (urban environment), 15km (suburban environment)
o Data Rates: 0.3-50 kbps.
6LoWPAN
The 6LoWPAN protocol refers to IPv6 Low Power Personal Area Network which uses a
lightweight IP-based communication to travel over low data rate networks. It has limited
processing ability to transfer information wirelessly using an internet protocol. So, it is mainly
used for home and building automation. The 6LoWPAN protocol operates only within the 2.4
GHz frequency range with 250 kbps transfer rate. It has a maximum length of 128-bit header
packets.
1. The device should be having sleep mode in order to support the battery saving.
2. Minimal memory requirement.
3. Routing overhead should be lowered.
Features of 6LoWPAN:
Advantages of 6LoWPAN:
1. 6LoWPAN is a mesh network that is robust, scalable, and can heal on its own.
2. It delivers low-cost and secure communication in IoT devices.
3. It uses IPv6 protocol and so it can be directly routed to cloud platforms.
4. It offers one-to-many and many-to-one routing.
5. In the network, leaf nodes can be in sleep mode for a longer duration of time.
Disadvantages of 6LoWPAN:
Applications of 6LoWPAN:
Communication
It uses Request-Response model. It uses Publish-Subscribe model
Type
Transport layer This mainly uses User Datagram This mainly uses Transmission
protocol protocol(UDP) Control protocol(TCP)
Basis of COAP MQTT
Effectiveness in LNN is
Effectiveness in LNN is low.
Effectiveness excellent.
Bluetooth
Bluetooth is universal for short-range wireless voice and data communication. It is a Wireless
Personal Area Network (WPAN) technology and is used for exchanging data over smaller
distances. This technology was invented by Ericson in 1994. It operates in the unlicensed,
industrial, scientific, and medical (ISM) band from 2.4 GHz to 2.485 GHz. Maximum devices
that can be connected at the same time are 7. Bluetooth ranges up to 10 meters. It provides
data rates up to 1 Mbps or 3 Mbps depending upon the version. The
spreading technique that it uses is FHSS (Frequency-hopping spread spectrum). A Bluetooth
network is called a piconet and a collection of interconnected piconets is called scatternet.
Bluetooth Architecture:
M-master
S-slave
Piconet:
Piconet is a type of Bluetooth network that contains one primary node called the master node
and seven active secondary nodes called slave nodes. Thus, we can say that there is a total of
8 active nodes which are present at a distance of 10 meters.
The communication between the primary and secondary nodes can be one-to-one or one-to-
many. Possible communication is only between the master and slave; Slave- slave
communication is not possible. It also has 255 parked nodes, these are secondary nodes and
cannot take participation in communication unless it gets converted to the active state.
Scatternet:
It is formed by using various piconets. A slave that is present in one piconet can act as master or
we can say primary in another piconet. This kind of node can receive a message
from a master in one piconet and deliver the message to its slave in the other piconet where
it is acting as a master. This type of node is referred to as a bridge node. A station cannot be
mastered in two piconets.
Advantage:
Disadvantages:
Applications:
It uses radio waves to transmit data between your device and a router.
Wireless Fidelity (Wi-Fi) is a generic term for the wireless network in the communication norm.
Wifi operates like a local area network without the use of a wire or cables.
Key components:
Wifi Adapter:it is inside your phone or laptop and catches the wifi
Wi-Fi has numerous kinds or standards. Here, the names of the standards are defined.
o Wi-Fi-1 (802.11b, launched in 1999) - This version has link speed from 2Mb/s to 11
Mb/s over 2.4 GHz frequency band
o Wi-Fi-2 (802.11a) launched in 1999. After a month of releasing the previous version,
802.11a, was released, and it provides upto 54 Mb/s link speed over the 5 GHz band
o Wi-Fi-3 (802.11g) was launched in 2003. In this version, the speed was risen up to 54
to 108 Mb/s over 2.4 GHz
o 802.11i launched in 2004. This is equivalentto802.11g, but only the security feature
was enhanced in this version
o 802.11e launched in 2004. This is also the same as 802.11g; only Voice over Wireless
LAN and multimedia streaming are included.
o Wi-Fi-4 (802.11n) launched in 2009. This version holds up both 2.4 GHz and 5 GHz
radio frequencies, and it provides up to 72 to 600 Mb/s speed.
o Wi-Fi-5 (802.11ac) launched in 2014. It supports a speed of 1733 Mb/s in the 5 GHz
band.
Advantages of WIFI
Wi-Fi Disadvantages
o Mobile phones, laptops, and other devices with batteries consume a lot of power when
using Wi-Fi.
o Even when encryption is in place, security issues can still arise.
o Wi-Fi can be attacked and accessed in the same way that recognised devices become
unidentified to the router.
o In comparison to a direct cable connection, the speed is slower.
o People can be harmed by it because it emits radiation like cell phones.
o Thunderstorms, for example, can interfere with Wi-Fi signals.
o Because it lacks a firewall, unauthorised access to Wi-Fi is possible.
o Since a router is required to access the internet via Wi-Fi, we can't access the internet
if the power goes out.
Zigbee
Zigbee is a low power, low data rate (250kbps) wireless protocol used primarily for Home
automation and industrial control, building automation,sensor data collection etc..Zigbee
devices have a range (1 hop) of 80 to 100m.
Devices can be split into:
1.Full Function Device (FFD)- Can communicates with all node types and can
operate in one of three modes:
2.Zigbee Coordinator Device: It communicates with routers. This device is used for
connecting the devices.
3.Zigbee Router: It is used for passing the data between devices.
4.ZigbeeEnd Device: It is the device that is going to be controlled.
Operating Frequency
Features of Zigbee:
1. Limited range: Zigbee has a relatively short range compared to other wireless
communications protocols, which can make it less suitable for certain types of applications
or for use in large buildings.
2. Limited data rate: Zigbee is designed for low-data-rate applications, which can make
it less suitable for applications that require high-speed data transfer.
3. Interoperability: Zigbee is not as widely adopted as other IoT protocols, which can make
it difficult to find devices that are compatible with each other.
4. Security: Zigbee’s security features are not as robust as other IoT protocols, making it
more vulnerable to hacking and other security threats.
Zigbee Applications:
1. Home Automation
2. Medical Data Collection
3. Industrial Control Systems
4. meter reading system
5. light control system
6. Commercial
7. Government Markets Worldwide
8. Home Networking.
GPS
Global Positioning System (GPS) is a navigation system based on satellite. It has created the
revolution in navigation and position location. It is mainly used in positioning, navigation,
monitoring and surveying applications.
Usage of GPS:
There are five most uses of the GPS.
• Location:- with the help of GPS we can find the exact position of the object.
• Navigation:– we can navigate one location to another with the help of GPS.GPS
technology is also useful for Transportation Management and breathing of Ship at
docks.
• Tracking: -with the help of GPS we can Monitor object movement like speed, distance,
position.
• Mapping:– GPS also helps in creating maps of the World.
• Timing:- GPS also provides the estimated time for reaching destination measurement
its depend on speed and object movement.
GSM
GSM stands for Global System for Mobile Communication. GSM is an open and digital
cellular technology used for mobile communication. It uses 4 different frequency bands of
850 MHz, 900 MHz, 1800 MHz and 1900 MHz . It uses the combination of FDMA and
TDMA.
GSM is having 4 different sizes of cells are used in GSM :
1. BSS : BSS stands for Base Station Subsystem. BSS handles traffic and signaling
between a mobile phone and the network switching subsystem. BSS having two
components BTS and BSC.
2. NSS : NSS stands for Network and Switching Subsystem. NSS is the core network of GSM.
That carried out call and mobility management functions for mobile phone present in
network. NSS have different components like VLR, HLR and EIR.
3. OSS : OSS stands for Operating Subsystem. OSS is a functional entity which the network
operator monitor and control the system. OMC is the part of OSS. Purpose of OSS is to
offer the customer cost-effective support for all GSM related maintenance services.
Suppose there are 3 Mobile stations which are connected with the tower and that tower is
connected to BTS through TRX, then further connected to BSC and MSC. Let’s understand
the functionality of different components.
1. MS : MS stands for Mobile System. MS comprises user equipment and software needed for
communication with a mobile network. Mobile Station (MS) = Mobile Equipment(ME) +
Subscriber Identity Module (SIM). Now, these mobile stations are connected to tower and that
tower connected with BTS through TRX. TRX is a transceiver which comprises transmitter
and receiver. Transceiver has two performance of sending and receiving.
2. BTS : BTS stands for Base Transceiver Station which facilitates wireless communication
between user equipment and a network. Every tower has BTS.
3. BSC : BSC stands for Base Station Controller. BSC has multiple BTS. You can consider
the BSC as a local exchange of your area which has multiple towers and multiple towers have
BTS.
4. MSC : MSC stands for Mobile Switching Center. MSC is associated with communication
switching functions such as call setup, call release and routing. Call tracing, call forwarding all
functions are performed at the MSC level.
Services of GSM:
Advantages:
Compatibility: GSM is widely used around the world, so it is compatible with many different
networks and devices.
Security: GSM offers enhanced security features such as authentication, encryption and
confidentiality, which helps to protect the user’s privacy and data.
Efficient use of bandwidth: GSM uses a time-division multiplexing (TDM) technique which
enables many users to share the same frequency channel at different times, making it an
efficient use of the available bandwidth.
Roaming: GSM allows users to roam internationally and use their mobile phones in other
countries that use the same GSM standard.
Wide range of features: GSM supports a wide range of features, including call forwarding,
call waiting, voicemail, conference calling, and more.
Disadvantages:
Limited coverage: GSM networks may have limited coverage in some remote areas, which
can make it difficult for users to make calls or access the internet.
Network congestion: GSM networks may become congested during peak hours, which can
lead to dropped calls or poor call quality.
Security vulnerabilities: Although GSM offers enhanced security features, it is still
vulnerable to certain types of attacks, such as eavesdropping and spoofing.
Data transfer speed: GSM networks offer relatively slow data transfer speeds compared to
newer technologies such as 3G and 4G.
Limited capacity: GSM networks have a limited capacity for handling large volumes of data,
which can be a disadvantage for users who require high-speed internet access or other data-
intensive applications.
Single Board Computers -Raspberry-Pi
Raspberry Pi is launched in 2012 and there have been several iterations and variations released
since then.
Various versions of Raspberry Pi have been out till date. All versions consist of a
Broadcom system on a chip (SoC) with an integrated ARM-compatible CPU and on-chip
graphics processing unit (GPU).
• Use for explore computing as for programmings like Scratch and Python
languages.
:-
Raspberry Pi mainly consists of the following blocks:
• Processor: Raspberry Pi uses Broadcom BCM2835 system on chip which is an ARM
processor and Video core Graphics Processing Unit (GPU). It is the heart of the
Raspberry Pi which controls the operations of all the connected devices and handles
all the required computations.
Processor and Ram
• Based on an ARM processor.
• The latest version of Raspberry Pi (model B, revision 2) comes with a 700 MHz low-
power ARM 1176JZ-F processor And a 512 MB SD Ram..
• HDMI: High Definition Multimedia Interface is used for transmitting video or digital
audio data to a computer monitor or to digital TV. This HDMI port helps Raspberry Pi
to connect its signals to any digital device such as a monitor digital TV or display
through an HDMI cable.
• GPIO ports: General Purpose Input Output ports are available on Raspberry Pi which
allows the user to interface various I/P devices.
• Audio output: An audio connector is available for connecting audio output devices
such as headphones and speakers.
• USB ports: This is a common port available for various peripherals such as a mouse,
keyboard, or any other I/P device. With the help of a USB port, the system can be
expanded by connecting more peripherals.
• Two USB 2.0 USB ports on Raspberry pi can provide a current of up to 100 mA.
• For connecting devices that draw a current of more than 100 mA, an external USB-
powered hub is required.
• SD card: The SD card slot is available on Raspberry Pi. An SD card with an operating
system installed is required for booting the device.
• Ethernet: The ethernet connector allows access to the wired network, it is available
only on the model B of Raspberry Pi.
• Standard RJ45 Ethernet port.
• Power supply: A micro USB power connector is available onto which a 5V power
supply can be connected.
• Camera module: Camera Serial Interface (CSI) connects the Broadcom processor to
the Pi camera.
• Display: Display Serial Interface (DSI) is used for connecting LCD to Raspberry Pi
using 15 15-pin ribbon cables. DSI provides a high-resolution display interface that is
specifically used for sending video data.
Raspberry pi Connecting to the Cloud
Connecting a Raspberry Pi to the cloud allows you to access and manage your Raspberry Pi
remotely, exchange data with cloud services, and perform various tasks such as data logging,
remote control, and automation. Here's a general overview of how to connect a Raspberry Pi
to the cloud:
1. Select a Cloud Service Provider: Choose a cloud service provider that fits your needs. Some
popular options include AWS (Amazon Web Services), Microsoft Azure, Google Cloud
Platform, and various IoT-focused platforms like AWS IoT, Azure IoT, or Google Cloud IoT.
Each has its own set of features, pricing, and capabilities.
2. Set Up Your Raspberry Pi: Ensure your Raspberry Pi is set up correctly, connected to the
internet, and running an appropriate operating system like Raspbian (now called Raspberry Pi
OS).
3. Install Necessary Software: Depending on your chosen cloud platform, you may need to
install specific libraries or SDKs on your Raspberry Pi. For example, if you're using AWS, you
would install the AWS SDK for Python (Boto3). If you're using Azure, you might use the
Azure IoT SDK or Azure Python SDK.
4. Create Cloud Resources: Create the necessary resources on your cloud platform. For
example, if you're using AWS IoT, you'd create an IoT Thing, a policy, and certificates.
5. Connect to the Cloud: Write code on your Raspberry Pi to connect to your cloud platform of
choice. This typically involves using the SDK you installed earlier and providing the necessary
authentication credentials (e.g., API keys, certificates, or access tokens).
6. Publish and Subscribe to Topics (MQTT): Many IoT applications use the publish-
subscribe model for communication. MQTT (Message Queuing Telemetry Transport) is a
common protocol for this purpose. You can publish data from your Raspberry Pi to specific
MQTT topics and subscribe to topics to receive commands or data from the cloud.
7. Data Handling and Processing: Once your Raspberry Pi is connected, you can send and
receive data between the Raspberry Pi and the cloud. You may want to implement data
processing, storage, or analytics depending on your project's requirements.
8. Security Considerations: Ensure proper security practices. Use secure connections (HTTPS,
MQTT over TLS), secure your IoT devices and cloud resources, and regularly update your
Raspberry Pi's software to patch any security vulnerabilities.
9. Monitoring and Management: Set up monitoring and management tools provided by your
cloud platform to keep an eye on your Raspberry Pi's health and performance. This might
include dashboards, alerts, and logging.
10. Scale and Optimize: As your project grows, you may need to scale your cloud resources and
optimize your code and infrastructure for performance and cost-efficiency.