KEMBAR78
IoT - Module 4 | PDF | World Wide Web | Internet & Web
0% found this document useful (0 votes)
15 views65 pages

IoT - Module 4

Uploaded by

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

IoT - Module 4

Uploaded by

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

INTERNET OF

THINGS (IOT)
Prepared By: Assistant Prof. Purvaj Piyush Vaidya 1
(MTech)
Syllabus: Module 4

22/12/202 R. N. G, Patel Institute of Technolo


4 gy
BASICS OF WIRELESS
NETWORKING
 Wireless network: Computer networks that are not connected by cables are
called wireless networks

Assistant Prof. Purvaj Piyush Vaidya


 They generally use radio waves for communication between the network nodes
 They allow devices to be connected to the network while roaming around within
the network coverage
 How wireless networks work?: Wireless Local Area Network (WLAN) serves the
same function as a wired one to connect a group of computers
 Since “wireless” does not require expensive wiring, the primary advantage is that
it is typically simpler, quicker, and cheaper to set up
 Wireless networks operate using Radio Frequency (RF) technology, a frequency
associated with radio wave propagation within the electromagnetic spectrum
 An electromagnetic field is generated when an RF current is supplied to an
antenna that can then spread through space

22/12/202 R. N. G, Patel Institute of Technolo 2


4 gy
BASICS OF WIRELESS
NETWORKING (CONTD.)
 A system recognized as an access point (AP) is the core of a wireless network
 An access point’s primary role is to broadcast a wireless signal sensed and

Assistant Prof. Purvaj Piyush Vaidya


tuned into by computers
 Since wireless networks are typically linked to wired networks, access points
often act as a gateway to a wired network’s resources, such as an Internet
connection
 Computers need to be fitted with wireless network adapters to connect to an
access point and join a wireless network
 These are mostly built right into the device, but if not, by using an add-on
adapter attached to an empty expansion slot, USB port, or, in the case of
notebooks, a PC card slot, just about any computer or notebook can be made
wireless-capable

22/12/202 R. N. G, Patel Institute of Technolo 3


4 gy
BASICS OF WIRELESS
NETWORKING (CONTD.)
 Types of wireless networks:
 Wireless Local Area Network (WLAN): WLAN links two or more devices using

Assistant Prof. Purvaj Piyush Vaidya


a wireless medium, providing a connection through access points to the wider
Internet
 Wireless personal area networks (WPANs) interconnect devices within a
relatively small area, which is generally within a person's reach
 For example, both bluetooth radio and invisible infrared light provides a WPAN
for interconnecting a headset to a laptop
 Wireless Metropolitan Area Network (WMAN): It connects several wireless
LANs that make a larger wireless network called MAN
 WiMAX is a type of Wireless MAN and is described by the IEEE 802.16 standard

22/12/202 R. N. G, Patel Institute of Technolo 4


4 gy
BASICS OF WIRELESS
NETWORKING (CONTD.)
 Wireless Wide Area Network (WWAN): It covers large areas such as
neighboring towns and cities

Assistant Prof. Purvaj Piyush Vaidya


 Wireless wide area networks are wireless networks that typically cover large
areas, such as between neighboring towns and cities, or city and suburb
 These networks can be used to connect branch offices of business or as a
public internet access system
 The wireless connections between access points are usually point to point
microwave links using parabolic dishes on the 2.4 GHz band, rather than omni
directional antennas used with smaller networks
 Wireless Personal Area Network (WPAN): PAN interconnects devices in a
short span, generally within a person’s reach

22/12/202 R. N. G, Patel Institute of Technolo 5


4 gy
BASICS OF WIRELESS
NETWORKING (CONTD.)
 Wireless network elements: Wireless NEs are products and devices used by a
wireless carrier to provide support for the backhaul network as well as a Mobile

Assistant Prof. Purvaj Piyush Vaidya


Switching Center (MSC)
 The telecommunications network at the physical layer also consists of many
interconnected wire line Network Elements (NEs)
 These NEs can be stand-alone systems or products that are either supplied by a
single manufacturer, or are assembled by the service provider (user) or system
integrator with parts from several different manufacturers
 The important NEs are the NEs that are located on the cell tower to the Base
Station (BS) cabinet

22/12/202 R. N. G, Patel Institute of Technolo 6


4 gy
BASICS OF WIRELESS
NETWORKING (CONTD.)
 The attachment hardware and the positioning of the antenna and associated
closures/cables are required for adequate strength, robustness, corrosion

Assistant Prof. Purvaj Piyush Vaidya


resistance, and rain/solar resistance for expected wind, storm, ice, and other
weather conditions
 Components, such as hardware, cables, connectors, and closures, shall take into
consideration the structure to which they are attached are the NEs

22/12/202 R. N. G, Patel Institute of Technolo 7


4 gy
BASICS OF WIRELESS
NETWORKING (CONTD.)
 Wireless networking standards:
 802.11a: This original amendment added support for the 5 GHz band, allowing

Assistant Prof. Purvaj Piyush Vaidya


transmission up to 54 megabits of data per second
 The 802.11a standard makes use of orthogonal frequency-division multiplexing
(OFDM)
 It splits the radio signal into sub-signals before they get to a receiver
 802.11a is an older standard and has been largely replaced by newer
technology
 802.11b: 802.11b added faster rates in the 2.4GHz band to the original standard
 It can pass up to 11 megabits of data in a second
 It uses complementary code keying (CCK) modulation to achieve better speeds
 802.11b is an older standard and has been largely replaced by newer
technology

22/12/202 R. N. G, Patel Institute of Technolo 8


4 gy
BASICS OF WIRELESS
NETWORKING (CONTD.)
 802.11g: 802.11g standardized the use of OFDM technology used in 802.11a in
the 2.4GHz band

Assistant Prof. Purvaj Piyush Vaidya


 It was backwards compatible with both 802.11 and 802.11b. 802.11g is an
older standard and has been largely replaced by newer technology
 802.11n: Once the most popular standard 802.11n was the first time a unified
specification covered both the 2.4GHz and 5GHz bands
 This protocol offers better speed when compared to those that came before it
by leveraging the idea of transmitting using multiple antennas simultaneously
(usually called Multiple In Multiple Out or MIMO technology)
 802.11n is an older standard, but some older devices may still be found in use

22/12/202 R. N. G, Patel Institute of Technolo 9


4 gy
BASICS OF WIRELESS
NETWORKING (CONTD.)
 802.11ac: 802.11ac was only specified for the 5GHz band
 It built upon the mechanisms introduced in 802.11n

Assistant Prof. Purvaj Piyush Vaidya


 While not as revolutionary as 802.11n was, it still extended speeds and
capabilities in the 5GHz band
 Most devices currently out in the wild are likely 802.11ac devices
 802.11ac technology was released in two main groups, usually called ‘waves’
 The primary difference is that Wave 2 devices have a few more technical
capabilities when compared to Wave 1, but it is all interoperable

22/12/202 R. N. G, Patel Institute of Technolo 10


4 gy
BASICS OF WIRELESS
NETWORKING (CONTD.)
 802.11ax (Wi-Fi 6): 802.11ax (much like 802.11n) unified the specification
across all applicable frequency bands

Assistant Prof. Purvaj Piyush Vaidya


 In the name of simplicity, the industry has started to refer to it as Wi-Fi 6
 Wi-Fi 6 has expanded the technologies used for modulation to include OFDMA,
which allows a certain amount of parallelism to the transmission of packets
within the system, making more efficient use of the available spectrum and
improving the overall network throughput
 Wi-Fi 6 is the latest technology and is what most new devices are shipping with
 Other 802.11 Standards: There are many more amendments that have been
made to the standards over the years (most letters of the alphabet have been
used over time)
 Additional 802.11 standards have focused on things like better security,
increased Quality of Service, as well as many other enhancements

22/12/202 R. N. G, Patel Institute of Technolo 11


4 gy
BASICS OF WIRELESS
NETWORKING (CONTD.)
 Wi-Fi network connection modes:
 Infrastructure: Infrastructure mode is the most common style of Wi-Fi, and it is

Assistant Prof. Purvaj Piyush Vaidya


the one people think of when they connect at home or the office
 With infrastructure mode, you need an access point that serves as the primary
connection device for clients
 All other clients in the network (computer, printer, mobile phone, tablet, or
other device) connect to an access point to gain access to a wider network.

 Ad Hoc: Ad hoc mode is also referred to as peer-to-peer mode because it does


not involve an access point, but is instead made up of multiple client devices
 The devices, acting as “peers” within the network, connect to each other
directly.

22/12/202 R. N. G, Patel Institute of Technolo 12


4 gy
BASICS OF WIRELESS
NETWORKING (CONTD.)
 Wi-Fi Direct: Wi-Fi Direct is a form of Ad Hoc, but with some additional features
and capabilities

Assistant Prof. Purvaj Piyush Vaidya


 Wireless connectivity is provided to compatible devices that need to connect
without the use of an access point
 Televisions are frequently Wi-Fi Direct compatible, allowing users to send music
or images straight from a mobile device to their TV.

22/12/202 R. N. G, Patel Institute of Technolo 13


4 gy
BASICS OF WIRELESS
NETWORKING (CONTD.)
 Wi-Fi Hotspot: The term “Wi-Fi hotspot” usually refers to wireless networks
placed in public areas, like coffee shops, to allow people to connect to the

Assistant Prof. Purvaj Piyush Vaidya


internet without having to have special credentials
 While some are free, others require a fee, particularly those administered by
companies that specialize in the provision of hotspots in places like airports or
bus terminals
 Many cell phones are hotspot-enabled, and users can turn on the feature by
contacting their cell service provider
 With a hotspot turned on, the user can share their internet connection with
someone else, providing them with a password for more secure access

22/12/202 R. N. G, Patel Institute of Technolo 14


4 gy
BASICS OF WIRELESS
NETWORKING (CONTD.)
 Advantages of wireless networking:
 It provides clutter-free desks due to the absence of wires and cables

Assistant Prof. Purvaj Piyush Vaidya


 It increases the mobility of network devices connected to the system since the
devices need not be connected to each other
 Accessing network devices from any location within the network coverage or Wi-
Fi hotspot becomes convenient since laying out cables is not needed
 Installation and setup of wireless networks are easier
 New devices can be easily connected to the existing setup since they needn’t be
wired to the present equipment
 Also, the number of equipment that can be added or removed to the system can
vary considerably since they are not limited by the cable capacity. This makes
wireless networks very scalable
 Wireless networks require very limited or no wires. Thus, it reduces the
equipment and setup costs.
22/12/202 R. N. G, Patel Institute of Technolo 15
4 gy
BASICS OF WIRELESS
NETWORKING (CONTD.)
 Problems in setting up a wireless network:
 Interference: Interference is the main problem faced in the wireless network

Assistant Prof. Purvaj Piyush Vaidya


 Electromagnetic interference occurs in this network
 This can be caused by other networks or other types of equipment that
generate radio waves that are within, or close, to the radio bands used for
communication
 Interference can degrade the signal or cause the system to fail
 This is the basic problem faced
 Absorption and reflection: Absorption of electromagnetic waves due to some
material which prevent it from reaching the receiver
 Reflection can cause dead zones where no reception is available particularly
with metallic or conductive materials

22/12/202 R. N. G, Patel Institute of Technolo 16


4 gy
BASICS OF WIRELESS
NETWORKING (CONTD.)
 Multipath fading: In multipath fading the signal takes two or more routes or
paths, Reflections can cause the signal to cancel out at certain locations and to

Assistant Prof. Purvaj Piyush Vaidya


be stronger in other places which is called upfade
 Hidden node problem: In some types of network the hidden node problem
comes when a node is visible from a wireless access point (AP), but not from
other nodes communicating with that AP
 This leads to difficulties in media access control

22/12/202 R. N. G, Patel Institute of Technolo 17


4 gy
BASICS OF WIRELESS
NETWORKING (CONTD.)
 Examples of wireless networks:
 Cell phone networks

Assistant Prof. Purvaj Piyush Vaidya


 Wireless sensor networks
 Satellite communication networks
 Terrestrial microwave networks

22/12/202 R. N. G, Patel Institute of Technolo 18


4 gy
ESP8266 WIFI MODULE

Assistant Prof. Purvaj Piyush Vaidya


22/12/202 R. N. G, Patel Institute of Technolo 19
4 gy
ESP8266 WIFI MODULE
(CONTD.)
 The manufacturer of ESP8266 is Espressif Systems

Assistant Prof. Purvaj Piyush Vaidya


 Its working voltage is from 3V to 3.6V.

 It is low powered, compact and highly durable integrated WiFi-based microcontroller

 Used for the development of end-point IoT (Internet of things) applications such as
cost, power, performance, and design.
 It is used to enable the internet connection to various applications of embedded
systems
 It is always in front of its forerunner in requisites of speed handling and storage ability

 It can be also used as a web server

 It is referred to as a standalone wireless transceiver, available at a very low price

 It has the power to supervise any other device, or it can easily devolve a Wi-Fi network
connecting with other systems
22/12/202 R. N. G, Patel Institute of Technolo 20
4 gy
ESP8266 WIFI MODULE
(CONTD.)
 It has a massive amount of on-chip variation which is fine for the smallest exterior

Assistant Prof. Purvaj Piyush Vaidya


 Designed to support both the TCP/IP capability and the microcontroller access to
any Wi-Fi network
 It can work as either a slave or a standalone application

 If the ESP8266 Wi-Fi runs as a slave to a microcontroller host, then it can be used as
a Wi-Fi adaptor to any type of microcontroller using UART (Universal Asynchronous
Receiver Transmitter)
 If the module is used as a standalone application, then it provides the functions of
the microcontroller and Wi-Fi network
 The ESP8266 Wi-Fi module is highly integrated with RF balun, power modules, RF
transmitter and receiver, analog transmitter and receiver, amplifiers, filters, digital
baseband, power modules, external circuitry, and other necessary components

22/12/202 R. N. G, Patel Institute of Technolo 21


4 gy
ESP8266 WIFI MODULE
(CONTD.)
 Features of ESP8266
 Microcontroller: Tensilica Xtensa L106 32 bit

Assistant Prof. Purvaj Piyush Vaidya


 Clock frequency: 80 MHz
 Instruction RAM: 64 KiB
 Data RAM: 96 KiB
 Flash Memory: 512 KiB (extends up to 16 MiB)
 Wi-Fi Protocols: 802.11 b/g/n/e/i
 Operating Voltage: 2.5V ~ 3.6V
 Operating Current: 80 mA (average value)
 Storing or operating temperature: -40°C ~ 125°C

22/12/202 R. N. G, Patel Institute of Technolo 22


4 gy
ESP8266 WIFI MODULE
(CONTD.)
 Pinouts

Assistant Prof. Purvaj Piyush Vaidya


 RX Pin: RX pin is used for receiving the serial data. It is used for communication
between two devices or boards. RX pin receives the serial data sent by the other board
or device.
 VCC Pin: VCC pin is to power up the ESP8266. The ideal power supply is 3.3 Volt. It can
also operate on the power between 2.5V ~ 3.6V
 GPIO_0 Pin: This pin is a general-purpose input/output pin. It is also used to change the
mode of ESP8266 to programming mode.
22/12/202 R. N. G, Patel Institute of Technolo 23
4 gy
ESP8266 WIFI MODULE
(CONTD.)
 RST Pin: Reset Pin. This pin is an active low pin. To reset module, set RST Pin to
0V. For normal operation, set it to 3.3V.

Assistant Prof. Purvaj Piyush Vaidya


 GPIO_2 Pin: This pin is also a general-purpose input/output pin.
 CH_PD Pin: Chip Enable pin. Supply 3.3 V to the pin to enable the chip.
 GND Pin: This is Ground Pin.
 TX Pin: TX pin is used for transmitting the serial data. TX pin sends the serial data
to the other board or device. With the use of both RX and TX board can serially
communicate

22/12/202 R. N. G, Patel Institute of Technolo 24


4 gy
ESP8266 WIFI MODULE
(CONTD.)
 Applications:
 Access points portals

Assistant Prof. Purvaj Piyush Vaidya


 IoT projects
 Wireless data logging
 Used in learning the networking fundamentals
 Sockets and smart bulbs
 Smart home automation systems

22/12/202 R. N. G, Patel Institute of Technolo 25


4 gy
VARIOUS WIFI LIBRARY
 Simplelink WiFi enabled boards can use the WiFi library to connect to the internet

Assistant Prof. Purvaj Piyush Vaidya


 The WiFi library is very similar to the Ethernet library, and many of the function
calls are the same
 WiFi class
 The WiFi class initializes the ethernet library and network settings
 begin()
 disconnect()
 config()
 setDNS()
 SSID()
 BSSID()
 RSSI()

22/12/202 R. N. G, Patel Institute of Technolo 26


4 gy
VARIOUS WIFI LIBRARY
(CONTD.)
 encryptionType()
 scanNetworks()

Assistant Prof. Purvaj Piyush Vaidya


 getSocket()
 macAddress()
 IP Address class
 The IPAddress class provides information about the network configuration
 localIP()
 subnetMask()
 gatewayIP()

22/12/202 R. N. G, Patel Institute of Technolo 27


4 gy
VARIOUS WIFI LIBRARY
(CONTD.)
 Server class
 The Server class creates servers which can send data to and receive data from

Assistant Prof. Purvaj Piyush Vaidya


connected clients (programs running on other computers or devices)
 Server
 WiFiServer()
 begin()
 available()
 write()
 print()
 println()

22/12/202 R. N. G, Patel Institute of Technolo 28


4 gy
VARIOUS WIFI LIBRARY
(CONTD.)
 Client class
 The client class creates clients that can connect to servers and send and

Assistant Prof. Purvaj Piyush Vaidya


receive data.
 Client
 WiFiClient()
 connected()
 connect()
 write()
 print()
 println()
 available()
 read()
 flush()
22/12/202  stop() R. N. G, Patel Institute of Technolo 29
4 gy
VARIOUS WIFI LIBRARY
(CONTD.)
 UDP class
 The UDP class enables UDP message to be sent and received

Assistant Prof. Purvaj Piyush Vaidya


 WiFiUDP
 begin()
 available()
 beginPacket()
 endPacket()
 write()
 parsePacket()
 peek()

22/12/202 R. N. G, Patel Institute of Technolo 30


4 gy
VARIOUS WIFI LIBRARY
(CONTD.)
 read()
 flush()

Assistant Prof. Purvaj Piyush Vaidya


 stop()
 remoteIP()
 remotePort()

22/12/202 R. N. G, Patel Institute of Technolo 31


4 gy
VARIOUS WIFI LIBRARY
(CONTD.)
 Examples
 ConnectNoEncryption : Demonstrates how to connect to an open network

Assistant Prof. Purvaj Piyush Vaidya


 ConnectWithWEP : Demonstrates how to connect to a network that is
encrypted with WEP (Wired Equivalent Privacy)
 ConnectWithWPA : Demonstrates how to connect to a network that is
encrypted with WPA2Personal (Wi-Fi Protected Access)
 ScanNetworks : Displays all WiFi networks in range
 WiFiChatServer : Set up a simple chat server
 WiFiXivelyClient : connect to xively.com, a free datalogging site

22/12/202 R. N. G, Patel Institute of Technolo 32


4 gy
VARIOUS WIFI LIBRARY
(CONTD.)
 WiFiXivelyClientString :send strings to xively.com
 WiFiWebClient : Connect to a remote webserver

Assistant Prof. Purvaj Piyush Vaidya


 WiFiWebClientRepeating : Make repeated HTTP calls to a webserver
 WiFiWebServer : Serve a webpage from the WiFi shield
 WiFiSendReceiveUDPString : Send and receive a UDP string
 UdpNTPClient : Query a Network Time Protocol (NTP) server using UDP

22/12/202 R. N. G, Patel Institute of Technolo 33


4 gy
WEB SERVER
 A web server’s primary role is to serve web pages for a website

Assistant Prof. Purvaj Piyush Vaidya


 A web server is software and hardware that uses HTTP (Hypertext Transfer Protocol)
and other protocols to respond to client requests made over the World Wide Web
 The main job of a web server is to display website content through storing,
processing and delivering webpages to users
 Besides HTTP, web servers also support SMTP (Simple Mail Transfer Protocol) and
FTP (File Transfer Protocol), used for email, file transfer and storage
 Web server hardware is connected to the internet and allows data to be exchanged
with other connected devices, while web server software controls how a user
accesses hosted files

22/12/202 R. N. G, Patel Institute of Technolo 34


4 gy
WEB SERVER (CONTD.)
 The web server process is an example of the client/server model. All computers that
host websites must have web server software

Assistant Prof. Purvaj Piyush Vaidya


 Web servers are used in web hosting, or the hosting of data for websites and web-
based applications -- or web applications
 Web server software is accessed through the domain names of websites and
ensures the delivery of the site's content to the requesting user
 The software side is also comprised of several components, with at least an HTTP
server
 The HTTP server is able to understand HTTP and URLs

 As hardware, a web server is a computer that stores web server software and other
files related to a website, such as HTML documents, images and JavaScript files

22/12/202 R. N. G, Patel Institute of Technolo 35


4 gy
WEB SERVER (CONTD.)
 Working
 When a web browser, like Google Chrome or Firefox, needs a file that's hosted on a

Assistant Prof. Purvaj Piyush Vaidya


web server, the browser will request the file by HTTP
 When the request is received by the web server, the HTTP server will accept the
request, find the content and send it back to the browser through HTTP
 More specifically, when a browser requests a page from a web server, the process
will follow a series of steps
 First, a person will specify a URL in a web browser's address bar
 The web browser will then obtain the IP address of the domain name -- either
translating the URL through DNS (Domain Name System) or by searching in its
cache
 This will bring the browser to a web server. The browser will then request the
specific file from the web server by an HTTP request
 The web server will respond, sending the browser the requested page, again,
through HTTP
22/12/202 R. N. G, Patel Institute of Technolo 36
4 gy
WEB SERVER (CONTD.)
 If the requested page does not exist or if something goes wrong, the web server
will respond with an error message

Assistant Prof. Purvaj Piyush Vaidya


 The browser will then be able to display the webpage
 Multiple domains also can be hosted on one web server

 Examples
 Web servers often come as part of a larger package of internet- and intranet-
related programs that are used for:
 sending and receiving emails;
 downloading requests for File Transfer Protocol (FTP) files; and
 building and publishing webpages

22/12/202 R. N. G, Patel Institute of Technolo 37


4 gy
WEB SERVER (CONTD.)
 Goals
 Uptime: This refers to the time a web server is online and operational. Websites

Assistant Prof. Purvaj Piyush Vaidya


need to be always online to serve users, so a high uptime is the goal
 Speed: Your web pages should load as fast as possible. Users want their request
fulfilled immediately, otherwise you risk losing them
 Concurrency: This refers to the handling of multiple requests coming in at the
same time.
 Scalability: Scalability refers to either making your existing servers more
powerful through vertical scaling or adding more servers to your setup through
horizontal scaling.
 Ease of set up: Getting a project up and running quickly is key to the iteration
of your project

22/12/202 R. N. G, Patel Institute of Technolo 38


4 gy
WEB SERVER (CONTD.)
 Documentation: Web servers are complex. The most common setups will get
you on your feet quickly, but your needs will grow over time

Assistant Prof. Purvaj Piyush Vaidya


 Developer support: If the core developers are not committed to their own
project, you shouldn’t commit your project to theirs
 Community support: A core development team will handle most of the heavy
lifting, but a thriving community contributes to filling in the gaps

22/12/202 R. N. G, Patel Institute of Technolo 39


4 gy
WEB SERVER (CONTD.)
 Installation and Configuration
 Apache HTTP Server

Assistant Prof. Purvaj Piyush Vaidya


 Apache is one of the most popular web servers. It’s open-source and
commonly used with Linux distributions.
 Installation:

22/12/202 R. N. G, Patel Institute of Technolo 40


4 gy
WEB SERVER (CONTD.)

Assistant Prof. Purvaj Piyush Vaidya


22/12/202 R. N. G, Patel Institute of Technolo 41
4 gy
WEB SERVER (CONTD.)
 Configuration:
 The main configuration file for Apache on Linux is located at

Assistant Prof. Purvaj Piyush Vaidya


/etc/apache2/apache2.conf (for Debian/Ubuntu) or /etc/httpd/httpd.conf
(for CentOS/RHEL).
 Virtual Hosts: You can configure multiple domains or websites on the
same server by setting up virtual hosts. Example configuration for a
virtual host (Debian/Ubuntu):

22/12/202 R. N. G, Patel Institute of Technolo 42


4 gy
WEB SERVER (CONTD.)

Assistant Prof. Purvaj Piyush Vaidya


22/12/202 R. N. G, Patel Institute of Technolo 43
4 gy
WEB SERVER (CONTD.)
 Nginx
 Nginx is known for its performance and low resource usage. It’s commonly

Assistant Prof. Purvaj Piyush Vaidya


used as a reverse proxy and load balancer.
 Installation:

22/12/202 R. N. G, Patel Institute of Technolo 44


4 gy
WEB SERVER (CONTD.)
 Configuration:
 The main configuration file is located at /etc/nginx/nginx.conf.

Assistant Prof. Purvaj Piyush Vaidya


 Server Blocks: Similar to Apache virtual hosts, Nginx uses server blocks to
host multiple websites. Example server block configuration:

22/12/202 R. N. G, Patel Institute of Technolo 45


4 gy
WEB SERVER (CONTD.)

Assistant Prof. Purvaj Piyush Vaidya


22/12/202 R. N. G, Patel Institute of Technolo 46
4 gy
WEB SERVER (CONTD.)
 Microsoft IIS (Internet Information Services)
 IIS is a web server developed by Microsoft and is integrated with Windows

Assistant Prof. Purvaj Piyush Vaidya


Server.
 Installation:
 Windows Server:
 Open the Server Manager.
 Select Add Roles and Features.
 Choose Web Server (IIS) from the list and proceed with the installation.
 Windows 10/11:
 Open the Control Panel.
 Go to Programs and Features, and select Turn Windows features on or
off.
 Check Internet Information Services and install.

22/12/202 R. N. G, Patel Institute of Technolo 47


4 gy
WEB SERVER (CONTD.)
 Configuration:
 Once installed, open the IIS Manager.

Assistant Prof. Purvaj Piyush Vaidya


 To configure a new website:
 Right-click Sites > Add Website.
 Specify the site's name, physical path (where your website files are
stored), and binding information (IP address, port, and domain name).
 Set up bindings for HTTP and HTTPS if needed.
 Save the settings and start the website.

22/12/202 R. N. G, Patel Institute of Technolo 48


4 gy
WEB SERVER (CONTD.)
 Additional Considerations
 Firewall Configuration: Ensure that your web server’s port (usually 80 for

Assistant Prof. Purvaj Piyush Vaidya


HTTP and 443 for HTTPS) is open on your firewall.

22/12/202 R. N. G, Patel Institute of Technolo 49


4 gy
WEB SERVER (CONTD.)
 SSL/TLS Configuration
 For securing your web server with HTTPS, you will need to install SSL/TLS

Assistant Prof. Purvaj Piyush Vaidya


certificates.

22/12/202 R. N. G, Patel Institute of Technolo 50


4 gy
WEB SERVER (CONTD.)
 Testing the Installation:
 After configuration, you can test your setup by accessing the IP address or

Assistant Prof. Purvaj Piyush Vaidya


domain name in a web browser.
 You can check if your server is running properly:

22/12/202 R. N. G, Patel Institute of Technolo 51


4 gy
WEB SERVER (CONTD.)
 Move sensor’s data to a web server:
 Moving sensor data to a web server involves gathering data from a sensor,

Assistant Prof. Purvaj Piyush Vaidya


transferring it to a server, and making it accessible (either for storage, real-time
monitoring, or further processing)
 The process generally includes multiple stages: acquiring the data, transmitting it
securely, and storing it on the server. Here's a breakdown of the process:
 Data Acquisition from Sensors
 The first step is to read data from the sensors. Sensors could be used for
monitoring various parameters like temperature, humidity, motion, etc.
 Common Types of Sensors: Temperature sensors, humidity sensors, GPS
sensors, motion sensors, etc.
 Connection Protocols: Sensors might use protocols such as I2C, SPI, UART, or
GPIO to communicate with microcontrollers or computing devices like
Raspberry Pi, Arduino, or other IoT platforms.

22/12/202 R. N. G, Patel Institute of Technolo 52


4 gy
WEB SERVER (CONTD.)
 Microcontroller or Data Logger
 Most sensors are connected to a microcontroller (like an Arduino, ESP32, or

Assistant Prof. Purvaj Piyush Vaidya


Raspberry Pi) or a data logger that acts as an interface between the sensor
and the server. The microcontroller reads data from the sensor and often
processes it before sending it to the server.

22/12/202 R. N. G, Patel Institute of Technolo 53


4 gy
WEB SERVER (CONTD.)
 Data Format and Processing
 Once the data is collected from the sensors, it is usually processed and

Assistant Prof. Purvaj Piyush Vaidya


formatted before sending it to the server. Common data formats for
transmission include:
 JSON (JavaScript Object Notation):
 Example: {"temperature": 25.5, "humidity": 60}
 XML (Extensible Markup Language):
 Example:
<sensor><temperature>25.5</temperature><humidity>60</humidit
y></sensor>
 CSV (Comma Separated Values):
 Example: 25.5,60
 The microcontroller can structure the data in a format suitable for
transmission.
22/12/202 R. N. G, Patel Institute of Technolo 54
4 gy
WEB SERVER (CONTD.)
 Data Transmission (Wired/Wireless Communication)
 The data must then be transferred from the microcontroller or sensor device

Assistant Prof. Purvaj Piyush Vaidya


to the web server. The communication can be done using different methods:
 Wired Transmission:
 Ethernet: If the device is connected via Ethernet, you can send the data
directly over TCP/IP using HTTP or other protocols.

22/12/202 R. N. G, Patel Institute of Technolo 55


4 gy
WEB SERVER (CONTD.)
 Wireless Transmission:
 Wi-Fi: Devices like the ESP8266 or ESP32 come with Wi-Fi modules,

Assistant Prof. Purvaj Piyush Vaidya


allowing them to send data to a web server.
 Cellular (GSM/4G/LTE): In areas with no Wi-Fi, cellular modules (like
SIM800 or GSM modules) can be used to send data to the server.
 LoRaWAN, Sigfox, or Zigbee: For low-power, long-range
communication, protocols like LoRaWAN or Sigfox can be used, but
these often require specific gateways.

22/12/202 R. N. G, Patel Institute of Technolo 56


4 gy
WEB SERVER (CONTD.)
 Data Transfer Protocols
 Several protocols can be used to transfer data to the web server depending

Assistant Prof. Purvaj Piyush Vaidya


on the application, reliability, and security needs:
 HTTP/HTTPS
 The most common way to send sensor data to a web server is via HTTP
POST requests.

22/12/202 R. N. G, Patel Institute of Technolo 57


4 gy
WEB SERVER (CONTD.)
 MQTT (Message Queuing Telemetry Transport)
 MQTT is a lightweight, publish-subscribe protocol ideal for IoT devices.

Assistant Prof. Purvaj Piyush Vaidya


 Sensor data can be published to an MQTT broker, which then sends it to
the web server (subscriber).

22/12/202 R. N. G, Patel Institute of Technolo 58


4 gy
WEB SERVER (CONTD.)
 WebSocket
 For real-time communication between sensors and web servers,

Assistant Prof. Purvaj Piyush Vaidya


WebSocket can be used. WebSockets keep a constant connection open,
allowing immediate two-way communication.

22/12/202 R. N. G, Patel Institute of Technolo 59


4 gy
WEB SERVER (CONTD.)
 Data Reception on the Web Server
 Once the sensor data is transmitted, the web server receives and processes

Assistant Prof. Purvaj Piyush Vaidya


it. Several backend technologies can be used to handle sensor data:

22/12/202 R. N. G, Patel Institute of Technolo 60


4 gy
WEB SERVER (CONTD.)

Assistant Prof. Purvaj Piyush Vaidya


22/12/202 R. N. G, Patel Institute of Technolo 61
4 gy
WEB SERVER (CONTD.)

Assistant Prof. Purvaj Piyush Vaidya


22/12/202 R. N. G, Patel Institute of Technolo 62
4 gy
WEB SERVER (CONTD.)
 Database Storage
 Once the web server receives the data, it can be stored in a database for

Assistant Prof. Purvaj Piyush Vaidya


future analysis. Common databases include:

22/12/202 R. N. G, Patel Institute of Technolo 63


4 gy
WEB SERVER (CONTD.)
 Visualization and Monitoring
 After storing the data, it can be visualized using dashboards or monitoring

Assistant Prof. Purvaj Piyush Vaidya


tools:
 Grafana: For real-time monitoring of sensor data.
 Custom Web Dashboards: Using front-end technologies like HTML, CSS,
JavaScript, or frameworks like React or Angular to build interactive
dashboards.
 Security Considerations
 Data Encryption: Use HTTPS, SSL/TLS to secure data during transmission.
 Authentication: Use tokens or API keys to verify the source of the sensor
data.
 Firewall: Protect the web server with firewall rules, allowing traffic only
from trusted sources.

22/12/202 R. N. G, Patel Institute of Technolo 64


4 gy
WEB SERVER (CONTD.)
 Testing and Debugging
 Use tools like Postman or curl to test the API or endpoint receiving sensor

Assistant Prof. Purvaj Piyush Vaidya


data.
 Simulate data transmission before integrating actual sensor hardware.

22/12/202 R. N. G, Patel Institute of Technolo 65


4 gy

You might also like