SlideShare a Scribd company logo
TWO MONTHS INDUSTRIAL TRAINING
REPORT
HELD AT
BACHELORS OF TECHNOLOGY
(ECE ENGINEERING)
SUBMITTED BY
Lovish Kumar - (1701431)
Bharti Bhagat - (1701424)
Parampreet Kaur - (1701435)
Soma Biswas - (1701444)
AMRITSAR COLLEGE OF ENGINEERING AND TECHNOLOGY,
AMRITSAR, PUNJAB
BATCH (2017-2021)
CANDIDATE'S DECLARATION CERTIFICATE
I hereby certify that the work which is being presented in the report entitled “ IOT with Python” by “Lovish
Kumar, Bharti Bhagat, Parampreet Kaur, Soma Biswas” in partial fulfillment of requirements for the
award of degree of B.Tech. (ECE) submitted to I.K.G. Punjab Technical University, Department of ECE at
Amritsar College of Engineering and Technology, Amritsar under I.K.G. PUNJAB TECHNICAL UNIVERSITY,
JALANDHAR is an authentic record of my own work carried out during a period from 3-june-2019 to 25-july-
2019 under the supervision of Mr. Rohit Khosla.
Signature of the Student
Lovish Kumar
Bharti Bhagat
Parampreet Kaur
Soma Biswas
ACKNOWLEDGMENT:
I am highly grateful to the ER. Gurjeet Singh, HOD ECE, Amritsar College of Engineering & Technology,
Amritsar, for providing this opportunity to carry out the two months industrial training at NETMAX, Chandigarh.
I would like to expresses my gratitude to other faculty members of ECE Engineering Department of ACET,
Amritsar for providing academic inputs, guidance & encouragement throughout the training period.
The author would like to express a deep sense of gratitude and thank Mr. Rohit Khosla Director/ Incharge of
Company, without whose permission, wise counsel and able guidance, it would have not been possible to pursue
my training in this manner.
The help rendered by Mr. RANJIT SINGH, Supervisor Mr. SHUKLA for experimentation is greatly
acknowledged.
Finally, I express my indebtedness to all who have directly or indirectly contributed to the successful completion
of my industrial training.
Name of Candidate
Lovish Kumar
Bharti Bhagat
Parampreet Kaur
Soma Biswas
INDUSTRIAL TRAINING REPORT
IOT WITH RASPBERRY PI
SUBMITTED TO: SUBMITTED BY:
ER. ROHIT KHOSLA (DIRECTOR)
BHARTI BHAGAT
LOVISH KUMAR
PARAMPREET KAUR
SOMA BISWAS
INDEX
S.NO. TOPIC PAGE NO.
1. INTRODUCTION 1-13
2. LINUX – ITS INTRODUCTION AND IMPORTANT
COMMANDS and UBUNTU
14-17
3. INTRODUCTION TO NETWORKING BASICS 18-20
4. INTRODUCTION TO RASPBERRY PI AND
ITSMODELS
21-24S
5. INSTALLATION OF OPERATING SYSTEM OF
RASPBERRY PI
25-28
6. CONFIGURING RASPBERRY PI 29-30
7. RASPBERRY PI WEBCAM SERVER USING
MOTION
31-33
8. HOTSPOT 34-38
9. WINSCP
AND PUTTY
39-42
10. SECURE SHELL (SSH) 43-46
11. INTRODUCTION TO GPIO AND PHYSICAL
COMPUTING ON RASPBERRY PI
47-57
12.
PYTHON INTRODUCTION AND SUBLIME TEXT
58-67
13. PWM 68-74
14. SENSORS 75-80
15. GOOGLE SPREADSHEET 81-86
16. MY DEVICES 87-95
17. UBIDOTS 106-107
18. PARTICLE.IO
IFTTT
108-126
19. NODE MCU AND ADAFRUIT.IO 127-144
1.ABOUT INTERNET OF THINGS (IOT)

The internet of things, or IoT, is a system of interrelated computing devices, mechanical and digital
machines, objects, animals or people that are provided with unique identifiers ( UIDs ) and the ability to
transfer data over a network without requiring human-to-human or human-to-computer interaction.
A thing in the internet of things can be a person with a heart monitor implant, a farm animal with a biochip
transponder, an automobile that has built-in sensors to alert the driver when tire pressure is low or any
other natural or man-made object that can be assigned an IP address and is able to transfer data over a
network .Increasingly, organizations in a variety of industries are using IoT to operate more efficiently,
better understand customers to deliver enhanced customer service, improve decision-making and increase
the value of the business.
1. BENEFITS OF IOT
The internet of things offers a number of benefits to organizations, enabling them to:
 monitor their overall business processes;
 improve the customer experience;
 save time and money;
 enhance employee productivity;
 integrate and adapt business models;
 make better business decisions; and
 generate more revenue.
IoT encourages companies to rethink the ways they approach their businesses, industriesand markets and
gives them the tools to improve their business strategies.
(ii) CLOUD COMPUTING
Cloud computing is a general term for anything that involves
delivering hosted services over the Internet. These services are
broadly divided into three categories: Infrastructure-as-a-Service
(IaaS), Platform-as-a-Service (PaaS) and Software-as-a-Service
(SaaS). The name cloud computing was inspired by the cloud
symbol that'soften usedto representthe Internet in flowchartsand
diagrams. A cloud service has three distinct characteristics that
differentiate it from traditional web hosting. It is sold on demand, typically by the minute or the hour; it is
elastic -- a user can have as much or as little of a service as they want at any given time; and the service is
fully managed by the provider (the consumer needs nothing but a personal computer and Internet access).
Significant innovations in virtualization and distributed computing, as well as improved access to high-
speedInternet, have acceleratedinterest in cloudcomputing. A cloud canbe private orpublic. A public cloud
sells services to anyone on the Internet. (Currently, Amazon Web Services is the largest public cloud
provider.)A private cloudis aproprietarynetwork ora datacenter that supplies hosted services to a limited
number of people. Private or public, the goal of cloud computing is to provide easy, scalable access to
computing resources a nd IT services.
(III) Virtualization, VMWare and How To Use And Install
VMWare
VMwareWorkstation is a programthat allows youto run a virtual computer within yourphysical computer.
The virtual computer runs as if it was its own machine. A virtual machine is great for trying out new
operating systems such as Linux, visiting websites you don't trust, creating a computing environment
specifically forchildren, testing the effectsofcomputer viruses, andmuch more. Youcan evenprint and plug
in USB drives. Read this guide to get the most out of VMware Workstation.
1.Requirements For The VMware
(i)
(ii)
(iii) 2.Download the VMware Software
(i)
In
computing, virtualization re
fers to the act of creating a virtual
(rather than actual) version of
something, including virtual
computer hardware platforms,
storage devices, and computer
network resources.
VMware, Inc. is a subsidiary of Dell
Technologies.VMware, a global leader in
cloud infrastructure & digital workspace
technology, accelerates digital
transformation for evolving IT
environments.
3. Installing The VMware
(i)open VMware
(II) Click on File On top and then Create a New
Virtual Machine
(III) Enter Details for The Operating System (iv) Name your Virtual Machine
(v) Set the Disk Size
(vii) Power ON your Virtual Machine
(vi) Customise your virtual machine’s hardware
(IV) ISO Files
File Systems:
ISO file, which is also known as a disc image, has .iso file
extension. It contains a copy of the entire CD/DVD from
which it was extracted. It means when you burn an ISO file
to a blank disc, you’ll get the same files, folders, and
properties as the original disc.
ISO files are used to distribute disc images. For example, iso
files for operating systems.
like Ubuntu (Linux distro) could be downloaded from the
net and then burn to a CD to create a bootable operating
system disc.
In this section, it is important to differentiate between the FAT file system and the file allocation table
(FAT).
FAT is the nameofthe file system usedby DOSoperating systems(DOS and Windows95, aswell asWindows
NT and OS/2, which support it).
FAT file systems are characterized by the use of a file allocation table and clusters (or blocks).
Clusters are the smallest unit of
storage in a FAT file system. A cluster
actually represents a fixed number of disk
sectors.
The FAT (File Allocation Table) is
the heart of the file system. It is locatedin
sector 2 of cylinder 0, head 1 (and is
duplicated in another sectoras aprecaution
in the event of an accident). This table records the numbers of the clusters that are used and where the files
are located in the clusters.
The FAT file system supportsdisks orpartitionsup to a maximum size of2GBbut only allows at most65,536
clusters. So, whatever the size of the partition or disk, there must be enough sectors per cluster so that the
entire disk space can be contained in these 65,525 clusters. As a result, the larger the disk (or partition), the
greater the number of sectors per cluster.
The FAT file system uses a root directory (represented on the operating systems that use this type of file
system by the symbol C:), which must be located at a specific location on the hard drive. This root directory
stores information on the sub-directories and files that it contains. For a file, it will store the file name, the
file size, the date and time the file was last modified, the file attributes, and the cluster number at which the
file starts.
USING MULTIPLE PARTITIONS
As mentioned before, there are three types of partitions: primary partitions, extended partitions and logical
drives. A disk may contain up to four primary partitions (only one of which can be active), or three primary
partitions and oneextendedpartition. In the extendedpartition, the usercancreate logical drives (i.e. create
the impression that there are several smaller-sized hard drives).
PRIMARY PARTITIONS
A primary partition must be logically formatted and have a file system appropriate to the operating system
installed on it.
If you have several primary partitions on your disk, only one will be active and visible at a time, depending
on the operating system with which you started the computer. By choosing which operating to load at start-
Operating system Associated file system
DOS FAT16
Windows XP NTFS
Windows 98 FAT32
Windows 95 FAT16 - FAT32 (for version OSR2)
Windows NT NTFS
OS/2 HPFS
Linux Linux Ext2, Linux Ext3
up, you determine which partition will be visible. The active partition is the partition from which one of
the operating systems was loaded when the computer was started up. The partitions, other than the one
from which you started, will then be hidden, which will prevent their data from being accessible. The data
on a primary partition are therefore only accessible from the operating system installed on that partition.
Extended partition
Extended partitions were developed to overcome the
limit of four primary partitions, as you can create as
many logical drives as you want in them. At least one
logical drive is required in an extended partition, as
you cannot store data in them directly.
Many machines are formatted with one large
partition using up all available space on the drive.
This is not, however, the most advantageous solution
in terms of performance and capacity. The solution is
to create several partitions, which will allow you to install several operating systems on your disk, save disk
space, increase file security, and organize your data more easily.
(vi)How to enter BIOS configuration
1. Hold and press [Shift] then turn off the system.
2. Press and hold the F2 button then click the power button. DO NOT RELEASE the
F2 button until the BIOS screen
display.
3. You can find the BIOS configuration.
2. Linux, Some of its important
commands and Ubuntu.
(i) Linux is a family of free and open-source
software operating systems built around the Linux kernel.
Typically, Linux is packaged in a form known as a Linux
distribution (or distro for short) for both desktop and server use.
The defining component of a Linux distribution is the Linux
kernel,[11] an operating system kernel first released on September
17, 1991, by Linus Torvalds.[12][13][14] Many Linux distributions use
the word "Linux" in their name. The Free Software Foundation uses
the name GNU/Linux to refer to the operating system family, as well
as specific distributions, to
emphasize that most Linux
distributions are not just the
Linux kernel, and that they have
in common not only the kernel,
but also numerous
utilities and libraries, a
large proportion of
which are from the
GNU project. This has
led to
some controversy.[15][16]
Linux was originally developed for personal
computers based on the Intel x86 architecture, but has since been ported to more platforms than any other
operating system. Because of the dominance of the Linux kernel-based Android OS on smartphones, Linux
hasthe largest installed base ofall general-purposeoperatingsystems.[18] Linuxisalso the leading operating
system on servers and other big iron systems such as mainframe computers, and the only OS used
on TOP500 supercomputers (since November 2017, having before gradually eliminated all competitors). It
is used by around 2.3% of desktop computers. The Chromebook, which runs the Linux kernel-
based Chrome OS, dominates the US K–12 education market and represents nearly 20% of the sub-
$300 notebook salesin the US. Linuxalso runson embeddedsystems, i.e. devices whose operatingsystem is
typically built into the firmware and is highly tailored to the system. This includes TiVo and
similar DVR devices, network routers, facility automation controls, televisions, video game
consoles and smartwatches. Many smartphones and tablet computers run Android and other Linux
derivatives.
The development of Linux is one of the most prominent examples of free and open-
source software collaboration. The underlying source code may be used, modified and distributed—
commercially or non-commercially—by anyone under the terms of its respective licenses, such as the GNU
General Public License.
(ii) Some important Linux commands:
S.NO. COMMAND ITS FUNCTION
1. Sudo su - Sudo first asks for your
password and if it is provided it
runds the next command as a
root user and a root user in
linux system has the maximum
permissions and can do
anything to the system.
2. init 0 To shutdown
3. init 6 To restart
4. apt-get install To install new packages
5. apt-cache search<term> To search for packages
6. ps –A
ps –A |grep <name>
To kill the process of given
name
7. apt-get purge libappstream 3 If there is any error in apt-get
command
8. apt-get update Its only update the installed
packages
9. Apt-get purge<name> It removes all the traces of
given name
10. Clear It clears the terminal screen
Some of the most popular and mainstream Linux distributions are Arch
Linux, CentOS, Debian, Fedora, Gentoo Linux, Linux Mint, Mageia, openSUSE and Ubuntu, together with
commercial distributions such as Red Hat Enterprise Linux and SUSE Linux Enterprise Server. Distributions
include the Linux kernel, supporting utilities and libraries, many of which are provided by the GNU Project,
and usually a large amount of application software to fulfil the distribution's intended use. Desktop Linux
distributions include a windowing system, such as X11, Mir or a Wayland implementation, and an
accompanying desktop environment such as GNOME or KDE Plasma; some distributions may also include a
less resource-intensive desktop, such as LXDE or Xfce. Distributions intended to run on servers may omit all
graphical environments from the standard install, and instead include other software to set up and operate
a solution stack such as LAMP. Because Linux is freely redistributable, anyone may create a distribution for
any intended use.
---- Open A Linux Terminal Using Ctrl + Alt + T
(iii) Ubuntu:
Ubuntu is a complete Linux operating
system, freely available with both
community and professional support.
The Ubuntu community is built on the
ideas enshrined in the Ubuntu
Manifesto: that software should be
available free of charge, that software
tools should be usable by people in their
local language and despite any
disabilities, and that people should have
the freedom to customize and alter their
software in whatever way they see fit.
 Ubuntu will always be free of
charge, and there is no extra fee
for the “enterprise edition”, we make our very best work available to everyone on the same
Free terms.
 Ubuntu includes the very best in translations and accessibility infrastructure that the Free
Software community has to offer, to make Ubuntu usable by as many people as possible.
 Ubuntu is shipped in stable and regular release cycles; a new release will be shipped every
six months. You can use the current stable release or the current development release. A
release will be supported for 18 months.
 Ubuntu is entirely committed to the principles of open source software development; we
encourage people to use open source softw are, improve it and pass it on.
3. Some Basic Networking Concepts
IP addressa unique string of numbers separated by
full stops that identifies each computer using the Internet
Protocol to communicate over a network.
4. RaspberryPi and Its Various Models
The Raspberry Pi is a series of small single-board ultimate and affordable computers. It is an ultra-low-
cost ($20-$35) credit-card sized Linux computer. It may be operated with any generic USB computer
keyboard and mouse. It may also be used with USB storage, USB to MIDI converters, and virtually any
other device/component with USB capabilities. Other peripherals can be attached through the various pins
and connectors on the surface of the Raspberry Pi.
Addressing
Internet address Consists of 4 bytes separated by periods
Example: 136.102.233.49
-The R first bytes (R= 1,2,3) correspond to the network
address;
-The remaining H bytes (H = 3,2,1) are used for the host
machine.
-InterNIC Register: organizationin chargeoftheallocation
of the address ranges corresponding to networks.
-Criteria considered: → Geographical area (country) →
Organization, enterprise → Department → Host Domain
Name System (DNS)
-Mnemonic textual addressesareprovidedto facilitate the
manipulation of internet addresses. -DNS servers are
responsible for translating mnemonic textual Internet
addresses into hard numeric Internet addresses. 4 Ports
-An IP address identifies a host machine on the Internet.
-An IP port will identify a specific application running on
an Internet host machine.
-A port is identified by a number, the port number.
-The number of ports is not functionally limited, in
contrast to serial communications where only 4 ports are
allowed.
-There are some port numbers which are dedicated for
specific applications.
APPLICATIONS PORT NUMBER
HTTP 80
FTP 20 and 21
Gopher 70
SMTP (e-mail) 25
POP3 (e-mail) 110
Telnet 23
Introduction
-A network can be defined as a group of
computers and other devices connected
in some ways so as to be able to
exchange data.
-Each of the devices on the network can
be thought of as a node; each node has a
unique address. -Addresses are numeric
quantities that are easy for computers
to work with, but not for humans to
remember. Example: 204.160.241.98
-Some networks also provide names
that humans can more easily remember
than n
umbers. Example: www.javasoft.com,
corresponding to the above numeric
address. NIC addr1 NIC addrN NIC
addr2 …
Raspberry pi 3
model B
Raspberry pi 2
model B
Raspberry
pi- model B+
Raspberry
pi- model A+
Ethernet Port Yes Yes Yes No
GPU Videocore IV Videocore IV Videocore IV Videocore IV
Processor Speed 1.2GHz Quad-core
processor
900MHz Quad core
processor
700MHz Single
core processor
700MHz Single
core processor
Wi-Fi Built-in No No No
Bluetooth LE Built in No No No
Storage Micro SD Micro SD Micro SD Micro SD
Processor Chipset
RAM 1 GB SDRAM of
400MHz
1 GB SDRAM of
400MHz
512 MB SDRAM
of 400MHz
256 MB SDRAM
of 400MHz
GPIO 40 Pin 40 Pin 40 Pin 40 Pin
USB 2.0 4 x USB Port 4 x USB Port 4 x USB Port 1 x USB Port
Maximum power
draw/voltage
The maximum
power is about 2.5A
and voltage is 5V
The maximum
power is 1.8A and
voltage is about 5V.
The maximum
power is 1.8A and
voltage is about 5V.
The maximum
power is 1.8A and
voltage is about 5V.
Different Types of Raspberry Pi Models.
The different types of raspberry pi models are following:
 Raspberry Pi 1 model B
 Raspberry Pi 1 model A
 Raspberry Pi 1 model B+
 Raspberry Pi 1model A+
 Raspberry Pi Zero
 Raspberry Pi 2
 Raspberry Pi 3 model B
 Raspberry Pi Zero W
Raspberry Pi 1 model B+
This model B+ is replaced in the place of raspberry pi model B in the year 2014. Model B+ Rpi is compared
with the model B it has.
Raspberry Pi 1 model B+
More GPIO: The GPIO model B+ has 40 pins while retaining the same pinout for the first 26 pins as the
Model A and B.
More USB: It has 4 USB 2.0 ports, compared to 2 on the Model B, and better hotplug and overcurrent
behavior.
Micro SD: The old friction-fit SD card socket has been replaced with a much nicer push-push micro SD
version.
Lower Power Consumption: In thelow powerconsumption thelinear regulatorsarereplacedby switching
one and it will reduce the power consumption by between 0.5W and 1W.
Better Audio: The audio circuit has a dedicated low-noise power supply.
Neater Form Factor: With the broad edges the USB connections are arranged and the video is moved
composite with the 3.5mm jack. There are four squarely-placed maintaining holes.
Raspberry Pi Zero:
It is ahalf size of the modelA+ with twice a utility andforany project, it has the samespecification like 1GHz,
Single-core CPU, 512MBRAM, Mini-HDMI port, Micro-USB OTG port, Micro-USB power,HAT-compatible 40-
pin header, Composite video and reset headers, CSI camera connector (v1.3 only). The following image
shows the raspberry pi zero.
Raspberry Pi Zero
Raspberry Pi 2:
The basic image of the raspberry pi 2 is following and the features of the raspberry pi 2 are it has quad-core
ARM cortex-A7 processor with a 900MHz, the SDRAM is about the 1GB. It is completely compatible with the
raspberry pi 1.
Raspberry Pi 2
Raspberry Pi Model B
It is a higher-spec variant of raspberry pi. After this design of this raspberry pi, it has extended to the next
model i.e. raspberry pi 2. The specifications of the raspberry pi model B are following, the raspberry pi
model B has two USB ports, having a RAM of 512MB and
its Ethernet port is 100mb. The basic image of the
raspberry pi model is shown in the following.
Raspberry pi model B
5. Installation of operating system of raspberry pi
The Foundation provides Raspbian, a Debian-based Linux distribution for download, as well as third party Ubuntu,
Windows 10 IOT Core, RISC OS, and specialized media center distributions. It promotes Python and Scratch as
the main programming language, with support for many other languages.
If you order a Raspberry Pi without an SD
card preloaded with New Out of Box
Software (NOOBS), you will need to
provide your own SD card and manually
install an operating system. There are
two ways to install Raspberry Pi:
● Noobs
● Raspbian
Raspbian is the foundation’s
official supported Operating System
based on Debian. You can install it with
NOOBS that is an easy installer for
Raspbian or can download it from
the image by following the installation
guide.
(i)INSTALLING OPERATING SYSTEM WITH NOOBS:
New Out of Box Software (NOOBS) is an easy operating system installation manager for Raspberry Pi.
HOW TO GET NOOBS:
➢ Buy a pre-installed SD card-
SD cards with NOOBS preinstalled are available from many of our distributors and independent retailers,
including Pimoroni, Adafruit, and Pi Hut.
➢ Download-
Alternatively, NOOBS is available for download on the Raspberry Pi website:raspberrypi.org/downloads
● NOOBS is an easy operating system installer which contains Raspbian. It also provides a selection of
alternative operating systems which are then downloaded from the internet and installed.
● NOOBS Lite contains the same operating system installer without Raspbian pre-loaded. It provides the
same operating system selection menu allowing Raspbian and other images to be downloaded and
installed.
LATEST NOOBS RELEASE:
The latest NOOBS release is v2.4.0,
released on 10th April 2017.
HOW TO FORMAT AN SD CARD:
For Windows users, it is recommended
to format the SD card using the SD
Formatter Tool. You will need to set
"FORMAT SIZE ADJUSTMENT"
option to "ON" in the "Options" menu
to ensure that the entire SD card volume
is formatted, and not just a single
partition. The updated size will be
shown after the format is complete.
WRITING NOOBS TO AN SD
CARD:
Once you've downloaded the NOOBS
zip file, you'll need to copy the contents to a formatted SD card on your computer. To set up a blank SD card with
NOOBS:
1. Format an SD card.
2. Download and extract the files from the NOOBS zip file.
3. Copy the extracted files onto the SD card that you just formatted, so that this file is at the root directory of
the SD card. Please note that in some cases it may extract the files into a folder; if this is the case, then
please copy across the files from inside the folder rather than the folder itself.
4. On first boot, the "RECOVERY" FAT partition will be automatically resized to a minimum, and a list of
OSes that are available to install will be displayed.
WHAT’S INCLUDED IN NOOBS:
The following operating systems are currently included in NOOBS:
➢ Raspbian
➢ Pidora
➢ LibreELEC
➢ OSMC
➢ RISC OS
➢ Arch Linux
As of NOOBS v1.3.10 (September 2014), only Raspbian is installed by default in NOOBS. The others can be
installed with a network connection.
BOOTING FROM NOOBS AND INSTALLING RASPBIAN:
Once the files have been copied over, insert the microSD card into your Raspberry Pi and then plug it into a power
source. Connect the converter (HDMI to VJ) to it. A keyboard and mouse will be required to install an OS with
NOOBS, as will a HDMI display. Raspberry Pi is connected to the Internet via Ethernet. You will be provided
with a single option, once the installer has loaded. Now Reboot the raspberry pi and a Window appears as follows-
You should check the box for Raspbian, and then click Install.
6.Configuring Raspberry Pi
● COMMAND LINE METHOD: Raspi-config is the Raspberry Pi configuration tool that targets Raspbian.
It aims to provide the functionality to make the most common configuration changes. This may result in
automated edits to /boot/config.txt and various
standard Linux configuration files. Some options require a reboot to take effect. If you changed any of
those, raspi-config will ask if you wish to reboot now when you select the <Finish> button.
7.RASPBERRY PI WEBCAM SERVER USING MOTION
The Raspberry Pi is perfectly equipped to turn your USB based web cam into a fully functional IP web cam.This
will allow you to create a webcam for your Raspberry Pi so that you can view it from any computer on the local
network.
COMPONENTS REQUIRED:
➢ Raspberry Pi with an Wheezy Raspbian installed and internet connection established.
➢ Webcam-
● PS3 Eye Camera
● Microsoft HD
➢ USB Powered Hub –We need a hub because the camera’s draw more power than the Raspberry pi
4. -
●Use ifconfig command. eth0 is used for the attached ethernet cable.
> ifconfig eth0
●If the above command doesn’t provide a valid IP then use ifdown to turn net off and ifup to turn it back on.
To restart eth0:
> ifdown eth0
> ifup eth0
> Ifconfig eth0
5. Connect to Your Pi by SSH Connection (PUTTY). Open up Putty and type in the IP address of your Pi and
connect.'pi' & 'raspberry' is the default 'login as' and 'password' in Raspbian.
HOW TO SETUP A RASPBERRY PI-WEBCAM SERVER:
1. Connect the USB camera to any one of the four available USB port.
2. Connect the ethernet cable aka LAN cable to your Pi and connect the other end to your router. Then
Power Up the Raspberry Pi.
3. Know Your Raspberry Pi IP Address. To view it
6. It is always a good practice to update and upgrade the system as soon as you log in.To do it, enter in the
commands-
> sudo apt-get update
> sudo apt-get upgrade
7. Now, we need to install the software, we are using a great little application called Motion, this will do a
few things including accessing the USB cam, getting the images, and streaming them via a built in web
server. As the name suggests it will also track and trigger events on motion been detected in the video
frames. For installation, enter the following-
> sudo apt-get install motion
This will take a few minutes to download and install but once it has finished and takes you back to the
command prompt we are ready to continue.
8. Now to make sure that the camera is correctly detected. Type in the command 'lsusb' and enter. You should
see the name of your camera.
But this will not exactly tell u that the camera is there so u have to go to
> /dev/ type ls to check /dev/video0 or 1 or x present.
Next we need to edit some of the configuration files so that the motion service will start on run up and be
available on local network. First we will edit motion.conf file by-
> sudo nano /etc/motion/motion.conf
Then you have to change some settings in the .conf file. It might be difficult sometimes to find the settings
but use 'ctrl + w' (Search) to find it. So follow the steps:
○ Make sure 'daemon' is ON.
○ Setup_mode OFF.
○ Set 'width' & 'height' to 640 &
480.
○ Set 'framerate' anywhere in
between 15 to 30.
○ Auto_brightness ON.
○ Keep 'Stream_port' to 8081.
○ 'Stream_quality' should be 70.
○ 'Stream_localhost' to OFF.
○ 'Webcontrol_localhost' to
OFF.
○ Set 'quality' to 80.
○ Set 'post_capture' to 5.
○ Press ctrl + x to exit. Type y to
save and enter to confirm.
To ensure that the motion service
will actually start as a daemon we need to change another configuration setting, so enter the following:
> sudo nano /etc/default/motion
Set ' start_motion_daemon ' to yes. Save and exit.
9. Now make sure the camera is connected and run the following line:
> sudo service motion start
10.If you need to stop the service, simply run the following command:
> sudo service motion stop
If the webpage isn’t loading try restarting the service.To do it enter-
> sudo service motion start
To make your server ready, enter the command-
> sudo motion
11.With the service started you can now open a webpage on your normal computer and by going to the IP of
the Raspberry pi on port 8081 (in the address bar) you should be able to view your webcam.
8.HOTSPOT
The Raspberry Pi can connect to a Wi-Fi network using a USB dongle but using that same dongle you can also
turn your Raspberry Pi into a wireless access point. Once set up correctly, this will allow other wireless devices to
connect to your Pi and optionally you can route any traffic out through the Ethernet port and on to the internet (via
the router from your ISP).
WHAT DO YOU NEED:
● Any Raspberry Pi, model B with power supply
● A boot SD card for the Raspberry Pi.
● A USB WiFi device that supports "Access Point" mode; the Raspberry Pi 3 has a built-in AP Wi-Fi module.
● An Ethernet cable to connect to the local network.
HOW DOES IT WORK:
The Raspberry Pi is configured as a WiFi Hotspot, just like you would see in an internet cafe. It allows you to
connect to the internet over WiFi using the Raspberry Pi as the bridge to the internet. The basic steps are-
● Enable a WiFi Access Point and broadcast on the channel of your choice
● Assign dynamic IP addresses to any device that connects to WiFi network
● Join the WiFi and Ethernet networks together by using Network Address Translation
INSTRUCTIONS:
To configure a hotspot requires several steps:
1. Configure the wireless adapter with a static IP address
2. Install and configure a DHCP server
3. Install and configure the access point daemon
4. Configure IP routing between the wireless and Ethernet
In this example, the wireless network will use the address range 10.x.x.x and the wired Ethernet will use the address
range 172.168.1.x.
1. Configure the wireless adapter with a static IP address:
Edit “/etc/network/interfaces” and add the static IP address information for wlan0.
> sudo nano /etc/network/interfaces
Place a “#” sign in front of all the lines which mention wlan0 and wpa, except for “allow hotplug wlan0“. Then
add the following lines to the file:
○ iface wlan0 inet static
○ address 10.0.0.1
○ netmask 255.0 .0.0
The bottom half of the file will now look something like this:
Press ctrl + x to exit. Type y to save and enter to confirm. Now, reboot-
> init 6
2. Install and configure a DHCP server:
To install the DHCP server, run either of the two commands given below-
> sudo apt-get install isc-dhcp-server
> sudo apt-get install udhcpd
You can safely ignore any errors about not being able to start the DHCP server at this point. Now edit its
configuration file:
> sudo nano /etc/udhcpd.conf
Edit the file /etc/udhcpd.conf and configure it like this:
○ start 10.0.0.4 #This is the range of IPs that the hotspot will give to client devices.
○ end 10.0.0.204
○ interface wlan0 #The device UDHCP listens on.
Add a “#” character in front of the “option domain-name” lines like this:
#option domain-name "example.org";
#option domain-name-servers ns1.example.org, ns2.example.org;
Remove the “#” sign in front of the “authoritative;” statement like this:
# If this DHCP server is the official DHCP server for the local
# network, the authoritative directive should be uncommented.
Authoritative;
At the bottom of the file add the following lines:
○ opt dns 10.0.0.1 172.16.20.20 #The DNS servers client devices will use.
○ opt subnet 255.0.0.0
○ opt router 10.0.0.1 #The Pi's IP address on wlan0 which we will set up shortly.
○ opt lease 864000 #10 day DHCP lease time in seconds
Exit from nano with Ctrl + X.
Make thewireless adapter the default for the DHCP request by-
> sudo nano /etc/default/udhcpd
To enable the DHCP change: DHCPD_ENABLED="no"
to
#DHCPD_ENABLED="no"
Exit from nano with “Ctrl + X”.
Restart the DHCP server-
> sudo service udhcpd restart
3. Install and configure the access point daemon:
Install hostapd by running the command-
> sudo apt-get install hostapd
Edit the hostapd configuration file and create a wireless network:
> sudo nano /etc/hostapd/hostapd.conf
Add the following lines:
○ interface=wlan0
○ driver=nl80211 #driver=rtl871xdrv
○ ssid=MyPi
○ hw_mode=g
○ channel=6
○ macaddr_acl=0
○ auth_algs=1
○ ignore_broadcast_ssid=0
○ wpa=2
○ wpa_passphrase=raspberry
○ wpa_key_mgmt=WPA-PSK
○ #wpa_pairwise=TKIP #Do not use this weak encryption (only used by old client devices)
○ rsn_pairwise=CCMP
This will create a password protected network called ‘MyPi’ on channel 6 with the password ‘raspberry’.
If you would like to create an open network, put the following text instead of the above one-
○ interface=wlan0
○ ssid=My_AP
○ hw_mode=g
○ channel=6
○ auth_algs=1
○ wmm_enabled=0
In addition the built-in Raspberry Pi 3 Wi-Fi module seems to require the following additional parameters-
○ ieee80211n=1 # 802.11n support
○ wmm_enabled=1 # QoS support
○ ht_capab=[HT40][SHORT-GI-20][DSSS_CCK-40]
Tell hostapd where to find its configuration file by setting the default location-
> sudo nano /etc/default/hostapd
Remove the “#” in front of “DAEMON_CONF” and alter the line to read:
DAEMON_CONF="/etc/hostapd/hostapd.conf”
4. Configure IP routing between the wireless and Ethernet:
Configure NAT (Network Address Translation). NAT is a technique that allows several devices to use a single
connection to the internet. Linux supports NAT using Netfilter (also known as iptables) and is fairly easy to set
up.
First, enable IP forwarding in the kernel-
> sudosh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"
To set this up automatically on boot, edit “/etc/sysctl.conf”by-
> sudo nano /etc/sysctl.conf
Find the line which reads “Uncomment the next line to enable packet forwarding for IPv4” and uncomment the
next line like this:
Second, enable NAT in the kernel or to turn the Pi into a router run the following commands one by one:
> sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
> sudo iptables -A FORWARD -i eth0 -o wlan0 -m state --stateRELATED,ESTABLISHED -j ACCEPT
> sudo iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPT
These instructions don't give a good solution for rerouting https and for URLs referring to a page inside a
domain, like www.nu.nl/38274.htm. The user will see a 404 error. Your Pi is now NAT-ing. To make this
permanent so you don't have to run the commands after each reboot, save the routing tables into the file
“/etc/iptables.ipv4.nat” by-
> sudosh -c "iptables-save > /etc/iptables.ipv4.nat"
Now, edit “/etc/network/interfaces“ using the command-
> sudo nano /etc/network/interfaces
And add the following line to the end of the file. This line will restore the routing table whenever the Pi is
booted:
● pre-up iptables-restore < /etc/iptables.ipv4.nat
Your Pi should now be hosting a wireless hotspot. To get the hotspot to start on boot, run these additional
commands:
> sudo update-rc.dhostapd enable
> sudo update-rc.dudhcpd enable
You should now reboot your Pi and test the wireless access using a laptop, smartphone, tablet or other Wi-Fi
enabled device.
9.WINSCP AND PUTTY
WinSCP (Windows Secure Copy) is a free and open-sourceSFTP, FTP, WebDAV and SCP client for Microsoft
Windows. Its main function is secure file transfer between a local and a remote computer. Beyond this, WinSCP
offers basic file manager and file synchronization functionality. For secure transfers, it uses Secure Shell (SSH) and
supports the SCP protocol in addition to SFTP.
My version:2013-02-09-wheezy-raspbian
Download WinSCP here:http://winscp.net/eng/download.php
If you boot for the wheezy-raspbian for the first time, enable SSH on the raspi-config screen. Or if you want to
get into the config screen again, enter
> sudoraspi-config
INSTALLATION:
1. Open the installation program by double clicking on its icon.
2. If your Windows language is not supported by the installer, select an alternative language you want to
use (both for installation and later when using WinSCP).
3. On the License Agreement screen click Accept after reviewing the license.
4. You will be prompted to select a setup type. For a basic setup, choose Typical installation.
5. Then you will be prompted for Initial User Settings. This allows you to select user interface style. If you
have used (and enjoyed) file managers like Total Commander, Altap Salamander or Norton Commander
before, keep default Commander interface. Otherwise you will probably be more familiar with Explorer
interface.
6. After you select the interface, the Ready to Install screen opens. On this screen, you can review the
installation options you’ve selected. Click Install to start the installation.
7. A brief installation process will take place. You may have to restart Windows Explorer or your computer.
If you choose not to restart, some WinSCP functions may not be available until you do so.
CONNECTING:
Start WinSCP. Login Dialog wil l appear. On the dialog:
● Select your File protocol. When you are about to use FTPS protocol, select FTP and then choose one of
the FTPS invocation methods.
● Enter your host name to Host name field, username to User name and password to Password
● You may want to save your session details to a site so you do not need to type them in every time you
want to connect. Press Save button and type site name.
● Press Login to connect.
Once you are logged in, you’ll be presented with a dual-pane session window. The left side of the screen is your
local computer and the right side is your Raspberry pi.
You may copy files between the two systems by simply dragging and dropping them between the panes ie you’re
now able to visually manage your remote filesystem using WinSCP.
10.SECURESHELL (SSH):
SSH is a secure network protocol for data communication. Via SSH, you can access the command line of a
Raspberry Pi remotely from another computer or device on the same network. Also, you can quickly copy text or
files across to your Pi's command line instead of typing it all out. You need two computers - a server (your desktop)
and a client (the Raspberry Pi).
The steps to logging into your Raspberry Pi's console from another PC or laptop are -
1. Give your Raspberry Pi a Static IP:
To log in to your Raspberry Pi remotely, you'll need the IP of the Raspberry Pi – this tells the host computer where
to look for it on the network. By default, the Raspberry Pi will be given an IP automatically by the router (called
Dynamic IP) when you connect to a network. However, this can change whenever you remove the Pi from the
network e.g. turn it off. It's therefore very useful is the IP never changes, hence a 'static' IP. Use the following
command to grab your Pi's current IP.
> Ifconfig
The address you need is the inet address as shown
2. Enable SSH:
Raspbian has the SSH server disabled by default. It can be enabled manually from the desktop:
➢ Launch Raspberry Pi Configuration from the Preferences menu
➢ Navigate to the Interfaces tab
➢ Select Enabled next to SSH
➢ Click OK
Alternatively, raspi-config can be used:
➢ Enter sudoraspi-config in a terminal window
➢ Select Interfacing Options
➢ Navigate to and select SSH
➢ Choose Yes
➢ Select Ok
➢ Choose Finish
sshpi@192.168.2.# :
➢ Open the Terminal window and on the command line, type the above command.
➢ Once the local IP address of the RPi has been found, the above command can be used to establish an SSH
connection using the default username/password combination of "pi" and "raspberry".
3. Install the SSH client on your computer:
Download an SSH client to your computer. We are going to use Putty, which is an SSH and telnet client, developed
originally by Simon Tatham for the Windows platform. It is open source software that is available with source
code and is developed and supported by a group of volunteers. Putty is great for generally browsing around your
Pi's folders and copying files to or from a Windows PC. Follow the link below to download putty:
http://www.putty.org/
It's stand alone, so requires no installation, just download it and open the program!
First of all, you might want to change some settings. If you're used to Windows click mouse controls e.g. right
click opens menu to copy and paste, then change the settings to those in the picture below.
Then, simply type your Raspberry Pi's IP address (the "inetaddr" that we defined statically earlier). It's best to save
these settings so you won't need to type in the IP address everytime you want to connect. Just type a name under
"Saved Sessions" and hit "Save" once you've inputted the correct IP.
The first time you log in, you'll get a security message. Simply hit yes and continue - you should be relatively sure
that you're accessing the correct device!
Now log into your raspberry pi as usual.
Login: pi
Password: power
That's it! You can now type, copy and paste commands and generally screw around on your Raspberry Pi's
command line!
11.INTRODUCTION TO GPIO AND PHYSICAL COMPUTING ON THE RASPBERRY PI
Pinout!
The comprehensive GPIO Pinout guide for the Raspberry Pi.
This GPIO Pinout is designed to be both a quick and interactive reference to the Raspberry Pi GPIO pins, plus a
comprehensive guide to your Raspberry Pi's GPIO interfaces. It also includes dozens of pinouts for Raspberry Pi
add-on boards, HATs and pHATs.
Support Pinout.xyz On Patreon
If you love Pinout, please help me fund new features and improvements. Head on over to Patreon.com/gadgetoid.
A $1 pledge will make all the difference! Thank you.
pHAT Stack
Pinout has teamed up with Pimoroni to create a prototype board compatibility tool, check it out here!
Explore HATs &pHATs
We've added a board explorer! Use it to find the pinout for a Raspberry Pi add-on board, or discover new ones. If
you manufacture boards, we'd love to add yours too. You can contribute over on GitHub.
What do these numbers mean?
 BCM - Broadcom pin number, commonly called "GPIO", these are the ones you probably want to use with
RPi.GPIO and GPIO Zero
 WiringPi - Wiring Pi pin number (shown as a tooltip), for Gordon Henderson's Wiring Pi library
 Physical - Number corresponding to the pin's physical location on the header
 Rev 1 Pi - Alternate BCM numbers for the original, 26-pin model "A" and "B" Pi
Graphical Pinout
We've whipped up a simple graphical Raspberry Pi GPIO Pinout. Feel free to print, embed, share or hotlink this
image and don't forget to credit us!
One powerful feature of the Raspberry Pi is the row of 40 GPIO (general purpose input/output) pins along the top
edge of the board in the models A+, B+, raspberry Pi 2B and 3B.
Similarly in the
models A and B, there are 26 GPIO (general purpose input/output) pins along the edge of the board, next to the
yellow video out socket in.
These pins are a physical interface between the Pi and the outside world. At the simplest level, you can think of
them as switches that you can turn on or off (input) or that the Pi can turn on or off (output). Seventeen of the 26
pins are GPIO pins; the others are power or ground pins.
WHAT ARE THEY FOR? WHAT CAN I DO WITH THEM?
The GPIO pins allow the Raspberry Pi to control and monitor the outside world by being connected to electronic
circuits. The Pi is able to control LEDs, turning them on or
off, run motors, and many other things. It's also able to detect
whether a switch has been pressed, the temperature, and
light. We refer to this as physical computing.
You can program the pins to interact in amazing ways with
the real world. Inputs don't have to come from a physical
switch; it could be input from a sensor or a signal from
another computer or device, for example. The output can
also do anything, from turning on an LED to sending a signal
or data to another device. If the Raspberry Pi is on a
network, you can control devices that are attached to it from
anywhere and those devices can send data back.
Connectivity and control of physical devices over the
internet is a powerful and exciting thing, and the Raspberry
Pi is ideal for this.
HOW THE GPIO PINS WORK:
● Output -
If you follow the instructions, then messing about with the
GPIO is safe and fun. Randomly plugging wires and power
sources into your Pi, however, may kill it. Bad things can
also happen if you try to connect things to your Pi that use a
lot of power; LEDs are fine, motors are not.
When we use a GPIO pin as an output, each pin can turn on
or off, or go HIGH or LOW in computing terms. When the
pin is HIGH it outputs 3.3 volts (3v3); when the pin is LOW
it is off.
Here's the circuit using the Raspberry Pi. The LED is connected to a GPIO pin (which can output +3v3) and a
ground pin (which is 0v and acts like the negative terminal of the battery):
The next step is to write a program to tell the pin to go HIGH or LOW.
● Input -
GPIO outputs are easy; they are on or off, HIGH or LOW, 3v3 or 0v. Inputs are a bit trickier because of the way
that digital devices work. Detect the pin being at HIGH or LOW – we can connect switches and simple sensors to
a pin and check whether it is open or closed (that is, activated or not)
RPI GPIO AS A DATA BUS:
The first thing to get your head around, is how is data moved around the RPi, or in any general purpose computer.
In the most general sense in electronics, a bus or data bus is used to move data words of any type from one place
to another. Computing is based on data words made up of collections of data bits. These “words” can contain as
few as four data bits and often much larger.
The task of a bus designer is to devise circuitry that passes these data words from one circuit to another. These
words can be communicated serially (i.e. serial communications) or in parallel. Parallel communication was
commonly used in earlier system buses, whereas serial communications are prevalent in modern computers.
● Serial Bus: The least expensive method in terms of wire cost is to send the bits one at a time over a single
pair of wires. This is called serial data transmission. Data words start as sets of bits that exist in parallel.
In order to ship these words on a serial basis they must be converted to a serial stream of bits at the transmit
end and then reconverted to a parallel word at the receive end. The common name for the circuitry that
does this conversion is a SerDes circuit which stands for serializer/deserializer. Integrated circuits are more
expensive when they have more pins. To reduce the number of pins in a package, many ICs use a serial bus
to transfer data when speed is not important. Some examples of such low-cost serial buses include Serial
Peripheral Interface (SPI), Inter-Integrated Circuit(I²C), UNI/O, and 1-Wire.
As the name implies, GPIO pins can be configured through software to provide some specific function or purpose
within the hardware device design. The GPIO pins connect directly into the core of the processor, and the
Raspberry Pi developers implemented several alternate functions for the GPIO pins. Several are desirable because
of the multiple standards and types of devices you may wish to interface.
On boot-up, theRPi board GPIO is in alternate function state “ALT0” and will support I2C, SPI, and UART. This
is shown below:
It can be confusing to call the RPi’s whole 26 pin array GPIO and also some specific pins GPIO. In reality, all
the GPIO pins can be reconfigured to provide alternate functions.
I2C, SPI, and UART are the heart of our quest to understand RPi’s serial communications capability. Via their
exposure on the GPIO pins, these capabilities are what can be used to integrate things like LCD displays to the
RPi. Now lets dive deeper into each one of them.
● Universal Asynchronous Receiver/Transmitter (UART):
The Universal Asynchronous Receiver/Transmitter (UART) takes bytes of data and transmits the individual bits
in a sequential fashion. The Raspberry Pi actually has two UARTs. One UART is part of the internal ARM
architecture of the Broadcom BCM2835 chip, in the core of the Raspberry Pi and not accessible externally. The
other UART is sometimes called the RPi’s “Serial Port” (even thou the USB supports serial communications, and
therefore a serial port). The serial port being reference here is serviced by a UART, sometime referred to as the
“Mini-UART” since it doesn’t appear to be very rich in functionality. It is basically be used as a console port for
access to the Raspberry Pi. The serial console is a convenient way to interact with the Raspberry Pi for debugging
or your network is down and it is the destination of console messages (including boot-up messages). From the
Raspberry Pi pinout the serial port on the Pi is on GPIO Pin 14 (TX) and GPIO Pin 15 (RX):
Since the GPIO pins give access to the Mini UART, you can establish a serial console, which can be used to log
in to the Pi, and many other things. However, normal console device communicate with -12V (logical “1″) and
+12V (logical “0″) RS-232, which may just fry something in the 3.3V Pi.
You can reconfigure the RPi so that the Mini UART isn’t acting as a serial console and use it for outer purposes
(e.g. communicate with an attached Arduino or Xbee). Again, keep in mind that RX and TX lines are available on
the GPIOs but operate at 3.3 volts. You’ll need a board or cable to level convert 3.3volt UART signals to connect
with other devices (e.g. RS-232, USB).
● Serial Peripheral Interface Bus (SPI) -- aka 4-Wire Serial Bus:
The Serial Peripheral Interface Bus or SPI bus is a synchronous serial data link standard, named by Motorola, that
operates in full duplex mode. SPI is much simpler than I2C. Master and slave are linked by three data wires,
usually called MISO, (Master in, Slave out), MOSI (Master out, Slave in), the SCLK clock line (sometimes called
M-CLK), and an optional SS (Slave Select; sometimes known as the Chip Select or CS line or Chip Enable or CE
line) is the slave select or chip select line. Its optional only if you have one slave, otherwise one or more SS lines
are provided. The Raspberry Pi has two Slave Select lines: CE0 and CE1.
Usually the transfer sequence consist of driving the SS line low, sending X number of clock signals with the proper
polarity and phase, then driving the SS line high to end the communication. As the clock signals are generated,
data is transferred in both directions, therefore in a “transmit only” system the received bytes have to be discarded
and in a “receive only” system a dummy byte has to be transmitted.
Many SPI-enabled ICs and Microcontrollers can cope with data rates of over 10 MHz, so transfer is much faster
than with I2C. Since it is synchronous communications, it is not limited to 8-bit words so you can send any message
sizes with arbitrary content and purpose. The SPI interface does not require pull-up resistors, which translates to
lower power consumption. The downside is that SPI normally has no addressing capability; instead, devices are
selected by means of a SS signal which the master can use to enable one slave out of several connected to the SPI
bus. If more than one slave exists, one chip select line is required per device, which can use precious GPIO lines
on the Master.
● Inter-Integrated Circuit (I2C) — aka 2-Wire Serial Bus:
Inter-Integrated Circuit or I2C is generically referred to as a “two-wire interface”. It’s a multi-master serial single-
ended computer bus invented by Philips that is used to attach low-speed peripherals to a motherboard, embedded
system, or other electronic devices.
I2C is a particularly useful bus with the for two main reasons:
1. It only requires two shared lines: SCL for the clock signal, and SDA for the bidirectional data transfers.
2. Each I2C device uses a unique 7-bit address, meaning you can have more than 120 unique I2C devices
sharing the bus, and you can freely communicate with them one at a time on an as-needed basis.
I2C can be used to connect up to 127 nodes via a bus has two data wires, called SCL and SDA. SCL is the clock
line. It is used to synchronize all data transfers over the I2C bus. SDA is the data line. Of course, there is a third
wire being ground. There may also be a 5 volt wire to distribute power to the devices. Both SCL and SDA lines
are “open drain” drivers. What this means is that the chip can drive its output low, but it cannot drive it high. For
the line to be able to go high you must provide pull-up resistors to the 5v supply. There should be a resistor from
the SCL line to the 5v line and another from the SDA line to the 5v line. The value of the resistors is not critical.
Anything from 1800 ohms to 47K ohms used (1.8K, 47K and 10K are common values). You only need one set of
pull-up resistors for the whole I2C bus, not for each device, as illustrated below:
The advantage of i2c is that it only uses two pins on the Pi (plus power and ground) to communicate with a lot of
different devices. One pin carries a clock signal, and the other carries the data.
When data is being sent on the SDA line, clock pulses are sent on the SCL line to keep master and slave
synchronised. Since the data is sent one bit at a time, the data transfer rate is one eighth of the clock rate. The
original standard specified a standard clock rate of 100KHz, and most I2C chips and micro-controllers can support
this. Later updates to the standard introduced a fast speed of 400 KHz and a high speed of 1.7 or 3.4 MHz. The
Arduino and Raspberry Pi can support standard and fast speeds.
The fast rate corresponds to a data transfer rate of 50K bytes/sec which is too slow for some control applications.
One option in that case is to use SPI instead of I2C.
● 1-Wire — aka 1-Wire Serial Bus:
On a 1-Wire bus, a single master device communicates with one or more 1-Wire slave devices over a single data
line, which can also be used to provide power to the slave devices. Devices drawing power from the 1-wire bus
are said to be operating in parasitic power mode. When operating in parasite power mode, only two wires are
required: one data wire, and ground. At the master, a 4.7k pull-up resistor must be connected to the 1-wire bus.
With an external supply, three wires are required: the bus wire, ground, and power. The 4.7k pull-up resistor is still
required on the bus wire.
Each 1-Wire device contains a unique 64-bit code, consisting of an 8-bit family code, a 48-bit serial number, and
an 8-bit CRC. Before sending a command to a slave device, the master must first select that device using its code.
How do you use I2C, SPI, UART, or 1-Wire on the Raspberry Pi?
Now that we know the what & why for serial communications options on the Raspberry Pi, how do we use them?
This topic deserves technical details and examples but this post has already run too long. I’m likely to do some
specific implementation in the future, but for now I’ll reference some sources of information on the web.
First, lets be clear about the RPi software distribution I’m using, since not all will be supporting all these serial
communications options. I’m using Adafruit’s Occidentalis distribution (based on “Wheezy”) which comes with
hardware SPI, I2C, and 1-wire support. In the Occidentalis distribution, Adafruit has included in the Linux kernel
the needed drivers. SPI and I2C has been implement on the GPIO pins as outline above. RPi doesn’t have a
predetermined GPIO pin assignment for 1-Wire, but Adafruit choose GPIO pin 4 for 1-Wire. Note that this
unassigned GPCLK0 (General Purpose Clock Voltage) function.
Given you have the Occidentalis distribution, you can check on the installation of I2C, SPI, and 1-Wire via the
following:
12.PYTHON PROGRAMMING BASICS AND INSTALLATION
OF SUBLIME TEXT:
PYTHON:
Python is a widely used high-level programming language for general-purpose programming. It is a wonderful
and powerful programming language that's easy to use (easy to read and write) and with Raspberry Pi lets you
connect your project to the real world.
An interpreted language, Python has a design philosophy which emphasizes code readability and a syntax which
allows programmers to express concepts in fewer lines of code than might be used in languages such as C++ or
Java. The language provides constructs intended to enable writing clear programs on both a small and large
scale.
Python also has a large collection of libraries, which speeds up the development process. There are libraries for
everything you can think of – game programming, rendering graphics, GUI interfaces, web frameworks, and
scientific computing.
PIP:
PIP is a recursive acronym that can stand for either "Pip Installs Packages" or "Pip Installs Python". It is a package
management system used to install and manage software packages written in Python. Many packages can be found
in the Python Package Index (PyPI).
Most distributions of Python come with pip preinstalled. Like, Python 2.7.9 and later (on the python2 series), and
Python 3.4 and later include pip (pip3 for Python 3) by default. If pip is missing, it can be installed through the
system package manager.
One major advantage of pip is the ease of its command-line interface, which makes installing Python software
packages as easy as issuing one command-
> pip install some-package-name
Users can also easily remove the package-
> pip uninstall some-package-name
INSTALL PYTHON DEVELOPMENT TOOLS:
To program the GPIO pins on Raspberry Pi with Python, there is a Raspberry Pi GPIO Python library that is made
available. For this, open a terminal on the Raspberry Pi either via the desktop or by using SSH. (default credentials
are pi/raspberry). Run the following commands to install some basic Python development tools:
> sudo apt-get update
> apt-get install python-dev python-pip
> pip install python
INSTALL GPIO LIBRARY:
The RPi. GPIO Python library allows you to easily configure and read-write the input/output pins on the Pi’s GPIO
header within a Python script. Thankfully this library is now including in the standard Raspbian image. If it is
required to install the RPi GPIO library, there are two methods to install it-
1. Manual Installation:
The package is available from https://pypi.python.org/pypi/RPi.GPIO . There will be a download button on
the page as shown
Right click on this and copy the link address.
Further, in the terminal on the Raspberry Pi, paste the link address in the following command to download
the library-
> wget link address
This downloads the RPi.GPIO-0.6.3.tar.gz file. Extract the tar file to a new folder-
> tar -zxvf RPi.GPIO-0.6.3.tar.gz
Browse to the new directory i.e. into the above folder by-
> cd RPi.GPIO-0.6.3
and install the setup file-
> sudo python setup.py install
2. Install from repository:
If the package exists in the Raspbian repository is can be installed using apt-get. First you need to update the
available package versions:
> sudo apt-get update
Then attempt to install the RPi.GPIOpackage:
> apt-get install python-rpi.gpio
If it isn’t already installed it will be installed. If it is already installed it will be upgraded if a newer version is
available.
Usually now, the default Raspbian image include the RPi.GPIO library but we would like to install a newer
version to get access to newer API for callbacks. This can be done by using-
> sudo pip install --upgrade RPi.GPIO
SUBLIME TEXT
Sublime Text is a proprietary cross-platform source code editor with a Python application programming interface
(API). It natively supports many programming languages and markup languages, and functions can be added by
users with plugins, typically community-built and maintained under free-software licenses.
Sublime Text 3 (ST3) is lightweight, cross-platform code editor known for its speed, ease of use, and strong
community support. It’s an incredible editor right out of the box, but the real power comes from the ability to
enhance its functionality using Package Control and creating custom settings.
We’ll look at how to setup Sublime Text for full stack Python development (from the front to back), enhance the
basic functionality with custom themes and packages, and use many of the commands, features, and keyword
shortcuts that make ST3 so powerful.
INSTALLATION:
1. Download the installer from https://www.sublimetext.com/3.
2. Install the software.
3. Then, paste the following crack in the Help menu → Enter License.
—– BEGIN LICENSE —–
Michael Barnes
Single User License
EA7E-821385
8A353C41 872A0D5C DF9B2950 AFF6F667
C458EA6D 8EA3C286 98D 1D650 131A97AB
AA919AEC EF20E143 B361B1E7 4C8B7F04
B085E65E 2F5F5360 8489D422 FB8FC1AA
93F6323C FD7F7544 3F39C318 D95E6480
FCCC7561 8A4A1741 68FA4223 ADCEDE07
200C25BE DBBC4855 C4CFB774 C5EC138C
0FEC1CEF D9DCECEC D3A5DAD1 01316C36
—— END LICENSE ——
CONFIGURATION:
Open winscp and connect to Pi via IP address and username and password. Then go to tools (shown in left of
winscp) --> Preferences --> editors. When we go to editors there are two options to select, one is Notepad and
other is Internal Memory. Choose either of one option.
Then select edit option and go to external editor. Finally, browse the path in which your sublime text 3 is placed
in your PC.
After this WinSCP opens. Go to raspberry
pi folder and you want to name your folder in
your pi. Then you right click in pi folder and
go to new and then directory. Name your
folder name and select permissions and
according to your permissions octal code has
been sent. In these permissions, R- Read
W-Write X-Executable
PROGRAMMING WITH PYTHON ON RASPBERRY PI:
You can write a Python file in a standard editor like Sublime or Nano, and run it as a Python script from the
command line.
pi@raspberrypi ~ $
This (above) is the command prompt. A CLI or command line interface is actually a very quick and efficient way
to use a computer.
To start, just navigate to the directory where the file is saved (use cd and ls for guidance).
TIP: You can use the TAB key for autocomplete as you enter commands.
Then, run the program (e.g. hello) with python using the command
> python hello.py
● Few commands which we are going to use in PYTHON program:
○ import RPi.GPIO as GPIO
We are going to import GPIO file from library, above function enables us to program GPIO pins of PI. We are
also renaming “RPi.GPIO” to “GPIO”, so in the program whenever we want to refer to GPIO pins we will use
the word ‘GPIO’.
○ GPIO.setwarnings (False)
Sometimes, when the GPIO pins, which we are trying to use, might be doing some other functions. In that case,
we will receive warnings while executing the program. Below command tells the PI to ignore the warnings and
proceed with the program.
○ GPIO.setmode (GPIO.BCM)
We can refer the GPIO pins of PI, either by pin number on board or by their function number. In pin diagram,
you can see ‘PIN 35’ on the board is ‘GPIO 19’. So we tell here either we are going to represent the pin here by
‘35’ or ‘19’.
○ GPIO.setup(19,GPIO.IN)
We can set the GPIO pins as input or output pins using setup command. As shown below we are setting GPIO 19
(or PIN 35) as output pin. We will get PWM output from this pin.
○ While 1
It is used for infinity loop. With this command the statements inside this loop will be executed continuously.
1. import RPi.GPIO as GPIO # import RPi.GPIO module
2. GPIO.setmode(GPIO.BCM) # choose BCM or BOARD
3. GPIO.setup(port_or_pin, GPIO.IN) # set a port/pin as an input
4. GPIO.setup(port_or_pin, GPIO.OUT) # set a port/pin as an output
5. GPIO.output(port_or_pin, 1) # set an output port/pin value to 1/HIGH/True
6. GPIO.output(port_or_pin, 0) # set an output port/pin value to 0/LOW/False
7. i = GPIO.input(port_or_pin) # read status of pin/port and assign to variable i
SIMPLE INPUT/OUTPUT WITH RPI AND PYTHON:
After the above program is executed from nano file, pin 17 goes low i.e. LED connected to pin 17 becomes OFF
while those connected to pins 27 and 22 are switched ON.
SIMPLE INPUT/OUTPUT WITH DELAY:
When the above program is executed the output of LED’s change after a delay of 0.5 sec to a new state and then
again after a delay of 1.5 sec.
SIMPLE INPUT/OUTPUT WITH LOOP:
Using While loop makes the program to run continuously till Ctrl+C is pressed. Initially pins 17, 27 and 22 are set
to zero. When the loop starts, the output on pins change after 1s first and then again after 1.5 sec continuously.
MAKE A PYTHON FILE EXECUTABLE:
Making a Python program executable allows you to run the program without entering python before the file name.
You can make a file executable by entering this at the command prompt:
> chmod +x file-name.py
Now to run the program, all you need to enter is:
> ./file-name.py
INPUT SWITCH:
The quintessential LED blinking program is as shown below. The circuit for the switch connected to the GPIO pin
can be of the following two ways. The output on LED will be according to the circuit used.
We have assumed that you have connected a breadboard, LED, resistor to the Raspberry Pi GPIO and below is the
simple program in which the switch - switches the LED on when the button is pressed and switches it off again
when the button is released.
Every 0.1s, this program checks the switch status -
● if not pressed (input port 25 == 1), button status is displayed and the LED is switched off (output port 24
is set to 0)
● Otherwise,if pressed (input port 25 == 1), button status is displayed and the LED is switched on (output
port 24 is set to 1)
It keeps going until CTRL+C is pressed.
In the above program, if the delay is not provided you will probably notice that it printed many times for just a
single press. This may sometimes be what you want if you’re monitoring something which changes state
continuously, but for a button we’re probably only interested in seeing each press as one event.
This means we’re only interested when our switch changes from being low to being high. A little extra problem
will be that this will actually happen several times in a very brief period for a button press, as the inside of the
switch will act like a tiny spring. This is called bouncing. Hence a delay should be provided in such a case.
13. PULSE WIDTHMODULATION
PWM stands for ‘Pulse Width Modulation’. Pulse Width Modulation (or PWM) is a technique for controlling
power and is used for used for getting variable voltage out of constant power supply. We will generate PWM signal
from Raspberry Pi and demonstrate the PWM by varying the brightness of a LED, connected to Pi.There are two
important parameters that determine PWM-
1. Frequency
2. Duty cycle
Frequency:
Frequency, in Hertz (Hz) is the number of times per second that a pulse is generated. This counts from the start of
one pulse to the start of the next. i.e. from when the pulse starts to rise, to the next time it starts to rise. So it includes
all the “on” time and “off” time and “in between” time for one complete wave cycle.
Duty Cycle:
The amount of time the PWM pin is high within each cycle is called the duty cycle. Also, it is the proportion for
which the LED is ON over the total time and can be calculated as follows:
Duty Cycle =Turn ON time/ (Turn ON time + Turn OFF time)
In above figure, if the switch is closed continuously over a period of time, the LED will be ‘ON’ during this time
continuously. If the switch is closed for half second and opened for next half second, then LED will be ON only
in the first half second.
Duty Cycle = (0.5/ (0.5+0.5)) = 50%
So the average output voltage will be 50% of the battery voltage. This is the case for one second and we can see
the LED being OFF for half second and LED being ON the other half second. If Frequency of ON and OFF
times increased from ‘1 per second’ to ’50 per second’.
We will program the Pi for getting a PWM and connect a LED to show its working.
To create a PWM instance:
○ p= GPIO.PWM (channel,frequency)
The above command is for setting up the channel and also for setting up the frequency of the PWM signal. ‘P’
here is a variable it can be anything.
To start PWM signal generation:
○ p.start(dc) # where dc is the duty cycle (0.0 <= dc <= 100.0)
To change the frequency:
○ p.ChangeFrequency(freq) # where freq is the new frequency in Hz
To change the duty cycle:
○ p.ChangeDutyCycle(dc) # where 0.0 <= dc <= 100.0
To stop PWM:
○ p.stop()
Note that PWM will also stop if the instance variable 'p' goes out of scope.
When you’re done, don’t forget to cleanup with GPIO.cleanup(), then hit CTRL+Z to exit the Python live
environment.
With the program below being executed, the duty cycle of PWM signal increases. With an LED attached to this
PIN, brightness of LED increases.
The above program can be modified by using a switch. Below is the simple program in which the switch controls
the brightness of the LED.
14.SENSORS
A sensor is a device that measures a physical quantity and converts it into a
'signal' which can be read by an observer or by an instrument. One of the many
advantages of the Raspberry Pi is that it is possible to connect almost all standard
Arduino and Raspberry Pi sensors and components to the various GPIOs.
Moreover you can evaluate and / or process the values with programs and other
software. This accessory can be used in projects such as Smart Home (home
automation), robot kits or weather stations, etc.
DHT11 ● Low cost ($5.00)
● 3 to 5V power and I/O
● 2.5mA max current use during
conversion (while requesting
data)
● Good for 20-80% humidity
readings with 5% accuracy
● Good for 0-50°C temperature
readings ±2°C accuracy
● No more than 1 Hz sampling rate
(once every second)
● Body size 15.5mm x 12mm x
5.5mm
● 4 pins with 0.1" spacing
CONNECTING THE DHT11 TO THE RASPBERRY PI:
It is fairly easy to connect up to the DHT sensors. They have four pins
VCC (3 to 5V power), Data out, Not connected and Ground. Simply
ignore pin 3, it’s not used. You will want to place a 10K resistor
between VCC and the data pin, to act as a medium-strength pull up
on the data line. For DHT11 and DHT22 sensors, don't forget to
connect a 4.7K - 10K resistor from the data pin to VCC
DHT 11
The DHT11 is a basic, ultra low-cost digital
temperature and humidity sensor. It uses a
capacitive humidity sensor and a thermistor
to measure the surrounding air, and spits out
a digital signal on the data pin (no analog
input pins needed). Its fairly simple to use,
but requires careful timing to grab data. The
only real downside of this sensor is you can
only get new data from it once every 2
seconds, so when using our library, sensor
readings can be up to 2 seconds old.
There are two variants of the DHT11 you’re
likely to come across. One is a three pin PCB
mounted module and the other is a four pin
stand-alone module. The pinout is different
for each one, so connect the DHT11
according to which one you have:
DHT22
The DHT22 is a basic, low-cost digital temperature
and humidity sensor. It uses a capacitive humidity
sensor and a thermistor to measure the surrounding
air, and spits out a digital signal on the data pin (no
analog input pins needed). Its fairly simple to use,
but requires careful timing to grab data. The only
real downside of this sensor is you can only get new
data from it once every 2 seconds, so when using
our library, sensor readings can be up to 2 seconds
old.
Compared to the DHT11, this sensor is more
precise, more accurate and works in a bigger range
of temperature/humidity, but its larger and more
expensive. It comes with a 4.7K - 10K resistor,
which you will want to use as a pullup from the
data pin to VCC.
AM2302
The AM2302 is a wired version of the
DHT22, in a large plastic body. It is a basic,
low-cost digital temperature and humidity
sensor. It uses a capacitive humidity sensor
and a thermistor to measure the surrounding
air, and spits out a digital signal on the data
pin (no analog input pins needed). Its fairly
simple to use, but requires careful timing to
grab data. The only real downside of this
sensor is you can only get new data from it
once every 2 seconds, so when using our
library, sensor readings can be up to 2
seconds old.
Compared to the DHT11, this sensor is more
precise, more accurate and works in a bigger
range of temperature/humidity, but its larger
and more expensive.
DHT22 ● Low cost ($9.95)
● 3 to 5V power and I/O
● 2.5mA max current use during
conversion (while requesting
data)
● Good for 0-100% humidity
readings with 2-5% accuracy
● Good for -40 to 125°C
temperature readings ±0.5°C
accuracy
● No more than 0.5 Hz sampling
rate (once every 2 seconds)
● Body size 15.1mm x 25mm x
7.7mm
● 4 pins with 0.1" spacing
● Weight (just the DHT22): 2.4g
CONNECTING THE DHT22 TO THE RASPBERRY PI:
As shown in the diagram below, the DHT22 requires Pin 1 to be
connected to a 3.3V source,
Pin 2 to the desired General-purpose input/output (GPIO) pin on the
RPi, and Pin 4 to ground
(GND). A 10kΩ resistor is placed between Pin 1 and Pin 2. Pin 3 in
not used.
AM230
2
● Low cost$15.00
● 3 to 5V power and I/O
● 2.5mA max current use during
conversion (while requesting
data)
● Good for 0-100% humidity
readings with 2-5% accuracy
● Good for -40 to 80°C
temperature readings ±0.5°C
accuracy
● No more than 0.5 Hz sampling
rate (once every 2 seconds)
● Body size 27mm x 59mm x
13.5mm (1.05" x 2.32" x
0.53")
● 3 wires 23cm long (9")
● 27mm wide x 58.75mm tall x
13.30mm deep
CONNECTING THE AM2302 TO THE RASPBERRY PI:
The AM2302 sensor has three wires that need to be connected to Pi
pins. Red wire connects to a 3.3V source, Black wire connects to
ground and Yellow wire connects to to the desired General-purpose
input/output (GPIO) pin on the RPi(just make note of which one as
we need to know which pin to listen on)
● The Serial Peripheral Interface (SPI) standard provides a way
for digital devices to share data serially.
● The Inter-integrated Circuit (I2C) standard was developed to
attach peripheral ICs to microcontrollers.
SOFTWARE INSTALL (UPDATED):
The guys over at Adafruit have provided some software to interface with the sensor, which is available on
githubhttps://github.com/adafruit/Adafruit_Python_DHT.
We use some C code to talk to the DHT sensors since they require extremely fast timing to read, and then wrap the
C code in a simple Python library for easy integration into your own programs.
DOWNLOADING THE CODE FROM GITHUB:
The easiest way to get the code onto your Pi or Beaglebone Black is to hook up an Ethernet cable, and clone it
directly using 'git', which is installed by default on most distros (or can be done by using command apt-get install
git). Simply run the following commands from an appropriate location (ex. "/home/pi") -
git clone https://github.com/adafruit/Adafruit_Python_DHT.git
cd Adafruit_Python_DHT
INSTALLING THE ADAFRUIT PYTHON DHT SENSOR LIBRARY:
With the wiring is complete, download the Adafruit’s DHT library to the RPi, which is required to read the
temperature and humidity values from the sensor. To install the Python library on either the Raspberry Pi or
Beaglebone Black you will first need a few dependencies. Execute the following command to install these
dependencies (assuming you're using Raspbian on the Pi and Debian on the Beaglebone Black):
sudo apt-get update
sudo apt-get install build-essential python-dev python-openssl
If you see an error that a package is already installed or at the latest version, don't worry you can ignore it and
move on.Next, to install the library execute:
> sudo python setup.py install
This should compile the code for the library and install it on your device so any Python program can access the
Adafruit_DHT python module.
TESTING THE LIBRARY:
To test the Python library, you can run some of the example programs in the examples folder present in Adafruit,
Python_DHT. The AdafruitDHT.py example is a simple program which takes from the command line parameters
the type of sensor (11, 22, or 2302) and GPIO pin connected to the sensor, and displays a single reading from the
sensor.
First navigate to the examples folder by executing:
> cd examples
> ls
Now, examine the source codes of the programs (like ‘simpletest’ and ‘google spreadsheet’) in Nano editor to see
simple examples of reading the DHT sensors from Python code.
SIMPLE TEST:
Edit the program in Nano as shown below. Use while loop for it to run continuously.
> nano simpletest.py
Run the program-
> python simpletest.py
After the program executes you should see both the temperature and humidity displayed once. If you see an error
that the sensor could not be read, double check you have the right GPIO pin connected to the data line of the DHT
sensor.
15.GOOGLE SPREADSHEET:
With Google spreadsheet program, readings from the sensors can be recorded online in a Google spreadsheet. For
this, you need your ‘json file name’ and the ‘google spreadsheet name’.
How to create a JSON file:
JSON stands for JavaScript Object Notation. JSON is a lightweight data-interchange format. It is a minimal,
readable format for structuring data and is used primarily to transmit data between a server and web application
1. Head to Google Developers Console and create a new project.
2. From at the top left corner, go to the Dashboard in the API Manager. Click on ‘Enable API’.
3. Select Drive API and then enable it.
4. Go to “Credentials” and choose “Create Credentials > Service Account Key”.
5. Create New Service Account. Select the role ‘Owner’ and the ‘JSON’ key type.
6. Click on Create and you will automatically download a JSON file with this.
This is how this file may look like:
Create and Prepare Spreadsheet:
1. First up you will need to sign up for Google Docs and create a spreadsheet.
2. Once you've created it, delete all but one line (since we don't want 1000 empty rows)
First up we will have to install the gspread python library, which will do the heavy lifting of connecting to google
docs and updating the spreadsheet. With your board connected and online, run the following:
sudo apt-get update
sudo apt-get install python-pip
sudo pip install gspread oauth2client
Next, in the examples directory again, edit google_spreadsheet.py and adjust the configuration values towards
the top of the file.
> nano google_spreadsheet.py
Set GDOCS_SPREADSHEET_NAME to the name of your spreadsheet and the GDOCS_OAUTH_JSON to the
name of the .json file. Make sure DHT_TYPE is set to the type of sensor you are using (either
Adafruit_DHT.DHT11, Adafruit_DHT.DHT22, or Adafruit_DHT.AM2302), and DHT_PIN is set to the GPIO
pin number which is connected to your DHT sensor.
Save the file. Now, place the created .json file in the same directory as the google_spreadsheet.py example. If you
don't place this file in the same directory then authentication will fail and you will not be able to update your
spreadsheet.
One last step that must be completed is to share your Google spreadsheet to the email address associated with the
OAuth2 credentials. Open the .json file and search for the "client_email":
Take note of that email address value and go to your Google spreadsheet in a web browser. Using the File ->
Share... menu item share the spreadsheet with read and write access to the email address found above. Make sure
to share your spreadsheet or you will not be able to update it with the script.
Execute the Python script by running -
> python google_spreadsheet.py
You should see the program run and after about 5 seconds a humidity and temperature measurement is displayed
and written to the spreadsheet. The program will continue to run and log a measurement until you force it to quit
by pressing Ctrl+C.
The measurement frequency can be adjusted by changing the FREQUENCY_SECONDS configuration in the
python code.Open the spreadsheet on Google's site and you should see measurements added in real time. The same
can be seen in the form of graphs as shown below-
16. MY DEVICES
MyDevices is an Internet of Things solutions company. It accelerates IoT development and empower enterprises
to quickly design, prototype, and commercialize IoT solutions.
To accomplish the mission to simplify the connected world, it created Cayenne – the world’s first drag-and drop
IoT project builder that empowers developers to quickly create and host their connected device projects. Cayenne
was designed for the Internet of Things. It can control hardware remotely, it can display sensor data, it can store
data, analyze and do many other cool things.
There are several major components in the platform:
● Cayenne App – setup and control your IoT projects with drag and drop widgets from an app.
● Cayenne Online Dashboard – Use a browser to setup and control your IoT projects.
● Cayenne Cloud – responsible for processing and storage of device, user and sensor data for commands,
actions, triggers and alerts.
● Cayenne Agent – enables communication with the server, agent and hardware for implementing incoming
and outgoing commands, actions, triggers and alerts.
Every time you press a button from the Cayenne app or online dashboard, it travels to the Cayenne Cloud where
it’s processed and finds its way to your hardware. It works the same in the opposite direction. You can use the
Cayenne mobile app or online dashboard, it’s up to you. Any changes you make to hardware from the mobile app
are reflected when viewing the online dashboard and vice versa.
FEATURES OF CAYENNE:
● Connection using Ethernet, Wi-Fi and cellular (mobile app only)
● Discover and setup Raspberry Pis on a network (Ethernet or Wi-Fi only)
● Customizable dashboard with drag and drop widgets
● Remotely access, reboot and shutdown a Pi
● Add and control sensors, actuators and extensions connected to Raspberry Pis
● Configure triggers for Pis, sensors and actuators
● Setup and receive threshold alerts via email and text messages
● Monitor device and sensor history data
● Remotely test and and configure hardware using GPIO
● Schedule events to occur on connected hardware and devices
GETTING STARTED:
The process of installing Cayenne onto the Raspberry Pi is pretty simple. You will need to
make sure you have Raspbian installed on your Pi or else first install it from
https://www.raspberrypi.org/downloads/. The steps are:
1. Firstly, head over tomydevices.com.
2. Click on Get Started and and sign up for a free account.
3. Select Raspberry pi and click next.
4. Power on your Raspberry pi and connect it to internet via your LAN cable.
5. Connect the Pi up to the account you just created. To do this simply copy the 2 command lines shown
after you sign up. Enter these into the terminal for your Pi. (These files are unique for every new install)
Alternatively, you can download the app and it can automatically locate & install Cayenne onto your Pi.(Keep in
mind SSH needs to be enabled)
The first wget command installs a package and the second command will run shell script here which you brought
from the first wget command.
> Wget link
> sh rpi_b8w8pn82i9.sh -v
6. It will take a few minutes to install onto your Pi depending on how fast your internet connection is. The
device will reboot and the web browser or app should automatically update with information on the
installation process.
7. Once installed the dashboard will display and should look like something below.
8. Now, configuration of the device like the device name and device icon etc can be done.
9. Finally set up your sensor. The sensor that is used here is called DS18B20.
DS18B20
DESCRIPTION:
This sealed digital temperature probe lets you precisely measure temperatures in wet environments with a simple
1-Wire interface. The DS18B20 provides 9 to 12-bit (configurable) temperature readings over a 1-Wire interface,
so that only one wire (and ground) needs to be connected from a central microprocessor.
While the sensor is good up to 125°C the cable is jacketed in PVC so we suggest keeping it under 100°C. Because
they are digital, you don't get any signal degradation even over long distances. These 1-wire digital temperature
sensors are fairly precise (±0.5°C over much of the range) and can give up to 12 bits of precision from the onboard
digital- to-
analog
converter. They work great with any microcontroller using a single digital pin, and you can even connect multiple
ones to the same pin, each one has a unique 64-bit ID burned in at the factory to differentiate them.
The only downside is they use the Dallas 1-Wire protocol, which is somewhat complex, and requires a bunch of
code to parse out the communication. We toss in a 4.7k resistor, which is required as a pullup from the DATA to
VCC line when using the sensor.
TECHNICAL DETAILS:
Not for use in salt water or other corrosive environments.
Cable specs:
● Stainless steel tube 6mm diameter by 30mm long
● Cable is 36" long / 91cm, 4mm diameter
● Contains DS18B20 temperature sensor
DS18B20 Technical specs:
● Usable temperature range: -55 to 125°C (-67°F to +257°F)
● 9 to 12bit selectable resolution
● Uses 1-Wire interface- requires only one digital pin for communication
● Unique 64bit ID burned into chip
● Multiple sensors can share one pin
● ±0.5°C Accuracy from -10°C to +85°C
● Temperature-limit alarm system
● Query time is less than 750ms
● Usable with 3.0V to 5.5V power/data
CONNECTING THE DHT22 TO THE RASPBERRY PI:
If your sensor has four wires - Red connects to 3-5V, Black connects to ground and White is data. The copper wire
is soldered to the wire shielding.
If your sensor has three wires - Red connects to 3-5V, Blue/Black connects to ground and Yellow/White is data
SETTING UP THE SENSOR:
Now when you set this up the sensor, this can be automatically detected and added to your dashboard. However if
it didn’t add automatically then you will need to add it manually. To add it manually simply, do the following -
1. Go to add new in the upper left corner of the dashboard.
2. Select device from the dropdown box.
3. Find the device, in this case it is a DS18B20 temperature sensor.
4. Add all the details for the device.
5. Once entered select add sensor.
6. The sensor should now be displayed on the dashboard.
7. If you need to customise your sensor press the cog and it will come up with some options.
8. You can also see stats/graphs. For example, the temperature sensor can plot data in real time and will
keep historical data too.
If you want to also add an LED that you can turn on & off via the dashboard follow the next few instructions.
1. Now let’s add one more device. Except this one will be an LED.
2. So go back to add new device.
3. Now search for digital output and select it.
4. For this device select your Pi, widget type is button, icon can be whatever you want, and then select
integrated GPIO. Finally channel is the pin/channel that our LED is connected to. For this example it is pin
#17. (This is the GPIO numbering of the pins).
5. Now press the add sensor button.
6. You can now turn the GPIO pin high & low from the dashboard and also use it in a trigger.
7. We’re now ready to set up our first trigger.
You should now have two devices on your dashboard that should look something like this.
17. UBIDOTS
Ubidots is an Internet of Things (IoT) data analytics and visualization company. ... sending and retrieving data to
and from their cloud service in real-time. Ubidots' time-series backendservices are performance optimized ...
manage data between PubNub and Ubidots using the customized PubNub BLOCK.
18. PARTICLE.IO
Particle is an open source hardware/software platform for the Internet of Things. It is the fastest and easiest way to
get your Internet of Things product up and running. It is an internet of things (IoT) startup, providing a platform
for individuals and small businesses to create their own IoT devices. The company offers a range of hardware tools
and cloud-based software, helping companies to link their connected devices to the web and collect data on product
usage to improve functionality.
PARTICLE POWERS THE INTERNET OF THINGS:
IoT is hard. Particle makes it easy.Particle’s full-stack of Internet of Things(IoT) device platform gives you
everything you need to securely and reliably connect your IoT devices to the web.
Particle includes everything you need to deploy an IoT product: a device cloud platform, connectivity hardware,
and even SIMs for cellular products.
➢ For using particle.io with the raspberry pi, first make an account in particle.io from build.particle.io .
➢ Now go todocs.particle.ioyou will see the following options -
● Photon
● Electron
● Core
● Raspberry pi
PHOTON:
Particle's Internet of
Things hardware
development kit, the
Photon, provides
everything you need to
build a connected
product. Particle
combines a powerful
ARM Cortex M3
microcontroller with a
Broadcom Wifi chip in
a tiny thumbnail-sized
module called the PØ
(P-zero).
To get you started
quickly, Particle adds a
rock solid 3.3VDC
SMPS power supply,
RF and user interface
components to the PØ
on a small single-sided
PCB called the Photon.
● Particle PØ Wi-Fi
module
○ Broadcom
BCM43362 Wi-
Fi chip
○ 802.11b/g/n Wi-
Fi
○ STM32F205RG
Y6 120Mhz
ARM Cortex M3
○ 1MB flash,
128KB RAM
● On-board RGB
status LED (ext.
drive provided)
● 18 Mixed-signal
GPIO and advanced
peripherals
● Open source design
● Real-time operating
system (FreeRTOS)
● Soft AP setup
● FCC, CE and IC
certified
ELECTRO
N:
The Electron is a tiny
development kit for
creating cellular-
connected electronics
projects and products. It
comes with a SIM card
(Nano 4FF) and an
affordable data plan for
low-bandwidth things.
It also comes with
Particle's development
tools and cloud
platform for managing
and interacting with
your new connected
hardware.
● U-blox SARA-
U260/U270 (3G)
and G350 (2G)
cellular module
● STM32F205RGT6
120MHz ARM
Cortex M3
microcontroller
● 1MB flash, 128KB
RAM
● BQ24195 power
management unit
and battery charger
● MAX17043 fuel
gauge
● RGB status LED
● 30 mixed-signal
GPIO and advanced
peripherals
● Open source design
● Real-time operation
system (RTOS)
● FCC, CE and IC
certified
CORE: Spark Core v1.0 uses
the STM32F103CB -
ARM 32-bit Cortex M3
based - microcontroller
for its brain power
Features:
● ARM 32-bit
Cortex™-M3 CPU
Core
● 72Mhz operating
frequency, 1.25
DMIPS/MHz
(Dhrystone 2.1)
● 128KB of Flash
memory
● 20KB of SRAM
● 12 bit ADC
USB 2.0 full-speed interface
Particle Pi Beta:
ease note that the Raspberry Pi integration with the Particle Cloud is currently in beta.
Quick Install:
Copy the following command shown on the docs.particle.io page -
> bash <( curl -sL https://particle.io/install-pi )
What You'll Need
In order to connect your Raspberry Pi to the Particle Cloud you'll need the following things. Note that these are all
included in the Particle Pi Starter Kit with Raspberry Pi v3, which is available for purchase in the Particle Store.
● Raspberry Pi (Raspberry Pi v2 and v3 preferred)
● Power supply (5V, 2A+ preferred)
● Micro SD card and SD adapter
● Ethernet cable (for wired connections)
If you do not have access to a wired network cable, you will need to connect your Pi to an active Wi-Fi network,
which will require the following:
● Keyboard
● Mouse
● Monitor
● HDMI Cable (to connect Pi to your monitor)
Your raspberry pi should be installed with the latest OS Raspbian. Then connect your Pi to the internet. There are
two primary ways to connect your Raspberry Pi to the web--using a wired connection (Ethernet) or using a wireless
connection (Wi-Fi preferred).
Here we will use method using a wireless connection with LAN cable attached. Therefore, you will have to SSH
(secure shell) into your Pi in order to install the Particle software.
Install the Particle Agent:
You will not be able to complete this step of the process if you have not already received your beta activation
email.
● To connect your Raspberry pi to the Particle Cloud, you need to install the Particle Agent. The Particle
Agent is a software service that runs in the background on the Raspberry Pi and allows you to write and
run firmware (software that interacts with the GPIO pins on the Pi).
Install the agent by pasting the command you copied earlier in a terminal on your Raspberry Pi.
> bash <( curl -sL https://particle.io/install-pi )
When the installation is over, the Particle Agent setup will ask you to sign in to your Particle account.
Control an LED With Particle App:
Now install the application particle.io in your mobile phone using playstore.
1. Open Dash-Board and then Open Your "Raspberry Pi" on Device List.
2. Here, we are using D7 pin on Particle app that belongs to Pi 35 pin or GPIO19 so connect an LED to Pi pin
13 or GPIO19.
3. Set pins in Particle App. Click on D7 and Select pinMode. Here, we have digitalWrite.
4. Now Click on D7 button
5. We are Done! Look at your Pi.
Turn OFF or ON the LED using the D7 button.
That's all; you're now connected to the world's favorite low-cost computer now connects to the world's most popular
IoT platform.
IFTT
You’ve no doubt heard of software as a service. Those who are deeply into IT will nod their heads in recognition
when acronyms such as IaaS (infrastructure as a service) and PaaS (platform as a service) are tossed around, too.
But here’s one “*aaS” you might not have heard of yet: everything as a service. And it’s the future, according to
Linden Tibbets, CEO and co-founder of IFTTT.
[ Further reading: 41 cool and useful IFTTT applets ]
But what exactly is IFTTT? And how does it relate to the idea of everything as a service? Here’s what you need to
know.
What is IFTTT?
Here are just three if this, then
that automations you can run with
IFTTT:
* If you make a call on your Android
phone, then a log of that call is added to
a Google spreadsheet.
* If you add a new task to your Amazon
Alexa to-dos, then it will be added to
your iOS Reminders app.
* If the International Space Station passes over your house, then you’ll get a smartphone notification about it. (Yes,
this is an actual IFTTT applet.)
[ Take this mobile device management course from PluralSight and learn how to secure devices in your company
without degrading the user experience. ]
Currently, there are 54 million IFTTT applets, according to IFTTT.
And for the record, Tibbets’ favorite applets include one that lets you quickly email notes to yourself and another
that notifies you whenever a new Craigslist post matches your search terms.
The history of IFTTT
Tibbets and Jesse Tane co-
founded IFTTT in 2010 and
officially launched the service
in 2011. Based in San
Francisco, IFTTT has raised
$39 million in venture capital
funding from investors that
include the firm Andreesen
Horowitz, according to IFTTT
.
Tibbets is
currently
IFTTT’s CEO.
Tane moved
on from IFTTT
in 2012.
In November 2016, IFTTT beefed
up its recipes, which connected
two devices, apps or services,
turning them into applets, which
are capable of connecting
multiple devices, apps or
services.
IFTTT derives its name from the programming conditional statement
“if this, then that.” What the company provides is a software platform
that connects apps, devices and services from different developers in
order to trigger one or more automations involving those apps,
devices and services.
IOT Home Automation / Two Months Industrial Training File Format
IOT Home Automation / Two Months Industrial Training File Format
IOT Home Automation / Two Months Industrial Training File Format
IOT Home Automation / Two Months Industrial Training File Format
IOT Home Automation / Two Months Industrial Training File Format
IOT Home Automation / Two Months Industrial Training File Format
IOT Home Automation / Two Months Industrial Training File Format
IOT Home Automation / Two Months Industrial Training File Format
IOT Home Automation / Two Months Industrial Training File Format
IOT Home Automation / Two Months Industrial Training File Format
IOT Home Automation / Two Months Industrial Training File Format
IOT Home Automation / Two Months Industrial Training File Format
IOT Home Automation / Two Months Industrial Training File Format
IOT Home Automation / Two Months Industrial Training File Format
IOT Home Automation / Two Months Industrial Training File Format
IOT Home Automation / Two Months Industrial Training File Format
IOT Home Automation / Two Months Industrial Training File Format
IOT Home Automation / Two Months Industrial Training File Format
IOT Home Automation / Two Months Industrial Training File Format
IOT Home Automation / Two Months Industrial Training File Format
IOT Home Automation / Two Months Industrial Training File Format
IOT Home Automation / Two Months Industrial Training File Format
IOT Home Automation / Two Months Industrial Training File Format
IOT Home Automation / Two Months Industrial Training File Format
IOT Home Automation / Two Months Industrial Training File Format
IOT Home Automation / Two Months Industrial Training File Format
IOT Home Automation / Two Months Industrial Training File Format
IOT Home Automation / Two Months Industrial Training File Format
IOT Home Automation / Two Months Industrial Training File Format
IOT Home Automation / Two Months Industrial Training File Format
IOT Home Automation / Two Months Industrial Training File Format
IOT Home Automation / Two Months Industrial Training File Format
IOT Home Automation / Two Months Industrial Training File Format
IOT Home Automation / Two Months Industrial Training File Format
IOT Home Automation / Two Months Industrial Training File Format
IOT Home Automation / Two Months Industrial Training File Format
IOT Home Automation / Two Months Industrial Training File Format

More Related Content

What's hot

Applications list
Applications listApplications list
Applications list
Jose Carlo Castro Escalante
 
Configuring cisco asa and pix firewalls part2
Configuring cisco asa and pix firewalls part2Configuring cisco asa and pix firewalls part2
Configuring cisco asa and pix firewalls part2
IT Tech
 
PowerShell: A Language for the Internet of Things #ATLPUG
PowerShell: A Language for the Internet of Things #ATLPUGPowerShell: A Language for the Internet of Things #ATLPUG
PowerShell: A Language for the Internet of Things #ATLPUG
Taylor Riggan
 
DumpsCafe Microsoft-AZ-104 Free Exam Dumps Demo.pdf
DumpsCafe Microsoft-AZ-104 Free Exam Dumps Demo.pdfDumpsCafe Microsoft-AZ-104 Free Exam Dumps Demo.pdf
DumpsCafe Microsoft-AZ-104 Free Exam Dumps Demo.pdf
Dumps Cafe
 
August 2019 Patch Tuesday Analysis
August 2019 Patch Tuesday AnalysisAugust 2019 Patch Tuesday Analysis
August 2019 Patch Tuesday Analysis
Ivanti
 
July Patch Tuesday 2019
July Patch Tuesday 2019July Patch Tuesday 2019
July Patch Tuesday 2019
Ivanti
 
June Patch Tuesday 2019
June Patch Tuesday 2019June Patch Tuesday 2019
June Patch Tuesday 2019
Ivanti
 
Advanced Container Security - AWS Summit Sydney 2018
Advanced Container Security - AWS Summit Sydney 2018Advanced Container Security - AWS Summit Sydney 2018
Advanced Container Security - AWS Summit Sydney 2018
Amazon Web Services
 
iOS Hacking: Advanced Pentest & Forensic Techniques
iOS Hacking: Advanced Pentest & Forensic TechniquesiOS Hacking: Advanced Pentest & Forensic Techniques
iOS Hacking: Advanced Pentest & Forensic Techniques
Ömer Coşkun
 
Microsoft certification exams 70 533
Microsoft certification exams 70 533Microsoft certification exams 70 533
Microsoft certification exams 70 533
adam_jhon
 

What's hot (10)

Applications list
Applications listApplications list
Applications list
 
Configuring cisco asa and pix firewalls part2
Configuring cisco asa and pix firewalls part2Configuring cisco asa and pix firewalls part2
Configuring cisco asa and pix firewalls part2
 
PowerShell: A Language for the Internet of Things #ATLPUG
PowerShell: A Language for the Internet of Things #ATLPUGPowerShell: A Language for the Internet of Things #ATLPUG
PowerShell: A Language for the Internet of Things #ATLPUG
 
DumpsCafe Microsoft-AZ-104 Free Exam Dumps Demo.pdf
DumpsCafe Microsoft-AZ-104 Free Exam Dumps Demo.pdfDumpsCafe Microsoft-AZ-104 Free Exam Dumps Demo.pdf
DumpsCafe Microsoft-AZ-104 Free Exam Dumps Demo.pdf
 
August 2019 Patch Tuesday Analysis
August 2019 Patch Tuesday AnalysisAugust 2019 Patch Tuesday Analysis
August 2019 Patch Tuesday Analysis
 
July Patch Tuesday 2019
July Patch Tuesday 2019July Patch Tuesday 2019
July Patch Tuesday 2019
 
June Patch Tuesday 2019
June Patch Tuesday 2019June Patch Tuesday 2019
June Patch Tuesday 2019
 
Advanced Container Security - AWS Summit Sydney 2018
Advanced Container Security - AWS Summit Sydney 2018Advanced Container Security - AWS Summit Sydney 2018
Advanced Container Security - AWS Summit Sydney 2018
 
iOS Hacking: Advanced Pentest & Forensic Techniques
iOS Hacking: Advanced Pentest & Forensic TechniquesiOS Hacking: Advanced Pentest & Forensic Techniques
iOS Hacking: Advanced Pentest & Forensic Techniques
 
Microsoft certification exams 70 533
Microsoft certification exams 70 533Microsoft certification exams 70 533
Microsoft certification exams 70 533
 

Similar to IOT Home Automation / Two Months Industrial Training File Format

Essay On Active Directory
Essay On Active DirectoryEssay On Active Directory
Essay On Active Directory
Tammy Moncrief
 
Introducing The Business Operating Platform From Intalio
Introducing The Business Operating Platform From IntalioIntroducing The Business Operating Platform From Intalio
Introducing The Business Operating Platform From Intalio
Tomoaki Sawada
 
A framework for optimization of the boot time on embedded linux environment w...
A framework for optimization of the boot time on embedded linux environment w...A framework for optimization of the boot time on embedded linux environment w...
A framework for optimization of the boot time on embedded linux environment w...
BouchraBourass
 
Agent based web service communicating different is’s and platforms
Agent based web service communicating different is’s and platformsAgent based web service communicating different is’s and platforms
Agent based web service communicating different is’s and platforms
IAEME Publication
 
Advantages Of SAMBA
Advantages Of SAMBAAdvantages Of SAMBA
Advantages Of SAMBA
Angela Hays
 
illustro Overview - z/IPMon Introduction
illustro Overview - z/IPMon Introductionillustro Overview - z/IPMon Introduction
illustro Overview - z/IPMon Introduction
illustro
 
Mainframe Architecture & Product Overview
Mainframe Architecture & Product OverviewMainframe Architecture & Product Overview
Mainframe Architecture & Product Overview
abhi1112
 
SOSCOE Overview
SOSCOE OverviewSOSCOE Overview
SOSCOE Overview
Joshua L. Davis
 
Web OS in Cloud Computing: A Case study
Web OS in Cloud Computing: A Case studyWeb OS in Cloud Computing: A Case study
Web OS in Cloud Computing: A Case study
Eswar Publications
 
A unified dashboard for collaborative robot management system
A unified dashboard for collaborative robot management systemA unified dashboard for collaborative robot management system
A unified dashboard for collaborative robot management system
Conference Papers
 
Impacts of Cloud Computing in the Society
Impacts of Cloud Computing in the SocietyImpacts of Cloud Computing in the Society
Impacts of Cloud Computing in the Society
theijes
 
Virtualization In Software Testing
Virtualization In Software TestingVirtualization In Software Testing
Virtualization In Software Testing
Colloquium
 
Group 5 Report Effect
Group 5 Report EffectGroup 5 Report Effect
Group 5 Report Effect
jorence
 
Group 5 Report Effect
Group 5 Report EffectGroup 5 Report Effect
Group 5 Report Effect
jorence
 
Bsp customization and porting of linux on arm cortex based i.mx6 processor wi...
Bsp customization and porting of linux on arm cortex based i.mx6 processor wi...Bsp customization and porting of linux on arm cortex based i.mx6 processor wi...
Bsp customization and porting of linux on arm cortex based i.mx6 processor wi...
eSAT Publishing House
 
IRJET- Implementation of Web Enabled Notice Board using SOC
IRJET- Implementation of Web Enabled Notice Board using SOCIRJET- Implementation of Web Enabled Notice Board using SOC
IRJET- Implementation of Web Enabled Notice Board using SOC
IRJET Journal
 
ops300 Project(3)
ops300 Project(3)ops300 Project(3)
ops300 Project(3)
trayyoo
 
ops300 Project(4)
ops300 Project(4)ops300 Project(4)
ops300 Project(4)
trayyoo
 
TDC2016SP - Trilha Linux Embarcado
TDC2016SP - Trilha Linux EmbarcadoTDC2016SP - Trilha Linux Embarcado
TDC2016SP - Trilha Linux Embarcado
tdc-globalcode
 
OpenSolaris Introduction
OpenSolaris IntroductionOpenSolaris Introduction
OpenSolaris Introduction
satyajit_t
 

Similar to IOT Home Automation / Two Months Industrial Training File Format (20)

Essay On Active Directory
Essay On Active DirectoryEssay On Active Directory
Essay On Active Directory
 
Introducing The Business Operating Platform From Intalio
Introducing The Business Operating Platform From IntalioIntroducing The Business Operating Platform From Intalio
Introducing The Business Operating Platform From Intalio
 
A framework for optimization of the boot time on embedded linux environment w...
A framework for optimization of the boot time on embedded linux environment w...A framework for optimization of the boot time on embedded linux environment w...
A framework for optimization of the boot time on embedded linux environment w...
 
Agent based web service communicating different is’s and platforms
Agent based web service communicating different is’s and platformsAgent based web service communicating different is’s and platforms
Agent based web service communicating different is’s and platforms
 
Advantages Of SAMBA
Advantages Of SAMBAAdvantages Of SAMBA
Advantages Of SAMBA
 
illustro Overview - z/IPMon Introduction
illustro Overview - z/IPMon Introductionillustro Overview - z/IPMon Introduction
illustro Overview - z/IPMon Introduction
 
Mainframe Architecture & Product Overview
Mainframe Architecture & Product OverviewMainframe Architecture & Product Overview
Mainframe Architecture & Product Overview
 
SOSCOE Overview
SOSCOE OverviewSOSCOE Overview
SOSCOE Overview
 
Web OS in Cloud Computing: A Case study
Web OS in Cloud Computing: A Case studyWeb OS in Cloud Computing: A Case study
Web OS in Cloud Computing: A Case study
 
A unified dashboard for collaborative robot management system
A unified dashboard for collaborative robot management systemA unified dashboard for collaborative robot management system
A unified dashboard for collaborative robot management system
 
Impacts of Cloud Computing in the Society
Impacts of Cloud Computing in the SocietyImpacts of Cloud Computing in the Society
Impacts of Cloud Computing in the Society
 
Virtualization In Software Testing
Virtualization In Software TestingVirtualization In Software Testing
Virtualization In Software Testing
 
Group 5 Report Effect
Group 5 Report EffectGroup 5 Report Effect
Group 5 Report Effect
 
Group 5 Report Effect
Group 5 Report EffectGroup 5 Report Effect
Group 5 Report Effect
 
Bsp customization and porting of linux on arm cortex based i.mx6 processor wi...
Bsp customization and porting of linux on arm cortex based i.mx6 processor wi...Bsp customization and porting of linux on arm cortex based i.mx6 processor wi...
Bsp customization and porting of linux on arm cortex based i.mx6 processor wi...
 
IRJET- Implementation of Web Enabled Notice Board using SOC
IRJET- Implementation of Web Enabled Notice Board using SOCIRJET- Implementation of Web Enabled Notice Board using SOC
IRJET- Implementation of Web Enabled Notice Board using SOC
 
ops300 Project(3)
ops300 Project(3)ops300 Project(3)
ops300 Project(3)
 
ops300 Project(4)
ops300 Project(4)ops300 Project(4)
ops300 Project(4)
 
TDC2016SP - Trilha Linux Embarcado
TDC2016SP - Trilha Linux EmbarcadoTDC2016SP - Trilha Linux Embarcado
TDC2016SP - Trilha Linux Embarcado
 
OpenSolaris Introduction
OpenSolaris IntroductionOpenSolaris Introduction
OpenSolaris Introduction
 

Recently uploaded

Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Sinan KOZAK
 
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
IJECEIAES
 
Embedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoringEmbedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoring
IJECEIAES
 
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
shadow0702a
 
一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
upoux
 
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELDEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
ijaia
 
Curve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods RegressionCurve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods Regression
Nada Hikmah
 
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
MadhavJungKarki
 
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
upoux
 
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 08 Doors and Windows.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 08 Doors and Windows.pdf2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 08 Doors and Windows.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 08 Doors and Windows.pdf
Yasser Mahgoub
 
Generative AI Use cases applications solutions and implementation.pdf
Generative AI Use cases applications solutions and implementation.pdfGenerative AI Use cases applications solutions and implementation.pdf
Generative AI Use cases applications solutions and implementation.pdf
mahaffeycheryld
 
Mechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdfMechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdf
21UME003TUSHARDEB
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
MDSABBIROJJAMANPAYEL
 
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
171ticu
 
Gas agency management system project report.pdf
Gas agency management system project report.pdfGas agency management system project report.pdf
Gas agency management system project report.pdf
Kamal Acharya
 
Null Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAMNull Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAM
Divyanshu
 
Applications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdfApplications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdf
Atif Razi
 
Comparative analysis between traditional aquaponics and reconstructed aquapon...
Comparative analysis between traditional aquaponics and reconstructed aquapon...Comparative analysis between traditional aquaponics and reconstructed aquapon...
Comparative analysis between traditional aquaponics and reconstructed aquapon...
bijceesjournal
 
Digital Twins Computer Networking Paper Presentation.pptx
Digital Twins Computer Networking Paper Presentation.pptxDigital Twins Computer Networking Paper Presentation.pptx
Digital Twins Computer Networking Paper Presentation.pptx
aryanpankaj78
 
LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by AnantLLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
Anant Corporation
 

Recently uploaded (20)

Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024
 
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
Electric vehicle and photovoltaic advanced roles in enhancing the financial p...
 
Embedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoringEmbedded machine learning-based road conditions and driving behavior monitoring
Embedded machine learning-based road conditions and driving behavior monitoring
 
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
 
一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
 
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODELDEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
DEEP LEARNING FOR SMART GRID INTRUSION DETECTION: A HYBRID CNN-LSTM-BASED MODEL
 
Curve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods RegressionCurve Fitting in Numerical Methods Regression
Curve Fitting in Numerical Methods Regression
 
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
1FIDIC-CONSTRUCTION-CONTRACT-2ND-ED-2017-RED-BOOK.pdf
 
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
 
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 08 Doors and Windows.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 08 Doors and Windows.pdf2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 08 Doors and Windows.pdf
2008 BUILDING CONSTRUCTION Illustrated - Ching Chapter 08 Doors and Windows.pdf
 
Generative AI Use cases applications solutions and implementation.pdf
Generative AI Use cases applications solutions and implementation.pdfGenerative AI Use cases applications solutions and implementation.pdf
Generative AI Use cases applications solutions and implementation.pdf
 
Mechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdfMechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdf
 
Properties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptxProperties Railway Sleepers and Test.pptx
Properties Railway Sleepers and Test.pptx
 
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样学校原版美国波士顿大学毕业证学历学位证书原版一模一样
学校原版美国波士顿大学毕业证学历学位证书原版一模一样
 
Gas agency management system project report.pdf
Gas agency management system project report.pdfGas agency management system project report.pdf
Gas agency management system project report.pdf
 
Null Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAMNull Bangalore | Pentesters Approach to AWS IAM
Null Bangalore | Pentesters Approach to AWS IAM
 
Applications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdfApplications of artificial Intelligence in Mechanical Engineering.pdf
Applications of artificial Intelligence in Mechanical Engineering.pdf
 
Comparative analysis between traditional aquaponics and reconstructed aquapon...
Comparative analysis between traditional aquaponics and reconstructed aquapon...Comparative analysis between traditional aquaponics and reconstructed aquapon...
Comparative analysis between traditional aquaponics and reconstructed aquapon...
 
Digital Twins Computer Networking Paper Presentation.pptx
Digital Twins Computer Networking Paper Presentation.pptxDigital Twins Computer Networking Paper Presentation.pptx
Digital Twins Computer Networking Paper Presentation.pptx
 
LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by AnantLLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
LLM Fine Tuning with QLoRA Cassandra Lunch 4, presented by Anant
 

IOT Home Automation / Two Months Industrial Training File Format

  • 1. TWO MONTHS INDUSTRIAL TRAINING REPORT HELD AT BACHELORS OF TECHNOLOGY (ECE ENGINEERING) SUBMITTED BY Lovish Kumar - (1701431) Bharti Bhagat - (1701424) Parampreet Kaur - (1701435) Soma Biswas - (1701444) AMRITSAR COLLEGE OF ENGINEERING AND TECHNOLOGY, AMRITSAR, PUNJAB BATCH (2017-2021)
  • 2. CANDIDATE'S DECLARATION CERTIFICATE I hereby certify that the work which is being presented in the report entitled “ IOT with Python” by “Lovish Kumar, Bharti Bhagat, Parampreet Kaur, Soma Biswas” in partial fulfillment of requirements for the award of degree of B.Tech. (ECE) submitted to I.K.G. Punjab Technical University, Department of ECE at Amritsar College of Engineering and Technology, Amritsar under I.K.G. PUNJAB TECHNICAL UNIVERSITY, JALANDHAR is an authentic record of my own work carried out during a period from 3-june-2019 to 25-july- 2019 under the supervision of Mr. Rohit Khosla. Signature of the Student Lovish Kumar Bharti Bhagat Parampreet Kaur Soma Biswas
  • 3. ACKNOWLEDGMENT: I am highly grateful to the ER. Gurjeet Singh, HOD ECE, Amritsar College of Engineering & Technology, Amritsar, for providing this opportunity to carry out the two months industrial training at NETMAX, Chandigarh. I would like to expresses my gratitude to other faculty members of ECE Engineering Department of ACET, Amritsar for providing academic inputs, guidance & encouragement throughout the training period. The author would like to express a deep sense of gratitude and thank Mr. Rohit Khosla Director/ Incharge of Company, without whose permission, wise counsel and able guidance, it would have not been possible to pursue my training in this manner. The help rendered by Mr. RANJIT SINGH, Supervisor Mr. SHUKLA for experimentation is greatly acknowledged. Finally, I express my indebtedness to all who have directly or indirectly contributed to the successful completion of my industrial training. Name of Candidate Lovish Kumar Bharti Bhagat Parampreet Kaur Soma Biswas
  • 4. INDUSTRIAL TRAINING REPORT IOT WITH RASPBERRY PI SUBMITTED TO: SUBMITTED BY: ER. ROHIT KHOSLA (DIRECTOR) BHARTI BHAGAT LOVISH KUMAR PARAMPREET KAUR SOMA BISWAS
  • 5. INDEX S.NO. TOPIC PAGE NO. 1. INTRODUCTION 1-13 2. LINUX – ITS INTRODUCTION AND IMPORTANT COMMANDS and UBUNTU 14-17 3. INTRODUCTION TO NETWORKING BASICS 18-20 4. INTRODUCTION TO RASPBERRY PI AND ITSMODELS 21-24S 5. INSTALLATION OF OPERATING SYSTEM OF RASPBERRY PI 25-28 6. CONFIGURING RASPBERRY PI 29-30 7. RASPBERRY PI WEBCAM SERVER USING MOTION 31-33 8. HOTSPOT 34-38 9. WINSCP AND PUTTY 39-42 10. SECURE SHELL (SSH) 43-46 11. INTRODUCTION TO GPIO AND PHYSICAL COMPUTING ON RASPBERRY PI 47-57 12. PYTHON INTRODUCTION AND SUBLIME TEXT 58-67 13. PWM 68-74 14. SENSORS 75-80 15. GOOGLE SPREADSHEET 81-86 16. MY DEVICES 87-95 17. UBIDOTS 106-107 18. PARTICLE.IO IFTTT 108-126
  • 6. 19. NODE MCU AND ADAFRUIT.IO 127-144 1.ABOUT INTERNET OF THINGS (IOT)  The internet of things, or IoT, is a system of interrelated computing devices, mechanical and digital machines, objects, animals or people that are provided with unique identifiers ( UIDs ) and the ability to transfer data over a network without requiring human-to-human or human-to-computer interaction. A thing in the internet of things can be a person with a heart monitor implant, a farm animal with a biochip transponder, an automobile that has built-in sensors to alert the driver when tire pressure is low or any other natural or man-made object that can be assigned an IP address and is able to transfer data over a network .Increasingly, organizations in a variety of industries are using IoT to operate more efficiently, better understand customers to deliver enhanced customer service, improve decision-making and increase the value of the business.
  • 7. 1. BENEFITS OF IOT The internet of things offers a number of benefits to organizations, enabling them to:  monitor their overall business processes;  improve the customer experience;  save time and money;  enhance employee productivity;  integrate and adapt business models;  make better business decisions; and  generate more revenue. IoT encourages companies to rethink the ways they approach their businesses, industriesand markets and gives them the tools to improve their business strategies.
  • 8. (ii) CLOUD COMPUTING Cloud computing is a general term for anything that involves delivering hosted services over the Internet. These services are broadly divided into three categories: Infrastructure-as-a-Service (IaaS), Platform-as-a-Service (PaaS) and Software-as-a-Service (SaaS). The name cloud computing was inspired by the cloud symbol that'soften usedto representthe Internet in flowchartsand diagrams. A cloud service has three distinct characteristics that differentiate it from traditional web hosting. It is sold on demand, typically by the minute or the hour; it is elastic -- a user can have as much or as little of a service as they want at any given time; and the service is fully managed by the provider (the consumer needs nothing but a personal computer and Internet access). Significant innovations in virtualization and distributed computing, as well as improved access to high- speedInternet, have acceleratedinterest in cloudcomputing. A cloud canbe private orpublic. A public cloud sells services to anyone on the Internet. (Currently, Amazon Web Services is the largest public cloud provider.)A private cloudis aproprietarynetwork ora datacenter that supplies hosted services to a limited number of people. Private or public, the goal of cloud computing is to provide easy, scalable access to computing resources a nd IT services. (III) Virtualization, VMWare and How To Use And Install VMWare
  • 9. VMwareWorkstation is a programthat allows youto run a virtual computer within yourphysical computer. The virtual computer runs as if it was its own machine. A virtual machine is great for trying out new operating systems such as Linux, visiting websites you don't trust, creating a computing environment specifically forchildren, testing the effectsofcomputer viruses, andmuch more. Youcan evenprint and plug in USB drives. Read this guide to get the most out of VMware Workstation. 1.Requirements For The VMware (i) (ii) (iii) 2.Download the VMware Software (i) In computing, virtualization re fers to the act of creating a virtual (rather than actual) version of something, including virtual computer hardware platforms, storage devices, and computer network resources. VMware, Inc. is a subsidiary of Dell Technologies.VMware, a global leader in cloud infrastructure & digital workspace technology, accelerates digital transformation for evolving IT environments.
  • 10. 3. Installing The VMware (i)open VMware (II) Click on File On top and then Create a New Virtual Machine (III) Enter Details for The Operating System (iv) Name your Virtual Machine
  • 11. (v) Set the Disk Size (vii) Power ON your Virtual Machine (vi) Customise your virtual machine’s hardware
  • 12. (IV) ISO Files File Systems: ISO file, which is also known as a disc image, has .iso file extension. It contains a copy of the entire CD/DVD from which it was extracted. It means when you burn an ISO file to a blank disc, you’ll get the same files, folders, and properties as the original disc. ISO files are used to distribute disc images. For example, iso files for operating systems. like Ubuntu (Linux distro) could be downloaded from the net and then burn to a CD to create a bootable operating system disc.
  • 13. In this section, it is important to differentiate between the FAT file system and the file allocation table (FAT). FAT is the nameofthe file system usedby DOSoperating systems(DOS and Windows95, aswell asWindows NT and OS/2, which support it). FAT file systems are characterized by the use of a file allocation table and clusters (or blocks). Clusters are the smallest unit of storage in a FAT file system. A cluster actually represents a fixed number of disk sectors. The FAT (File Allocation Table) is the heart of the file system. It is locatedin sector 2 of cylinder 0, head 1 (and is duplicated in another sectoras aprecaution in the event of an accident). This table records the numbers of the clusters that are used and where the files are located in the clusters. The FAT file system supportsdisks orpartitionsup to a maximum size of2GBbut only allows at most65,536 clusters. So, whatever the size of the partition or disk, there must be enough sectors per cluster so that the entire disk space can be contained in these 65,525 clusters. As a result, the larger the disk (or partition), the greater the number of sectors per cluster. The FAT file system uses a root directory (represented on the operating systems that use this type of file system by the symbol C:), which must be located at a specific location on the hard drive. This root directory stores information on the sub-directories and files that it contains. For a file, it will store the file name, the file size, the date and time the file was last modified, the file attributes, and the cluster number at which the file starts. USING MULTIPLE PARTITIONS As mentioned before, there are three types of partitions: primary partitions, extended partitions and logical drives. A disk may contain up to four primary partitions (only one of which can be active), or three primary partitions and oneextendedpartition. In the extendedpartition, the usercancreate logical drives (i.e. create the impression that there are several smaller-sized hard drives). PRIMARY PARTITIONS A primary partition must be logically formatted and have a file system appropriate to the operating system installed on it. If you have several primary partitions on your disk, only one will be active and visible at a time, depending on the operating system with which you started the computer. By choosing which operating to load at start- Operating system Associated file system DOS FAT16 Windows XP NTFS Windows 98 FAT32 Windows 95 FAT16 - FAT32 (for version OSR2) Windows NT NTFS OS/2 HPFS Linux Linux Ext2, Linux Ext3
  • 14. up, you determine which partition will be visible. The active partition is the partition from which one of the operating systems was loaded when the computer was started up. The partitions, other than the one from which you started, will then be hidden, which will prevent their data from being accessible. The data on a primary partition are therefore only accessible from the operating system installed on that partition. Extended partition Extended partitions were developed to overcome the limit of four primary partitions, as you can create as many logical drives as you want in them. At least one logical drive is required in an extended partition, as you cannot store data in them directly. Many machines are formatted with one large partition using up all available space on the drive. This is not, however, the most advantageous solution in terms of performance and capacity. The solution is to create several partitions, which will allow you to install several operating systems on your disk, save disk space, increase file security, and organize your data more easily. (vi)How to enter BIOS configuration 1. Hold and press [Shift] then turn off the system. 2. Press and hold the F2 button then click the power button. DO NOT RELEASE the F2 button until the BIOS screen display. 3. You can find the BIOS configuration. 2. Linux, Some of its important commands and Ubuntu.
  • 15. (i) Linux is a family of free and open-source software operating systems built around the Linux kernel. Typically, Linux is packaged in a form known as a Linux distribution (or distro for short) for both desktop and server use. The defining component of a Linux distribution is the Linux kernel,[11] an operating system kernel first released on September 17, 1991, by Linus Torvalds.[12][13][14] Many Linux distributions use the word "Linux" in their name. The Free Software Foundation uses the name GNU/Linux to refer to the operating system family, as well as specific distributions, to emphasize that most Linux distributions are not just the Linux kernel, and that they have in common not only the kernel, but also numerous utilities and libraries, a large proportion of which are from the GNU project. This has led to some controversy.[15][16] Linux was originally developed for personal computers based on the Intel x86 architecture, but has since been ported to more platforms than any other operating system. Because of the dominance of the Linux kernel-based Android OS on smartphones, Linux hasthe largest installed base ofall general-purposeoperatingsystems.[18] Linuxisalso the leading operating system on servers and other big iron systems such as mainframe computers, and the only OS used on TOP500 supercomputers (since November 2017, having before gradually eliminated all competitors). It is used by around 2.3% of desktop computers. The Chromebook, which runs the Linux kernel- based Chrome OS, dominates the US K–12 education market and represents nearly 20% of the sub- $300 notebook salesin the US. Linuxalso runson embeddedsystems, i.e. devices whose operatingsystem is typically built into the firmware and is highly tailored to the system. This includes TiVo and similar DVR devices, network routers, facility automation controls, televisions, video game consoles and smartwatches. Many smartphones and tablet computers run Android and other Linux derivatives. The development of Linux is one of the most prominent examples of free and open- source software collaboration. The underlying source code may be used, modified and distributed— commercially or non-commercially—by anyone under the terms of its respective licenses, such as the GNU General Public License.
  • 16. (ii) Some important Linux commands: S.NO. COMMAND ITS FUNCTION 1. Sudo su - Sudo first asks for your password and if it is provided it runds the next command as a root user and a root user in linux system has the maximum permissions and can do anything to the system. 2. init 0 To shutdown 3. init 6 To restart 4. apt-get install To install new packages 5. apt-cache search<term> To search for packages 6. ps –A ps –A |grep <name> To kill the process of given name 7. apt-get purge libappstream 3 If there is any error in apt-get command 8. apt-get update Its only update the installed packages 9. Apt-get purge<name> It removes all the traces of given name 10. Clear It clears the terminal screen Some of the most popular and mainstream Linux distributions are Arch Linux, CentOS, Debian, Fedora, Gentoo Linux, Linux Mint, Mageia, openSUSE and Ubuntu, together with commercial distributions such as Red Hat Enterprise Linux and SUSE Linux Enterprise Server. Distributions include the Linux kernel, supporting utilities and libraries, many of which are provided by the GNU Project, and usually a large amount of application software to fulfil the distribution's intended use. Desktop Linux distributions include a windowing system, such as X11, Mir or a Wayland implementation, and an accompanying desktop environment such as GNOME or KDE Plasma; some distributions may also include a less resource-intensive desktop, such as LXDE or Xfce. Distributions intended to run on servers may omit all graphical environments from the standard install, and instead include other software to set up and operate a solution stack such as LAMP. Because Linux is freely redistributable, anyone may create a distribution for any intended use.
  • 17. ---- Open A Linux Terminal Using Ctrl + Alt + T (iii) Ubuntu: Ubuntu is a complete Linux operating system, freely available with both community and professional support. The Ubuntu community is built on the ideas enshrined in the Ubuntu Manifesto: that software should be available free of charge, that software tools should be usable by people in their local language and despite any disabilities, and that people should have the freedom to customize and alter their software in whatever way they see fit.  Ubuntu will always be free of charge, and there is no extra fee for the “enterprise edition”, we make our very best work available to everyone on the same Free terms.  Ubuntu includes the very best in translations and accessibility infrastructure that the Free Software community has to offer, to make Ubuntu usable by as many people as possible.  Ubuntu is shipped in stable and regular release cycles; a new release will be shipped every six months. You can use the current stable release or the current development release. A release will be supported for 18 months.  Ubuntu is entirely committed to the principles of open source software development; we encourage people to use open source softw are, improve it and pass it on.
  • 18. 3. Some Basic Networking Concepts IP addressa unique string of numbers separated by full stops that identifies each computer using the Internet Protocol to communicate over a network. 4. RaspberryPi and Its Various Models The Raspberry Pi is a series of small single-board ultimate and affordable computers. It is an ultra-low- cost ($20-$35) credit-card sized Linux computer. It may be operated with any generic USB computer keyboard and mouse. It may also be used with USB storage, USB to MIDI converters, and virtually any other device/component with USB capabilities. Other peripherals can be attached through the various pins and connectors on the surface of the Raspberry Pi. Addressing Internet address Consists of 4 bytes separated by periods Example: 136.102.233.49 -The R first bytes (R= 1,2,3) correspond to the network address; -The remaining H bytes (H = 3,2,1) are used for the host machine. -InterNIC Register: organizationin chargeoftheallocation of the address ranges corresponding to networks. -Criteria considered: → Geographical area (country) → Organization, enterprise → Department → Host Domain Name System (DNS) -Mnemonic textual addressesareprovidedto facilitate the manipulation of internet addresses. -DNS servers are responsible for translating mnemonic textual Internet addresses into hard numeric Internet addresses. 4 Ports -An IP address identifies a host machine on the Internet. -An IP port will identify a specific application running on an Internet host machine. -A port is identified by a number, the port number. -The number of ports is not functionally limited, in contrast to serial communications where only 4 ports are allowed. -There are some port numbers which are dedicated for specific applications. APPLICATIONS PORT NUMBER HTTP 80 FTP 20 and 21 Gopher 70 SMTP (e-mail) 25 POP3 (e-mail) 110 Telnet 23 Introduction -A network can be defined as a group of computers and other devices connected in some ways so as to be able to exchange data. -Each of the devices on the network can be thought of as a node; each node has a unique address. -Addresses are numeric quantities that are easy for computers to work with, but not for humans to remember. Example: 204.160.241.98 -Some networks also provide names that humans can more easily remember than n umbers. Example: www.javasoft.com, corresponding to the above numeric address. NIC addr1 NIC addrN NIC addr2 …
  • 19. Raspberry pi 3 model B Raspberry pi 2 model B Raspberry pi- model B+ Raspberry pi- model A+ Ethernet Port Yes Yes Yes No GPU Videocore IV Videocore IV Videocore IV Videocore IV Processor Speed 1.2GHz Quad-core processor 900MHz Quad core processor 700MHz Single core processor 700MHz Single core processor Wi-Fi Built-in No No No Bluetooth LE Built in No No No Storage Micro SD Micro SD Micro SD Micro SD Processor Chipset RAM 1 GB SDRAM of 400MHz 1 GB SDRAM of 400MHz 512 MB SDRAM of 400MHz 256 MB SDRAM of 400MHz GPIO 40 Pin 40 Pin 40 Pin 40 Pin USB 2.0 4 x USB Port 4 x USB Port 4 x USB Port 1 x USB Port Maximum power draw/voltage The maximum power is about 2.5A and voltage is 5V The maximum power is 1.8A and voltage is about 5V. The maximum power is 1.8A and voltage is about 5V. The maximum power is 1.8A and voltage is about 5V. Different Types of Raspberry Pi Models. The different types of raspberry pi models are following:  Raspberry Pi 1 model B  Raspberry Pi 1 model A  Raspberry Pi 1 model B+  Raspberry Pi 1model A+  Raspberry Pi Zero
  • 20.  Raspberry Pi 2  Raspberry Pi 3 model B  Raspberry Pi Zero W Raspberry Pi 1 model B+ This model B+ is replaced in the place of raspberry pi model B in the year 2014. Model B+ Rpi is compared with the model B it has. Raspberry Pi 1 model B+ More GPIO: The GPIO model B+ has 40 pins while retaining the same pinout for the first 26 pins as the Model A and B. More USB: It has 4 USB 2.0 ports, compared to 2 on the Model B, and better hotplug and overcurrent behavior. Micro SD: The old friction-fit SD card socket has been replaced with a much nicer push-push micro SD version. Lower Power Consumption: In thelow powerconsumption thelinear regulatorsarereplacedby switching one and it will reduce the power consumption by between 0.5W and 1W. Better Audio: The audio circuit has a dedicated low-noise power supply. Neater Form Factor: With the broad edges the USB connections are arranged and the video is moved composite with the 3.5mm jack. There are four squarely-placed maintaining holes.
  • 21. Raspberry Pi Zero: It is ahalf size of the modelA+ with twice a utility andforany project, it has the samespecification like 1GHz, Single-core CPU, 512MBRAM, Mini-HDMI port, Micro-USB OTG port, Micro-USB power,HAT-compatible 40- pin header, Composite video and reset headers, CSI camera connector (v1.3 only). The following image shows the raspberry pi zero. Raspberry Pi Zero Raspberry Pi 2: The basic image of the raspberry pi 2 is following and the features of the raspberry pi 2 are it has quad-core ARM cortex-A7 processor with a 900MHz, the SDRAM is about the 1GB. It is completely compatible with the raspberry pi 1. Raspberry Pi 2
  • 22. Raspberry Pi Model B It is a higher-spec variant of raspberry pi. After this design of this raspberry pi, it has extended to the next model i.e. raspberry pi 2. The specifications of the raspberry pi model B are following, the raspberry pi model B has two USB ports, having a RAM of 512MB and its Ethernet port is 100mb. The basic image of the raspberry pi model is shown in the following. Raspberry pi model B 5. Installation of operating system of raspberry pi The Foundation provides Raspbian, a Debian-based Linux distribution for download, as well as third party Ubuntu, Windows 10 IOT Core, RISC OS, and specialized media center distributions. It promotes Python and Scratch as the main programming language, with support for many other languages.
  • 23. If you order a Raspberry Pi without an SD card preloaded with New Out of Box Software (NOOBS), you will need to provide your own SD card and manually install an operating system. There are two ways to install Raspberry Pi: ● Noobs ● Raspbian Raspbian is the foundation’s official supported Operating System based on Debian. You can install it with NOOBS that is an easy installer for Raspbian or can download it from the image by following the installation guide. (i)INSTALLING OPERATING SYSTEM WITH NOOBS: New Out of Box Software (NOOBS) is an easy operating system installation manager for Raspberry Pi. HOW TO GET NOOBS: ➢ Buy a pre-installed SD card- SD cards with NOOBS preinstalled are available from many of our distributors and independent retailers, including Pimoroni, Adafruit, and Pi Hut. ➢ Download- Alternatively, NOOBS is available for download on the Raspberry Pi website:raspberrypi.org/downloads ● NOOBS is an easy operating system installer which contains Raspbian. It also provides a selection of alternative operating systems which are then downloaded from the internet and installed. ● NOOBS Lite contains the same operating system installer without Raspbian pre-loaded. It provides the same operating system selection menu allowing Raspbian and other images to be downloaded and installed.
  • 24. LATEST NOOBS RELEASE: The latest NOOBS release is v2.4.0, released on 10th April 2017. HOW TO FORMAT AN SD CARD: For Windows users, it is recommended to format the SD card using the SD Formatter Tool. You will need to set "FORMAT SIZE ADJUSTMENT" option to "ON" in the "Options" menu to ensure that the entire SD card volume is formatted, and not just a single partition. The updated size will be shown after the format is complete. WRITING NOOBS TO AN SD CARD: Once you've downloaded the NOOBS zip file, you'll need to copy the contents to a formatted SD card on your computer. To set up a blank SD card with NOOBS: 1. Format an SD card. 2. Download and extract the files from the NOOBS zip file. 3. Copy the extracted files onto the SD card that you just formatted, so that this file is at the root directory of the SD card. Please note that in some cases it may extract the files into a folder; if this is the case, then please copy across the files from inside the folder rather than the folder itself. 4. On first boot, the "RECOVERY" FAT partition will be automatically resized to a minimum, and a list of OSes that are available to install will be displayed. WHAT’S INCLUDED IN NOOBS: The following operating systems are currently included in NOOBS: ➢ Raspbian ➢ Pidora ➢ LibreELEC ➢ OSMC ➢ RISC OS ➢ Arch Linux As of NOOBS v1.3.10 (September 2014), only Raspbian is installed by default in NOOBS. The others can be installed with a network connection.
  • 25. BOOTING FROM NOOBS AND INSTALLING RASPBIAN: Once the files have been copied over, insert the microSD card into your Raspberry Pi and then plug it into a power source. Connect the converter (HDMI to VJ) to it. A keyboard and mouse will be required to install an OS with NOOBS, as will a HDMI display. Raspberry Pi is connected to the Internet via Ethernet. You will be provided with a single option, once the installer has loaded. Now Reboot the raspberry pi and a Window appears as follows- You should check the box for Raspbian, and then click Install. 6.Configuring Raspberry Pi ● COMMAND LINE METHOD: Raspi-config is the Raspberry Pi configuration tool that targets Raspbian. It aims to provide the functionality to make the most common configuration changes. This may result in automated edits to /boot/config.txt and various standard Linux configuration files. Some options require a reboot to take effect. If you changed any of those, raspi-config will ask if you wish to reboot now when you select the <Finish> button.
  • 26. 7.RASPBERRY PI WEBCAM SERVER USING MOTION The Raspberry Pi is perfectly equipped to turn your USB based web cam into a fully functional IP web cam.This will allow you to create a webcam for your Raspberry Pi so that you can view it from any computer on the local network. COMPONENTS REQUIRED: ➢ Raspberry Pi with an Wheezy Raspbian installed and internet connection established. ➢ Webcam- ● PS3 Eye Camera ● Microsoft HD ➢ USB Powered Hub –We need a hub because the camera’s draw more power than the Raspberry pi 4. - ●Use ifconfig command. eth0 is used for the attached ethernet cable. > ifconfig eth0 ●If the above command doesn’t provide a valid IP then use ifdown to turn net off and ifup to turn it back on. To restart eth0: > ifdown eth0 > ifup eth0 > Ifconfig eth0 5. Connect to Your Pi by SSH Connection (PUTTY). Open up Putty and type in the IP address of your Pi and connect.'pi' & 'raspberry' is the default 'login as' and 'password' in Raspbian. HOW TO SETUP A RASPBERRY PI-WEBCAM SERVER: 1. Connect the USB camera to any one of the four available USB port. 2. Connect the ethernet cable aka LAN cable to your Pi and connect the other end to your router. Then Power Up the Raspberry Pi. 3. Know Your Raspberry Pi IP Address. To view it
  • 27. 6. It is always a good practice to update and upgrade the system as soon as you log in.To do it, enter in the commands- > sudo apt-get update > sudo apt-get upgrade 7. Now, we need to install the software, we are using a great little application called Motion, this will do a few things including accessing the USB cam, getting the images, and streaming them via a built in web server. As the name suggests it will also track and trigger events on motion been detected in the video frames. For installation, enter the following- > sudo apt-get install motion This will take a few minutes to download and install but once it has finished and takes you back to the command prompt we are ready to continue. 8. Now to make sure that the camera is correctly detected. Type in the command 'lsusb' and enter. You should see the name of your camera. But this will not exactly tell u that the camera is there so u have to go to > /dev/ type ls to check /dev/video0 or 1 or x present. Next we need to edit some of the configuration files so that the motion service will start on run up and be available on local network. First we will edit motion.conf file by- > sudo nano /etc/motion/motion.conf
  • 28. Then you have to change some settings in the .conf file. It might be difficult sometimes to find the settings but use 'ctrl + w' (Search) to find it. So follow the steps: ○ Make sure 'daemon' is ON. ○ Setup_mode OFF. ○ Set 'width' & 'height' to 640 & 480. ○ Set 'framerate' anywhere in between 15 to 30. ○ Auto_brightness ON. ○ Keep 'Stream_port' to 8081. ○ 'Stream_quality' should be 70. ○ 'Stream_localhost' to OFF. ○ 'Webcontrol_localhost' to OFF. ○ Set 'quality' to 80. ○ Set 'post_capture' to 5. ○ Press ctrl + x to exit. Type y to save and enter to confirm. To ensure that the motion service will actually start as a daemon we need to change another configuration setting, so enter the following: > sudo nano /etc/default/motion Set ' start_motion_daemon ' to yes. Save and exit. 9. Now make sure the camera is connected and run the following line: > sudo service motion start 10.If you need to stop the service, simply run the following command: > sudo service motion stop
  • 29. If the webpage isn’t loading try restarting the service.To do it enter- > sudo service motion start To make your server ready, enter the command- > sudo motion 11.With the service started you can now open a webpage on your normal computer and by going to the IP of the Raspberry pi on port 8081 (in the address bar) you should be able to view your webcam. 8.HOTSPOT The Raspberry Pi can connect to a Wi-Fi network using a USB dongle but using that same dongle you can also turn your Raspberry Pi into a wireless access point. Once set up correctly, this will allow other wireless devices to connect to your Pi and optionally you can route any traffic out through the Ethernet port and on to the internet (via the router from your ISP). WHAT DO YOU NEED: ● Any Raspberry Pi, model B with power supply ● A boot SD card for the Raspberry Pi. ● A USB WiFi device that supports "Access Point" mode; the Raspberry Pi 3 has a built-in AP Wi-Fi module. ● An Ethernet cable to connect to the local network.
  • 30. HOW DOES IT WORK: The Raspberry Pi is configured as a WiFi Hotspot, just like you would see in an internet cafe. It allows you to connect to the internet over WiFi using the Raspberry Pi as the bridge to the internet. The basic steps are- ● Enable a WiFi Access Point and broadcast on the channel of your choice ● Assign dynamic IP addresses to any device that connects to WiFi network ● Join the WiFi and Ethernet networks together by using Network Address Translation INSTRUCTIONS: To configure a hotspot requires several steps: 1. Configure the wireless adapter with a static IP address 2. Install and configure a DHCP server 3. Install and configure the access point daemon 4. Configure IP routing between the wireless and Ethernet In this example, the wireless network will use the address range 10.x.x.x and the wired Ethernet will use the address range 172.168.1.x. 1. Configure the wireless adapter with a static IP address: Edit “/etc/network/interfaces” and add the static IP address information for wlan0. > sudo nano /etc/network/interfaces Place a “#” sign in front of all the lines which mention wlan0 and wpa, except for “allow hotplug wlan0“. Then add the following lines to the file: ○ iface wlan0 inet static ○ address 10.0.0.1 ○ netmask 255.0 .0.0 The bottom half of the file will now look something like this: Press ctrl + x to exit. Type y to save and enter to confirm. Now, reboot- > init 6 2. Install and configure a DHCP server:
  • 31. To install the DHCP server, run either of the two commands given below- > sudo apt-get install isc-dhcp-server > sudo apt-get install udhcpd You can safely ignore any errors about not being able to start the DHCP server at this point. Now edit its configuration file: > sudo nano /etc/udhcpd.conf Edit the file /etc/udhcpd.conf and configure it like this: ○ start 10.0.0.4 #This is the range of IPs that the hotspot will give to client devices. ○ end 10.0.0.204 ○ interface wlan0 #The device UDHCP listens on. Add a “#” character in front of the “option domain-name” lines like this: #option domain-name "example.org"; #option domain-name-servers ns1.example.org, ns2.example.org; Remove the “#” sign in front of the “authoritative;” statement like this: # If this DHCP server is the official DHCP server for the local # network, the authoritative directive should be uncommented. Authoritative; At the bottom of the file add the following lines: ○ opt dns 10.0.0.1 172.16.20.20 #The DNS servers client devices will use. ○ opt subnet 255.0.0.0 ○ opt router 10.0.0.1 #The Pi's IP address on wlan0 which we will set up shortly. ○ opt lease 864000 #10 day DHCP lease time in seconds
  • 32. Exit from nano with Ctrl + X. Make thewireless adapter the default for the DHCP request by- > sudo nano /etc/default/udhcpd To enable the DHCP change: DHCPD_ENABLED="no" to #DHCPD_ENABLED="no" Exit from nano with “Ctrl + X”. Restart the DHCP server- > sudo service udhcpd restart 3. Install and configure the access point daemon: Install hostapd by running the command- > sudo apt-get install hostapd Edit the hostapd configuration file and create a wireless network: > sudo nano /etc/hostapd/hostapd.conf Add the following lines: ○ interface=wlan0 ○ driver=nl80211 #driver=rtl871xdrv ○ ssid=MyPi ○ hw_mode=g ○ channel=6 ○ macaddr_acl=0 ○ auth_algs=1 ○ ignore_broadcast_ssid=0 ○ wpa=2 ○ wpa_passphrase=raspberry ○ wpa_key_mgmt=WPA-PSK ○ #wpa_pairwise=TKIP #Do not use this weak encryption (only used by old client devices) ○ rsn_pairwise=CCMP This will create a password protected network called ‘MyPi’ on channel 6 with the password ‘raspberry’. If you would like to create an open network, put the following text instead of the above one- ○ interface=wlan0 ○ ssid=My_AP ○ hw_mode=g ○ channel=6 ○ auth_algs=1 ○ wmm_enabled=0 In addition the built-in Raspberry Pi 3 Wi-Fi module seems to require the following additional parameters- ○ ieee80211n=1 # 802.11n support ○ wmm_enabled=1 # QoS support
  • 33. ○ ht_capab=[HT40][SHORT-GI-20][DSSS_CCK-40] Tell hostapd where to find its configuration file by setting the default location- > sudo nano /etc/default/hostapd Remove the “#” in front of “DAEMON_CONF” and alter the line to read: DAEMON_CONF="/etc/hostapd/hostapd.conf” 4. Configure IP routing between the wireless and Ethernet: Configure NAT (Network Address Translation). NAT is a technique that allows several devices to use a single connection to the internet. Linux supports NAT using Netfilter (also known as iptables) and is fairly easy to set up. First, enable IP forwarding in the kernel- > sudosh -c "echo 1 > /proc/sys/net/ipv4/ip_forward" To set this up automatically on boot, edit “/etc/sysctl.conf”by- > sudo nano /etc/sysctl.conf Find the line which reads “Uncomment the next line to enable packet forwarding for IPv4” and uncomment the next line like this: Second, enable NAT in the kernel or to turn the Pi into a router run the following commands one by one: > sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE > sudo iptables -A FORWARD -i eth0 -o wlan0 -m state --stateRELATED,ESTABLISHED -j ACCEPT > sudo iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPT These instructions don't give a good solution for rerouting https and for URLs referring to a page inside a domain, like www.nu.nl/38274.htm. The user will see a 404 error. Your Pi is now NAT-ing. To make this permanent so you don't have to run the commands after each reboot, save the routing tables into the file “/etc/iptables.ipv4.nat” by- > sudosh -c "iptables-save > /etc/iptables.ipv4.nat" Now, edit “/etc/network/interfaces“ using the command- > sudo nano /etc/network/interfaces And add the following line to the end of the file. This line will restore the routing table whenever the Pi is booted: ● pre-up iptables-restore < /etc/iptables.ipv4.nat Your Pi should now be hosting a wireless hotspot. To get the hotspot to start on boot, run these additional commands: > sudo update-rc.dhostapd enable > sudo update-rc.dudhcpd enable You should now reboot your Pi and test the wireless access using a laptop, smartphone, tablet or other Wi-Fi enabled device.
  • 35. WinSCP (Windows Secure Copy) is a free and open-sourceSFTP, FTP, WebDAV and SCP client for Microsoft Windows. Its main function is secure file transfer between a local and a remote computer. Beyond this, WinSCP offers basic file manager and file synchronization functionality. For secure transfers, it uses Secure Shell (SSH) and supports the SCP protocol in addition to SFTP. My version:2013-02-09-wheezy-raspbian Download WinSCP here:http://winscp.net/eng/download.php If you boot for the wheezy-raspbian for the first time, enable SSH on the raspi-config screen. Or if you want to get into the config screen again, enter > sudoraspi-config INSTALLATION: 1. Open the installation program by double clicking on its icon. 2. If your Windows language is not supported by the installer, select an alternative language you want to use (both for installation and later when using WinSCP).
  • 36. 3. On the License Agreement screen click Accept after reviewing the license. 4. You will be prompted to select a setup type. For a basic setup, choose Typical installation. 5. Then you will be prompted for Initial User Settings. This allows you to select user interface style. If you have used (and enjoyed) file managers like Total Commander, Altap Salamander or Norton Commander before, keep default Commander interface. Otherwise you will probably be more familiar with Explorer interface. 6. After you select the interface, the Ready to Install screen opens. On this screen, you can review the installation options you’ve selected. Click Install to start the installation. 7. A brief installation process will take place. You may have to restart Windows Explorer or your computer. If you choose not to restart, some WinSCP functions may not be available until you do so. CONNECTING: Start WinSCP. Login Dialog wil l appear. On the dialog:
  • 37. ● Select your File protocol. When you are about to use FTPS protocol, select FTP and then choose one of the FTPS invocation methods. ● Enter your host name to Host name field, username to User name and password to Password ● You may want to save your session details to a site so you do not need to type them in every time you want to connect. Press Save button and type site name. ● Press Login to connect. Once you are logged in, you’ll be presented with a dual-pane session window. The left side of the screen is your local computer and the right side is your Raspberry pi. You may copy files between the two systems by simply dragging and dropping them between the panes ie you’re now able to visually manage your remote filesystem using WinSCP.
  • 38. 10.SECURESHELL (SSH): SSH is a secure network protocol for data communication. Via SSH, you can access the command line of a Raspberry Pi remotely from another computer or device on the same network. Also, you can quickly copy text or files across to your Pi's command line instead of typing it all out. You need two computers - a server (your desktop) and a client (the Raspberry Pi). The steps to logging into your Raspberry Pi's console from another PC or laptop are - 1. Give your Raspberry Pi a Static IP: To log in to your Raspberry Pi remotely, you'll need the IP of the Raspberry Pi – this tells the host computer where to look for it on the network. By default, the Raspberry Pi will be given an IP automatically by the router (called Dynamic IP) when you connect to a network. However, this can change whenever you remove the Pi from the network e.g. turn it off. It's therefore very useful is the IP never changes, hence a 'static' IP. Use the following command to grab your Pi's current IP. > Ifconfig The address you need is the inet address as shown
  • 39. 2. Enable SSH: Raspbian has the SSH server disabled by default. It can be enabled manually from the desktop: ➢ Launch Raspberry Pi Configuration from the Preferences menu ➢ Navigate to the Interfaces tab ➢ Select Enabled next to SSH ➢ Click OK Alternatively, raspi-config can be used: ➢ Enter sudoraspi-config in a terminal window ➢ Select Interfacing Options ➢ Navigate to and select SSH ➢ Choose Yes ➢ Select Ok ➢ Choose Finish sshpi@192.168.2.# : ➢ Open the Terminal window and on the command line, type the above command. ➢ Once the local IP address of the RPi has been found, the above command can be used to establish an SSH connection using the default username/password combination of "pi" and "raspberry". 3. Install the SSH client on your computer: Download an SSH client to your computer. We are going to use Putty, which is an SSH and telnet client, developed originally by Simon Tatham for the Windows platform. It is open source software that is available with source
  • 40. code and is developed and supported by a group of volunteers. Putty is great for generally browsing around your Pi's folders and copying files to or from a Windows PC. Follow the link below to download putty: http://www.putty.org/ It's stand alone, so requires no installation, just download it and open the program! First of all, you might want to change some settings. If you're used to Windows click mouse controls e.g. right click opens menu to copy and paste, then change the settings to those in the picture below. Then, simply type your Raspberry Pi's IP address (the "inetaddr" that we defined statically earlier). It's best to save these settings so you won't need to type in the IP address everytime you want to connect. Just type a name under "Saved Sessions" and hit "Save" once you've inputted the correct IP. The first time you log in, you'll get a security message. Simply hit yes and continue - you should be relatively sure that you're accessing the correct device!
  • 41. Now log into your raspberry pi as usual. Login: pi Password: power That's it! You can now type, copy and paste commands and generally screw around on your Raspberry Pi's command line!
  • 42. 11.INTRODUCTION TO GPIO AND PHYSICAL COMPUTING ON THE RASPBERRY PI Pinout! The comprehensive GPIO Pinout guide for the Raspberry Pi. This GPIO Pinout is designed to be both a quick and interactive reference to the Raspberry Pi GPIO pins, plus a comprehensive guide to your Raspberry Pi's GPIO interfaces. It also includes dozens of pinouts for Raspberry Pi add-on boards, HATs and pHATs. Support Pinout.xyz On Patreon If you love Pinout, please help me fund new features and improvements. Head on over to Patreon.com/gadgetoid. A $1 pledge will make all the difference! Thank you. pHAT Stack Pinout has teamed up with Pimoroni to create a prototype board compatibility tool, check it out here! Explore HATs &pHATs We've added a board explorer! Use it to find the pinout for a Raspberry Pi add-on board, or discover new ones. If you manufacture boards, we'd love to add yours too. You can contribute over on GitHub. What do these numbers mean?  BCM - Broadcom pin number, commonly called "GPIO", these are the ones you probably want to use with RPi.GPIO and GPIO Zero  WiringPi - Wiring Pi pin number (shown as a tooltip), for Gordon Henderson's Wiring Pi library  Physical - Number corresponding to the pin's physical location on the header  Rev 1 Pi - Alternate BCM numbers for the original, 26-pin model "A" and "B" Pi Graphical Pinout We've whipped up a simple graphical Raspberry Pi GPIO Pinout. Feel free to print, embed, share or hotlink this image and don't forget to credit us!
  • 43. One powerful feature of the Raspberry Pi is the row of 40 GPIO (general purpose input/output) pins along the top edge of the board in the models A+, B+, raspberry Pi 2B and 3B. Similarly in the models A and B, there are 26 GPIO (general purpose input/output) pins along the edge of the board, next to the yellow video out socket in.
  • 44. These pins are a physical interface between the Pi and the outside world. At the simplest level, you can think of them as switches that you can turn on or off (input) or that the Pi can turn on or off (output). Seventeen of the 26 pins are GPIO pins; the others are power or ground pins. WHAT ARE THEY FOR? WHAT CAN I DO WITH THEM?
  • 45. The GPIO pins allow the Raspberry Pi to control and monitor the outside world by being connected to electronic circuits. The Pi is able to control LEDs, turning them on or off, run motors, and many other things. It's also able to detect whether a switch has been pressed, the temperature, and light. We refer to this as physical computing. You can program the pins to interact in amazing ways with the real world. Inputs don't have to come from a physical switch; it could be input from a sensor or a signal from another computer or device, for example. The output can also do anything, from turning on an LED to sending a signal or data to another device. If the Raspberry Pi is on a network, you can control devices that are attached to it from anywhere and those devices can send data back. Connectivity and control of physical devices over the internet is a powerful and exciting thing, and the Raspberry Pi is ideal for this. HOW THE GPIO PINS WORK: ● Output - If you follow the instructions, then messing about with the GPIO is safe and fun. Randomly plugging wires and power sources into your Pi, however, may kill it. Bad things can also happen if you try to connect things to your Pi that use a lot of power; LEDs are fine, motors are not. When we use a GPIO pin as an output, each pin can turn on or off, or go HIGH or LOW in computing terms. When the pin is HIGH it outputs 3.3 volts (3v3); when the pin is LOW it is off. Here's the circuit using the Raspberry Pi. The LED is connected to a GPIO pin (which can output +3v3) and a ground pin (which is 0v and acts like the negative terminal of the battery):
  • 46. The next step is to write a program to tell the pin to go HIGH or LOW. ● Input - GPIO outputs are easy; they are on or off, HIGH or LOW, 3v3 or 0v. Inputs are a bit trickier because of the way that digital devices work. Detect the pin being at HIGH or LOW – we can connect switches and simple sensors to a pin and check whether it is open or closed (that is, activated or not) RPI GPIO AS A DATA BUS: The first thing to get your head around, is how is data moved around the RPi, or in any general purpose computer. In the most general sense in electronics, a bus or data bus is used to move data words of any type from one place to another. Computing is based on data words made up of collections of data bits. These “words” can contain as few as four data bits and often much larger. The task of a bus designer is to devise circuitry that passes these data words from one circuit to another. These words can be communicated serially (i.e. serial communications) or in parallel. Parallel communication was commonly used in earlier system buses, whereas serial communications are prevalent in modern computers. ● Serial Bus: The least expensive method in terms of wire cost is to send the bits one at a time over a single pair of wires. This is called serial data transmission. Data words start as sets of bits that exist in parallel. In order to ship these words on a serial basis they must be converted to a serial stream of bits at the transmit end and then reconverted to a parallel word at the receive end. The common name for the circuitry that does this conversion is a SerDes circuit which stands for serializer/deserializer. Integrated circuits are more expensive when they have more pins. To reduce the number of pins in a package, many ICs use a serial bus to transfer data when speed is not important. Some examples of such low-cost serial buses include Serial Peripheral Interface (SPI), Inter-Integrated Circuit(I²C), UNI/O, and 1-Wire.
  • 47. As the name implies, GPIO pins can be configured through software to provide some specific function or purpose within the hardware device design. The GPIO pins connect directly into the core of the processor, and the Raspberry Pi developers implemented several alternate functions for the GPIO pins. Several are desirable because of the multiple standards and types of devices you may wish to interface. On boot-up, theRPi board GPIO is in alternate function state “ALT0” and will support I2C, SPI, and UART. This is shown below: It can be confusing to call the RPi’s whole 26 pin array GPIO and also some specific pins GPIO. In reality, all the GPIO pins can be reconfigured to provide alternate functions. I2C, SPI, and UART are the heart of our quest to understand RPi’s serial communications capability. Via their exposure on the GPIO pins, these capabilities are what can be used to integrate things like LCD displays to the RPi. Now lets dive deeper into each one of them. ● Universal Asynchronous Receiver/Transmitter (UART):
  • 48. The Universal Asynchronous Receiver/Transmitter (UART) takes bytes of data and transmits the individual bits in a sequential fashion. The Raspberry Pi actually has two UARTs. One UART is part of the internal ARM architecture of the Broadcom BCM2835 chip, in the core of the Raspberry Pi and not accessible externally. The other UART is sometimes called the RPi’s “Serial Port” (even thou the USB supports serial communications, and therefore a serial port). The serial port being reference here is serviced by a UART, sometime referred to as the “Mini-UART” since it doesn’t appear to be very rich in functionality. It is basically be used as a console port for access to the Raspberry Pi. The serial console is a convenient way to interact with the Raspberry Pi for debugging or your network is down and it is the destination of console messages (including boot-up messages). From the Raspberry Pi pinout the serial port on the Pi is on GPIO Pin 14 (TX) and GPIO Pin 15 (RX): Since the GPIO pins give access to the Mini UART, you can establish a serial console, which can be used to log in to the Pi, and many other things. However, normal console device communicate with -12V (logical “1″) and +12V (logical “0″) RS-232, which may just fry something in the 3.3V Pi. You can reconfigure the RPi so that the Mini UART isn’t acting as a serial console and use it for outer purposes (e.g. communicate with an attached Arduino or Xbee). Again, keep in mind that RX and TX lines are available on the GPIOs but operate at 3.3 volts. You’ll need a board or cable to level convert 3.3volt UART signals to connect with other devices (e.g. RS-232, USB). ● Serial Peripheral Interface Bus (SPI) -- aka 4-Wire Serial Bus: The Serial Peripheral Interface Bus or SPI bus is a synchronous serial data link standard, named by Motorola, that operates in full duplex mode. SPI is much simpler than I2C. Master and slave are linked by three data wires, usually called MISO, (Master in, Slave out), MOSI (Master out, Slave in), the SCLK clock line (sometimes called M-CLK), and an optional SS (Slave Select; sometimes known as the Chip Select or CS line or Chip Enable or CE line) is the slave select or chip select line. Its optional only if you have one slave, otherwise one or more SS lines are provided. The Raspberry Pi has two Slave Select lines: CE0 and CE1.
  • 49. Usually the transfer sequence consist of driving the SS line low, sending X number of clock signals with the proper polarity and phase, then driving the SS line high to end the communication. As the clock signals are generated, data is transferred in both directions, therefore in a “transmit only” system the received bytes have to be discarded and in a “receive only” system a dummy byte has to be transmitted. Many SPI-enabled ICs and Microcontrollers can cope with data rates of over 10 MHz, so transfer is much faster than with I2C. Since it is synchronous communications, it is not limited to 8-bit words so you can send any message sizes with arbitrary content and purpose. The SPI interface does not require pull-up resistors, which translates to lower power consumption. The downside is that SPI normally has no addressing capability; instead, devices are selected by means of a SS signal which the master can use to enable one slave out of several connected to the SPI bus. If more than one slave exists, one chip select line is required per device, which can use precious GPIO lines on the Master. ● Inter-Integrated Circuit (I2C) — aka 2-Wire Serial Bus: Inter-Integrated Circuit or I2C is generically referred to as a “two-wire interface”. It’s a multi-master serial single- ended computer bus invented by Philips that is used to attach low-speed peripherals to a motherboard, embedded system, or other electronic devices. I2C is a particularly useful bus with the for two main reasons: 1. It only requires two shared lines: SCL for the clock signal, and SDA for the bidirectional data transfers.
  • 50. 2. Each I2C device uses a unique 7-bit address, meaning you can have more than 120 unique I2C devices sharing the bus, and you can freely communicate with them one at a time on an as-needed basis. I2C can be used to connect up to 127 nodes via a bus has two data wires, called SCL and SDA. SCL is the clock line. It is used to synchronize all data transfers over the I2C bus. SDA is the data line. Of course, there is a third wire being ground. There may also be a 5 volt wire to distribute power to the devices. Both SCL and SDA lines are “open drain” drivers. What this means is that the chip can drive its output low, but it cannot drive it high. For the line to be able to go high you must provide pull-up resistors to the 5v supply. There should be a resistor from the SCL line to the 5v line and another from the SDA line to the 5v line. The value of the resistors is not critical. Anything from 1800 ohms to 47K ohms used (1.8K, 47K and 10K are common values). You only need one set of pull-up resistors for the whole I2C bus, not for each device, as illustrated below: The advantage of i2c is that it only uses two pins on the Pi (plus power and ground) to communicate with a lot of different devices. One pin carries a clock signal, and the other carries the data. When data is being sent on the SDA line, clock pulses are sent on the SCL line to keep master and slave synchronised. Since the data is sent one bit at a time, the data transfer rate is one eighth of the clock rate. The original standard specified a standard clock rate of 100KHz, and most I2C chips and micro-controllers can support this. Later updates to the standard introduced a fast speed of 400 KHz and a high speed of 1.7 or 3.4 MHz. The Arduino and Raspberry Pi can support standard and fast speeds. The fast rate corresponds to a data transfer rate of 50K bytes/sec which is too slow for some control applications. One option in that case is to use SPI instead of I2C. ● 1-Wire — aka 1-Wire Serial Bus:
  • 51. On a 1-Wire bus, a single master device communicates with one or more 1-Wire slave devices over a single data line, which can also be used to provide power to the slave devices. Devices drawing power from the 1-wire bus are said to be operating in parasitic power mode. When operating in parasite power mode, only two wires are required: one data wire, and ground. At the master, a 4.7k pull-up resistor must be connected to the 1-wire bus. With an external supply, three wires are required: the bus wire, ground, and power. The 4.7k pull-up resistor is still required on the bus wire. Each 1-Wire device contains a unique 64-bit code, consisting of an 8-bit family code, a 48-bit serial number, and an 8-bit CRC. Before sending a command to a slave device, the master must first select that device using its code. How do you use I2C, SPI, UART, or 1-Wire on the Raspberry Pi? Now that we know the what & why for serial communications options on the Raspberry Pi, how do we use them? This topic deserves technical details and examples but this post has already run too long. I’m likely to do some specific implementation in the future, but for now I’ll reference some sources of information on the web. First, lets be clear about the RPi software distribution I’m using, since not all will be supporting all these serial communications options. I’m using Adafruit’s Occidentalis distribution (based on “Wheezy”) which comes with hardware SPI, I2C, and 1-wire support. In the Occidentalis distribution, Adafruit has included in the Linux kernel the needed drivers. SPI and I2C has been implement on the GPIO pins as outline above. RPi doesn’t have a predetermined GPIO pin assignment for 1-Wire, but Adafruit choose GPIO pin 4 for 1-Wire. Note that this unassigned GPCLK0 (General Purpose Clock Voltage) function. Given you have the Occidentalis distribution, you can check on the installation of I2C, SPI, and 1-Wire via the following: 12.PYTHON PROGRAMMING BASICS AND INSTALLATION OF SUBLIME TEXT:
  • 52. PYTHON: Python is a widely used high-level programming language for general-purpose programming. It is a wonderful and powerful programming language that's easy to use (easy to read and write) and with Raspberry Pi lets you connect your project to the real world. An interpreted language, Python has a design philosophy which emphasizes code readability and a syntax which allows programmers to express concepts in fewer lines of code than might be used in languages such as C++ or Java. The language provides constructs intended to enable writing clear programs on both a small and large scale. Python also has a large collection of libraries, which speeds up the development process. There are libraries for everything you can think of – game programming, rendering graphics, GUI interfaces, web frameworks, and scientific computing. PIP: PIP is a recursive acronym that can stand for either "Pip Installs Packages" or "Pip Installs Python". It is a package management system used to install and manage software packages written in Python. Many packages can be found in the Python Package Index (PyPI). Most distributions of Python come with pip preinstalled. Like, Python 2.7.9 and later (on the python2 series), and Python 3.4 and later include pip (pip3 for Python 3) by default. If pip is missing, it can be installed through the system package manager. One major advantage of pip is the ease of its command-line interface, which makes installing Python software packages as easy as issuing one command- > pip install some-package-name Users can also easily remove the package- > pip uninstall some-package-name INSTALL PYTHON DEVELOPMENT TOOLS: To program the GPIO pins on Raspberry Pi with Python, there is a Raspberry Pi GPIO Python library that is made available. For this, open a terminal on the Raspberry Pi either via the desktop or by using SSH. (default credentials are pi/raspberry). Run the following commands to install some basic Python development tools: > sudo apt-get update > apt-get install python-dev python-pip > pip install python INSTALL GPIO LIBRARY:
  • 53. The RPi. GPIO Python library allows you to easily configure and read-write the input/output pins on the Pi’s GPIO header within a Python script. Thankfully this library is now including in the standard Raspbian image. If it is required to install the RPi GPIO library, there are two methods to install it- 1. Manual Installation: The package is available from https://pypi.python.org/pypi/RPi.GPIO . There will be a download button on the page as shown Right click on this and copy the link address. Further, in the terminal on the Raspberry Pi, paste the link address in the following command to download the library- > wget link address This downloads the RPi.GPIO-0.6.3.tar.gz file. Extract the tar file to a new folder- > tar -zxvf RPi.GPIO-0.6.3.tar.gz Browse to the new directory i.e. into the above folder by- > cd RPi.GPIO-0.6.3 and install the setup file- > sudo python setup.py install 2. Install from repository: If the package exists in the Raspbian repository is can be installed using apt-get. First you need to update the available package versions: > sudo apt-get update Then attempt to install the RPi.GPIOpackage: > apt-get install python-rpi.gpio If it isn’t already installed it will be installed. If it is already installed it will be upgraded if a newer version is available. Usually now, the default Raspbian image include the RPi.GPIO library but we would like to install a newer version to get access to newer API for callbacks. This can be done by using- > sudo pip install --upgrade RPi.GPIO SUBLIME TEXT Sublime Text is a proprietary cross-platform source code editor with a Python application programming interface (API). It natively supports many programming languages and markup languages, and functions can be added by users with plugins, typically community-built and maintained under free-software licenses.
  • 54. Sublime Text 3 (ST3) is lightweight, cross-platform code editor known for its speed, ease of use, and strong community support. It’s an incredible editor right out of the box, but the real power comes from the ability to enhance its functionality using Package Control and creating custom settings. We’ll look at how to setup Sublime Text for full stack Python development (from the front to back), enhance the basic functionality with custom themes and packages, and use many of the commands, features, and keyword shortcuts that make ST3 so powerful. INSTALLATION: 1. Download the installer from https://www.sublimetext.com/3. 2. Install the software. 3. Then, paste the following crack in the Help menu → Enter License. —– BEGIN LICENSE —– Michael Barnes Single User License EA7E-821385 8A353C41 872A0D5C DF9B2950 AFF6F667 C458EA6D 8EA3C286 98D 1D650 131A97AB AA919AEC EF20E143 B361B1E7 4C8B7F04 B085E65E 2F5F5360 8489D422 FB8FC1AA 93F6323C FD7F7544 3F39C318 D95E6480 FCCC7561 8A4A1741 68FA4223 ADCEDE07 200C25BE DBBC4855 C4CFB774 C5EC138C 0FEC1CEF D9DCECEC D3A5DAD1 01316C36 —— END LICENSE —— CONFIGURATION: Open winscp and connect to Pi via IP address and username and password. Then go to tools (shown in left of winscp) --> Preferences --> editors. When we go to editors there are two options to select, one is Notepad and other is Internal Memory. Choose either of one option.
  • 55. Then select edit option and go to external editor. Finally, browse the path in which your sublime text 3 is placed in your PC. After this WinSCP opens. Go to raspberry pi folder and you want to name your folder in your pi. Then you right click in pi folder and go to new and then directory. Name your folder name and select permissions and according to your permissions octal code has been sent. In these permissions, R- Read W-Write X-Executable
  • 56. PROGRAMMING WITH PYTHON ON RASPBERRY PI: You can write a Python file in a standard editor like Sublime or Nano, and run it as a Python script from the command line. pi@raspberrypi ~ $ This (above) is the command prompt. A CLI or command line interface is actually a very quick and efficient way to use a computer. To start, just navigate to the directory where the file is saved (use cd and ls for guidance). TIP: You can use the TAB key for autocomplete as you enter commands. Then, run the program (e.g. hello) with python using the command > python hello.py ● Few commands which we are going to use in PYTHON program: ○ import RPi.GPIO as GPIO We are going to import GPIO file from library, above function enables us to program GPIO pins of PI. We are also renaming “RPi.GPIO” to “GPIO”, so in the program whenever we want to refer to GPIO pins we will use the word ‘GPIO’. ○ GPIO.setwarnings (False) Sometimes, when the GPIO pins, which we are trying to use, might be doing some other functions. In that case, we will receive warnings while executing the program. Below command tells the PI to ignore the warnings and proceed with the program. ○ GPIO.setmode (GPIO.BCM) We can refer the GPIO pins of PI, either by pin number on board or by their function number. In pin diagram, you can see ‘PIN 35’ on the board is ‘GPIO 19’. So we tell here either we are going to represent the pin here by ‘35’ or ‘19’. ○ GPIO.setup(19,GPIO.IN)
  • 57. We can set the GPIO pins as input or output pins using setup command. As shown below we are setting GPIO 19 (or PIN 35) as output pin. We will get PWM output from this pin. ○ While 1 It is used for infinity loop. With this command the statements inside this loop will be executed continuously. 1. import RPi.GPIO as GPIO # import RPi.GPIO module 2. GPIO.setmode(GPIO.BCM) # choose BCM or BOARD 3. GPIO.setup(port_or_pin, GPIO.IN) # set a port/pin as an input 4. GPIO.setup(port_or_pin, GPIO.OUT) # set a port/pin as an output 5. GPIO.output(port_or_pin, 1) # set an output port/pin value to 1/HIGH/True 6. GPIO.output(port_or_pin, 0) # set an output port/pin value to 0/LOW/False 7. i = GPIO.input(port_or_pin) # read status of pin/port and assign to variable i SIMPLE INPUT/OUTPUT WITH RPI AND PYTHON: After the above program is executed from nano file, pin 17 goes low i.e. LED connected to pin 17 becomes OFF while those connected to pins 27 and 22 are switched ON. SIMPLE INPUT/OUTPUT WITH DELAY:
  • 58. When the above program is executed the output of LED’s change after a delay of 0.5 sec to a new state and then again after a delay of 1.5 sec. SIMPLE INPUT/OUTPUT WITH LOOP: Using While loop makes the program to run continuously till Ctrl+C is pressed. Initially pins 17, 27 and 22 are set to zero. When the loop starts, the output on pins change after 1s first and then again after 1.5 sec continuously. MAKE A PYTHON FILE EXECUTABLE: Making a Python program executable allows you to run the program without entering python before the file name. You can make a file executable by entering this at the command prompt: > chmod +x file-name.py Now to run the program, all you need to enter is: > ./file-name.py
  • 59. INPUT SWITCH: The quintessential LED blinking program is as shown below. The circuit for the switch connected to the GPIO pin can be of the following two ways. The output on LED will be according to the circuit used. We have assumed that you have connected a breadboard, LED, resistor to the Raspberry Pi GPIO and below is the simple program in which the switch - switches the LED on when the button is pressed and switches it off again when the button is released.
  • 60. Every 0.1s, this program checks the switch status - ● if not pressed (input port 25 == 1), button status is displayed and the LED is switched off (output port 24 is set to 0) ● Otherwise,if pressed (input port 25 == 1), button status is displayed and the LED is switched on (output port 24 is set to 1) It keeps going until CTRL+C is pressed. In the above program, if the delay is not provided you will probably notice that it printed many times for just a single press. This may sometimes be what you want if you’re monitoring something which changes state continuously, but for a button we’re probably only interested in seeing each press as one event. This means we’re only interested when our switch changes from being low to being high. A little extra problem will be that this will actually happen several times in a very brief period for a button press, as the inside of the switch will act like a tiny spring. This is called bouncing. Hence a delay should be provided in such a case. 13. PULSE WIDTHMODULATION PWM stands for ‘Pulse Width Modulation’. Pulse Width Modulation (or PWM) is a technique for controlling power and is used for used for getting variable voltage out of constant power supply. We will generate PWM signal from Raspberry Pi and demonstrate the PWM by varying the brightness of a LED, connected to Pi.There are two important parameters that determine PWM- 1. Frequency 2. Duty cycle Frequency: Frequency, in Hertz (Hz) is the number of times per second that a pulse is generated. This counts from the start of one pulse to the start of the next. i.e. from when the pulse starts to rise, to the next time it starts to rise. So it includes all the “on” time and “off” time and “in between” time for one complete wave cycle.
  • 61. Duty Cycle: The amount of time the PWM pin is high within each cycle is called the duty cycle. Also, it is the proportion for which the LED is ON over the total time and can be calculated as follows: Duty Cycle =Turn ON time/ (Turn ON time + Turn OFF time) In above figure, if the switch is closed continuously over a period of time, the LED will be ‘ON’ during this time continuously. If the switch is closed for half second and opened for next half second, then LED will be ON only in the first half second. Duty Cycle = (0.5/ (0.5+0.5)) = 50% So the average output voltage will be 50% of the battery voltage. This is the case for one second and we can see the LED being OFF for half second and LED being ON the other half second. If Frequency of ON and OFF times increased from ‘1 per second’ to ’50 per second’.
  • 62. We will program the Pi for getting a PWM and connect a LED to show its working. To create a PWM instance: ○ p= GPIO.PWM (channel,frequency) The above command is for setting up the channel and also for setting up the frequency of the PWM signal. ‘P’ here is a variable it can be anything. To start PWM signal generation: ○ p.start(dc) # where dc is the duty cycle (0.0 <= dc <= 100.0) To change the frequency: ○ p.ChangeFrequency(freq) # where freq is the new frequency in Hz To change the duty cycle: ○ p.ChangeDutyCycle(dc) # where 0.0 <= dc <= 100.0 To stop PWM: ○ p.stop() Note that PWM will also stop if the instance variable 'p' goes out of scope.
  • 63. When you’re done, don’t forget to cleanup with GPIO.cleanup(), then hit CTRL+Z to exit the Python live environment. With the program below being executed, the duty cycle of PWM signal increases. With an LED attached to this PIN, brightness of LED increases.
  • 64. The above program can be modified by using a switch. Below is the simple program in which the switch controls the brightness of the LED.
  • 65.
  • 66. 14.SENSORS A sensor is a device that measures a physical quantity and converts it into a 'signal' which can be read by an observer or by an instrument. One of the many advantages of the Raspberry Pi is that it is possible to connect almost all standard Arduino and Raspberry Pi sensors and components to the various GPIOs. Moreover you can evaluate and / or process the values with programs and other software. This accessory can be used in projects such as Smart Home (home automation), robot kits or weather stations, etc.
  • 67. DHT11 ● Low cost ($5.00) ● 3 to 5V power and I/O ● 2.5mA max current use during conversion (while requesting data) ● Good for 20-80% humidity readings with 5% accuracy ● Good for 0-50°C temperature readings ±2°C accuracy ● No more than 1 Hz sampling rate (once every second) ● Body size 15.5mm x 12mm x 5.5mm ● 4 pins with 0.1" spacing CONNECTING THE DHT11 TO THE RASPBERRY PI: It is fairly easy to connect up to the DHT sensors. They have four pins VCC (3 to 5V power), Data out, Not connected and Ground. Simply ignore pin 3, it’s not used. You will want to place a 10K resistor between VCC and the data pin, to act as a medium-strength pull up on the data line. For DHT11 and DHT22 sensors, don't forget to connect a 4.7K - 10K resistor from the data pin to VCC DHT 11 The DHT11 is a basic, ultra low-cost digital temperature and humidity sensor. It uses a capacitive humidity sensor and a thermistor to measure the surrounding air, and spits out a digital signal on the data pin (no analog input pins needed). Its fairly simple to use, but requires careful timing to grab data. The only real downside of this sensor is you can only get new data from it once every 2 seconds, so when using our library, sensor readings can be up to 2 seconds old. There are two variants of the DHT11 you’re likely to come across. One is a three pin PCB mounted module and the other is a four pin stand-alone module. The pinout is different for each one, so connect the DHT11 according to which one you have: DHT22 The DHT22 is a basic, low-cost digital temperature and humidity sensor. It uses a capacitive humidity sensor and a thermistor to measure the surrounding air, and spits out a digital signal on the data pin (no analog input pins needed). Its fairly simple to use, but requires careful timing to grab data. The only real downside of this sensor is you can only get new data from it once every 2 seconds, so when using our library, sensor readings can be up to 2 seconds old. Compared to the DHT11, this sensor is more precise, more accurate and works in a bigger range of temperature/humidity, but its larger and more expensive. It comes with a 4.7K - 10K resistor, which you will want to use as a pullup from the data pin to VCC. AM2302 The AM2302 is a wired version of the DHT22, in a large plastic body. It is a basic, low-cost digital temperature and humidity sensor. It uses a capacitive humidity sensor and a thermistor to measure the surrounding air, and spits out a digital signal on the data pin (no analog input pins needed). Its fairly simple to use, but requires careful timing to grab data. The only real downside of this sensor is you can only get new data from it once every 2 seconds, so when using our library, sensor readings can be up to 2 seconds old. Compared to the DHT11, this sensor is more precise, more accurate and works in a bigger range of temperature/humidity, but its larger and more expensive.
  • 68. DHT22 ● Low cost ($9.95) ● 3 to 5V power and I/O ● 2.5mA max current use during conversion (while requesting data) ● Good for 0-100% humidity readings with 2-5% accuracy ● Good for -40 to 125°C temperature readings ±0.5°C accuracy ● No more than 0.5 Hz sampling rate (once every 2 seconds) ● Body size 15.1mm x 25mm x 7.7mm ● 4 pins with 0.1" spacing ● Weight (just the DHT22): 2.4g CONNECTING THE DHT22 TO THE RASPBERRY PI: As shown in the diagram below, the DHT22 requires Pin 1 to be connected to a 3.3V source, Pin 2 to the desired General-purpose input/output (GPIO) pin on the RPi, and Pin 4 to ground (GND). A 10kΩ resistor is placed between Pin 1 and Pin 2. Pin 3 in not used.
  • 69. AM230 2 ● Low cost$15.00 ● 3 to 5V power and I/O ● 2.5mA max current use during conversion (while requesting data) ● Good for 0-100% humidity readings with 2-5% accuracy ● Good for -40 to 80°C temperature readings ±0.5°C accuracy ● No more than 0.5 Hz sampling rate (once every 2 seconds) ● Body size 27mm x 59mm x 13.5mm (1.05" x 2.32" x 0.53") ● 3 wires 23cm long (9") ● 27mm wide x 58.75mm tall x 13.30mm deep CONNECTING THE AM2302 TO THE RASPBERRY PI: The AM2302 sensor has three wires that need to be connected to Pi pins. Red wire connects to a 3.3V source, Black wire connects to ground and Yellow wire connects to to the desired General-purpose input/output (GPIO) pin on the RPi(just make note of which one as we need to know which pin to listen on) ● The Serial Peripheral Interface (SPI) standard provides a way for digital devices to share data serially. ● The Inter-integrated Circuit (I2C) standard was developed to attach peripheral ICs to microcontrollers. SOFTWARE INSTALL (UPDATED): The guys over at Adafruit have provided some software to interface with the sensor, which is available on githubhttps://github.com/adafruit/Adafruit_Python_DHT. We use some C code to talk to the DHT sensors since they require extremely fast timing to read, and then wrap the C code in a simple Python library for easy integration into your own programs. DOWNLOADING THE CODE FROM GITHUB: The easiest way to get the code onto your Pi or Beaglebone Black is to hook up an Ethernet cable, and clone it directly using 'git', which is installed by default on most distros (or can be done by using command apt-get install git). Simply run the following commands from an appropriate location (ex. "/home/pi") - git clone https://github.com/adafruit/Adafruit_Python_DHT.git cd Adafruit_Python_DHT INSTALLING THE ADAFRUIT PYTHON DHT SENSOR LIBRARY: With the wiring is complete, download the Adafruit’s DHT library to the RPi, which is required to read the temperature and humidity values from the sensor. To install the Python library on either the Raspberry Pi or Beaglebone Black you will first need a few dependencies. Execute the following command to install these dependencies (assuming you're using Raspbian on the Pi and Debian on the Beaglebone Black): sudo apt-get update sudo apt-get install build-essential python-dev python-openssl
  • 70. If you see an error that a package is already installed or at the latest version, don't worry you can ignore it and move on.Next, to install the library execute: > sudo python setup.py install This should compile the code for the library and install it on your device so any Python program can access the Adafruit_DHT python module. TESTING THE LIBRARY: To test the Python library, you can run some of the example programs in the examples folder present in Adafruit, Python_DHT. The AdafruitDHT.py example is a simple program which takes from the command line parameters the type of sensor (11, 22, or 2302) and GPIO pin connected to the sensor, and displays a single reading from the sensor. First navigate to the examples folder by executing: > cd examples > ls Now, examine the source codes of the programs (like ‘simpletest’ and ‘google spreadsheet’) in Nano editor to see simple examples of reading the DHT sensors from Python code. SIMPLE TEST: Edit the program in Nano as shown below. Use while loop for it to run continuously. > nano simpletest.py Run the program- > python simpletest.py After the program executes you should see both the temperature and humidity displayed once. If you see an error that the sensor could not be read, double check you have the right GPIO pin connected to the data line of the DHT sensor.
  • 71. 15.GOOGLE SPREADSHEET: With Google spreadsheet program, readings from the sensors can be recorded online in a Google spreadsheet. For this, you need your ‘json file name’ and the ‘google spreadsheet name’. How to create a JSON file: JSON stands for JavaScript Object Notation. JSON is a lightweight data-interchange format. It is a minimal, readable format for structuring data and is used primarily to transmit data between a server and web application 1. Head to Google Developers Console and create a new project. 2. From at the top left corner, go to the Dashboard in the API Manager. Click on ‘Enable API’. 3. Select Drive API and then enable it. 4. Go to “Credentials” and choose “Create Credentials > Service Account Key”.
  • 72. 5. Create New Service Account. Select the role ‘Owner’ and the ‘JSON’ key type. 6. Click on Create and you will automatically download a JSON file with this. This is how this file may look like: Create and Prepare Spreadsheet: 1. First up you will need to sign up for Google Docs and create a spreadsheet.
  • 73. 2. Once you've created it, delete all but one line (since we don't want 1000 empty rows) First up we will have to install the gspread python library, which will do the heavy lifting of connecting to google docs and updating the spreadsheet. With your board connected and online, run the following: sudo apt-get update
  • 74. sudo apt-get install python-pip sudo pip install gspread oauth2client Next, in the examples directory again, edit google_spreadsheet.py and adjust the configuration values towards the top of the file. > nano google_spreadsheet.py Set GDOCS_SPREADSHEET_NAME to the name of your spreadsheet and the GDOCS_OAUTH_JSON to the name of the .json file. Make sure DHT_TYPE is set to the type of sensor you are using (either Adafruit_DHT.DHT11, Adafruit_DHT.DHT22, or Adafruit_DHT.AM2302), and DHT_PIN is set to the GPIO pin number which is connected to your DHT sensor. Save the file. Now, place the created .json file in the same directory as the google_spreadsheet.py example. If you don't place this file in the same directory then authentication will fail and you will not be able to update your spreadsheet.
  • 75. One last step that must be completed is to share your Google spreadsheet to the email address associated with the OAuth2 credentials. Open the .json file and search for the "client_email": Take note of that email address value and go to your Google spreadsheet in a web browser. Using the File -> Share... menu item share the spreadsheet with read and write access to the email address found above. Make sure to share your spreadsheet or you will not be able to update it with the script. Execute the Python script by running - > python google_spreadsheet.py
  • 76. You should see the program run and after about 5 seconds a humidity and temperature measurement is displayed and written to the spreadsheet. The program will continue to run and log a measurement until you force it to quit by pressing Ctrl+C. The measurement frequency can be adjusted by changing the FREQUENCY_SECONDS configuration in the python code.Open the spreadsheet on Google's site and you should see measurements added in real time. The same can be seen in the form of graphs as shown below- 16. MY DEVICES MyDevices is an Internet of Things solutions company. It accelerates IoT development and empower enterprises to quickly design, prototype, and commercialize IoT solutions. To accomplish the mission to simplify the connected world, it created Cayenne – the world’s first drag-and drop IoT project builder that empowers developers to quickly create and host their connected device projects. Cayenne was designed for the Internet of Things. It can control hardware remotely, it can display sensor data, it can store data, analyze and do many other cool things. There are several major components in the platform: ● Cayenne App – setup and control your IoT projects with drag and drop widgets from an app. ● Cayenne Online Dashboard – Use a browser to setup and control your IoT projects. ● Cayenne Cloud – responsible for processing and storage of device, user and sensor data for commands, actions, triggers and alerts. ● Cayenne Agent – enables communication with the server, agent and hardware for implementing incoming and outgoing commands, actions, triggers and alerts. Every time you press a button from the Cayenne app or online dashboard, it travels to the Cayenne Cloud where it’s processed and finds its way to your hardware. It works the same in the opposite direction. You can use the Cayenne mobile app or online dashboard, it’s up to you. Any changes you make to hardware from the mobile app are reflected when viewing the online dashboard and vice versa. FEATURES OF CAYENNE: ● Connection using Ethernet, Wi-Fi and cellular (mobile app only) ● Discover and setup Raspberry Pis on a network (Ethernet or Wi-Fi only) ● Customizable dashboard with drag and drop widgets ● Remotely access, reboot and shutdown a Pi ● Add and control sensors, actuators and extensions connected to Raspberry Pis ● Configure triggers for Pis, sensors and actuators ● Setup and receive threshold alerts via email and text messages ● Monitor device and sensor history data ● Remotely test and and configure hardware using GPIO ● Schedule events to occur on connected hardware and devices
  • 77. GETTING STARTED: The process of installing Cayenne onto the Raspberry Pi is pretty simple. You will need to make sure you have Raspbian installed on your Pi or else first install it from https://www.raspberrypi.org/downloads/. The steps are: 1. Firstly, head over tomydevices.com. 2. Click on Get Started and and sign up for a free account. 3. Select Raspberry pi and click next. 4. Power on your Raspberry pi and connect it to internet via your LAN cable. 5. Connect the Pi up to the account you just created. To do this simply copy the 2 command lines shown after you sign up. Enter these into the terminal for your Pi. (These files are unique for every new install)
  • 78. Alternatively, you can download the app and it can automatically locate & install Cayenne onto your Pi.(Keep in mind SSH needs to be enabled) The first wget command installs a package and the second command will run shell script here which you brought from the first wget command. > Wget link > sh rpi_b8w8pn82i9.sh -v 6. It will take a few minutes to install onto your Pi depending on how fast your internet connection is. The device will reboot and the web browser or app should automatically update with information on the installation process. 7. Once installed the dashboard will display and should look like something below. 8. Now, configuration of the device like the device name and device icon etc can be done. 9. Finally set up your sensor. The sensor that is used here is called DS18B20. DS18B20 DESCRIPTION: This sealed digital temperature probe lets you precisely measure temperatures in wet environments with a simple 1-Wire interface. The DS18B20 provides 9 to 12-bit (configurable) temperature readings over a 1-Wire interface, so that only one wire (and ground) needs to be connected from a central microprocessor. While the sensor is good up to 125°C the cable is jacketed in PVC so we suggest keeping it under 100°C. Because they are digital, you don't get any signal degradation even over long distances. These 1-wire digital temperature sensors are fairly precise (±0.5°C over much of the range) and can give up to 12 bits of precision from the onboard digital- to- analog converter. They work great with any microcontroller using a single digital pin, and you can even connect multiple ones to the same pin, each one has a unique 64-bit ID burned in at the factory to differentiate them.
  • 79. The only downside is they use the Dallas 1-Wire protocol, which is somewhat complex, and requires a bunch of code to parse out the communication. We toss in a 4.7k resistor, which is required as a pullup from the DATA to VCC line when using the sensor. TECHNICAL DETAILS: Not for use in salt water or other corrosive environments. Cable specs: ● Stainless steel tube 6mm diameter by 30mm long ● Cable is 36" long / 91cm, 4mm diameter ● Contains DS18B20 temperature sensor DS18B20 Technical specs: ● Usable temperature range: -55 to 125°C (-67°F to +257°F) ● 9 to 12bit selectable resolution ● Uses 1-Wire interface- requires only one digital pin for communication ● Unique 64bit ID burned into chip ● Multiple sensors can share one pin ● ±0.5°C Accuracy from -10°C to +85°C ● Temperature-limit alarm system ● Query time is less than 750ms ● Usable with 3.0V to 5.5V power/data CONNECTING THE DHT22 TO THE RASPBERRY PI: If your sensor has four wires - Red connects to 3-5V, Black connects to ground and White is data. The copper wire is soldered to the wire shielding. If your sensor has three wires - Red connects to 3-5V, Blue/Black connects to ground and Yellow/White is data
  • 80. SETTING UP THE SENSOR: Now when you set this up the sensor, this can be automatically detected and added to your dashboard. However if it didn’t add automatically then you will need to add it manually. To add it manually simply, do the following - 1. Go to add new in the upper left corner of the dashboard. 2. Select device from the dropdown box. 3. Find the device, in this case it is a DS18B20 temperature sensor. 4. Add all the details for the device. 5. Once entered select add sensor. 6. The sensor should now be displayed on the dashboard. 7. If you need to customise your sensor press the cog and it will come up with some options. 8. You can also see stats/graphs. For example, the temperature sensor can plot data in real time and will keep historical data too.
  • 81. If you want to also add an LED that you can turn on & off via the dashboard follow the next few instructions. 1. Now let’s add one more device. Except this one will be an LED. 2. So go back to add new device. 3. Now search for digital output and select it. 4. For this device select your Pi, widget type is button, icon can be whatever you want, and then select integrated GPIO. Finally channel is the pin/channel that our LED is connected to. For this example it is pin #17. (This is the GPIO numbering of the pins). 5. Now press the add sensor button. 6. You can now turn the GPIO pin high & low from the dashboard and also use it in a trigger. 7. We’re now ready to set up our first trigger. You should now have two devices on your dashboard that should look something like this.
  • 82. 17. UBIDOTS Ubidots is an Internet of Things (IoT) data analytics and visualization company. ... sending and retrieving data to and from their cloud service in real-time. Ubidots' time-series backendservices are performance optimized ... manage data between PubNub and Ubidots using the customized PubNub BLOCK.
  • 83.
  • 84. 18. PARTICLE.IO Particle is an open source hardware/software platform for the Internet of Things. It is the fastest and easiest way to get your Internet of Things product up and running. It is an internet of things (IoT) startup, providing a platform for individuals and small businesses to create their own IoT devices. The company offers a range of hardware tools and cloud-based software, helping companies to link their connected devices to the web and collect data on product usage to improve functionality. PARTICLE POWERS THE INTERNET OF THINGS: IoT is hard. Particle makes it easy.Particle’s full-stack of Internet of Things(IoT) device platform gives you everything you need to securely and reliably connect your IoT devices to the web. Particle includes everything you need to deploy an IoT product: a device cloud platform, connectivity hardware, and even SIMs for cellular products. ➢ For using particle.io with the raspberry pi, first make an account in particle.io from build.particle.io . ➢ Now go todocs.particle.ioyou will see the following options - ● Photon ● Electron ● Core
  • 85. ● Raspberry pi PHOTON: Particle's Internet of Things hardware development kit, the Photon, provides everything you need to build a connected product. Particle combines a powerful ARM Cortex M3 microcontroller with a Broadcom Wifi chip in a tiny thumbnail-sized module called the PØ (P-zero). To get you started quickly, Particle adds a rock solid 3.3VDC SMPS power supply, RF and user interface components to the PØ on a small single-sided PCB called the Photon. ● Particle PØ Wi-Fi module ○ Broadcom BCM43362 Wi- Fi chip ○ 802.11b/g/n Wi- Fi ○ STM32F205RG Y6 120Mhz ARM Cortex M3 ○ 1MB flash, 128KB RAM ● On-board RGB status LED (ext. drive provided) ● 18 Mixed-signal GPIO and advanced peripherals ● Open source design ● Real-time operating system (FreeRTOS) ● Soft AP setup ● FCC, CE and IC certified
  • 86. ELECTRO N: The Electron is a tiny development kit for creating cellular- connected electronics projects and products. It comes with a SIM card (Nano 4FF) and an affordable data plan for low-bandwidth things. It also comes with Particle's development tools and cloud platform for managing and interacting with your new connected hardware. ● U-blox SARA- U260/U270 (3G) and G350 (2G) cellular module ● STM32F205RGT6 120MHz ARM Cortex M3 microcontroller ● 1MB flash, 128KB RAM ● BQ24195 power management unit and battery charger ● MAX17043 fuel gauge ● RGB status LED ● 30 mixed-signal GPIO and advanced peripherals ● Open source design ● Real-time operation system (RTOS) ● FCC, CE and IC certified CORE: Spark Core v1.0 uses the STM32F103CB - ARM 32-bit Cortex M3 based - microcontroller for its brain power Features: ● ARM 32-bit Cortex™-M3 CPU Core ● 72Mhz operating frequency, 1.25 DMIPS/MHz (Dhrystone 2.1) ● 128KB of Flash memory ● 20KB of SRAM ● 12 bit ADC USB 2.0 full-speed interface
  • 87. Particle Pi Beta: ease note that the Raspberry Pi integration with the Particle Cloud is currently in beta. Quick Install: Copy the following command shown on the docs.particle.io page - > bash <( curl -sL https://particle.io/install-pi ) What You'll Need In order to connect your Raspberry Pi to the Particle Cloud you'll need the following things. Note that these are all included in the Particle Pi Starter Kit with Raspberry Pi v3, which is available for purchase in the Particle Store. ● Raspberry Pi (Raspberry Pi v2 and v3 preferred) ● Power supply (5V, 2A+ preferred) ● Micro SD card and SD adapter ● Ethernet cable (for wired connections) If you do not have access to a wired network cable, you will need to connect your Pi to an active Wi-Fi network, which will require the following: ● Keyboard ● Mouse ● Monitor ● HDMI Cable (to connect Pi to your monitor) Your raspberry pi should be installed with the latest OS Raspbian. Then connect your Pi to the internet. There are two primary ways to connect your Raspberry Pi to the web--using a wired connection (Ethernet) or using a wireless connection (Wi-Fi preferred). Here we will use method using a wireless connection with LAN cable attached. Therefore, you will have to SSH (secure shell) into your Pi in order to install the Particle software. Install the Particle Agent: You will not be able to complete this step of the process if you have not already received your beta activation email.
  • 88. ● To connect your Raspberry pi to the Particle Cloud, you need to install the Particle Agent. The Particle Agent is a software service that runs in the background on the Raspberry Pi and allows you to write and run firmware (software that interacts with the GPIO pins on the Pi). Install the agent by pasting the command you copied earlier in a terminal on your Raspberry Pi. > bash <( curl -sL https://particle.io/install-pi ) When the installation is over, the Particle Agent setup will ask you to sign in to your Particle account. Control an LED With Particle App: Now install the application particle.io in your mobile phone using playstore. 1. Open Dash-Board and then Open Your "Raspberry Pi" on Device List. 2. Here, we are using D7 pin on Particle app that belongs to Pi 35 pin or GPIO19 so connect an LED to Pi pin 13 or GPIO19. 3. Set pins in Particle App. Click on D7 and Select pinMode. Here, we have digitalWrite. 4. Now Click on D7 button 5. We are Done! Look at your Pi.
  • 89.
  • 90. Turn OFF or ON the LED using the D7 button. That's all; you're now connected to the world's favorite low-cost computer now connects to the world's most popular IoT platform. IFTT You’ve no doubt heard of software as a service. Those who are deeply into IT will nod their heads in recognition when acronyms such as IaaS (infrastructure as a service) and PaaS (platform as a service) are tossed around, too. But here’s one “*aaS” you might not have heard of yet: everything as a service. And it’s the future, according to Linden Tibbets, CEO and co-founder of IFTTT. [ Further reading: 41 cool and useful IFTTT applets ] But what exactly is IFTTT? And how does it relate to the idea of everything as a service? Here’s what you need to know.
  • 91. What is IFTTT? Here are just three if this, then that automations you can run with IFTTT: * If you make a call on your Android phone, then a log of that call is added to a Google spreadsheet. * If you add a new task to your Amazon Alexa to-dos, then it will be added to your iOS Reminders app. * If the International Space Station passes over your house, then you’ll get a smartphone notification about it. (Yes, this is an actual IFTTT applet.) [ Take this mobile device management course from PluralSight and learn how to secure devices in your company without degrading the user experience. ] Currently, there are 54 million IFTTT applets, according to IFTTT. And for the record, Tibbets’ favorite applets include one that lets you quickly email notes to yourself and another that notifies you whenever a new Craigslist post matches your search terms. The history of IFTTT Tibbets and Jesse Tane co- founded IFTTT in 2010 and officially launched the service in 2011. Based in San Francisco, IFTTT has raised $39 million in venture capital funding from investors that include the firm Andreesen Horowitz, according to IFTTT . Tibbets is currently IFTTT’s CEO. Tane moved on from IFTTT in 2012. In November 2016, IFTTT beefed up its recipes, which connected two devices, apps or services, turning them into applets, which are capable of connecting multiple devices, apps or services. IFTTT derives its name from the programming conditional statement “if this, then that.” What the company provides is a software platform that connects apps, devices and services from different developers in order to trigger one or more automations involving those apps, devices and services.