Iot Unit-4
Iot Unit-4
Writing packages:
Packages are namespaces which contain multiple packages and modules themselves.
They are simply directories, but with a twist.
Each package in Python is a directory which MUST contain a special file called
__init__.py. This file can be empty, and it indicates that the directory it contains is a Python
package, so it can be imported the same way a module can be imported.
If we create a directory called foo, which marks the package name, we can then create a
module inside that package called bar. We also must not forget to add the __init__.py file
inside the foo directory.
script.py
IPython Shell.
UNIT – IV
IoT Physical Devices and Endpoints
MRITS/ECE/IV-I 66
INTERNET OF THINGS – LECTURE MATERIAL
IoT Device
A "Thing" in Internet of Things (IoT) can be any object that has a unique identifier and which
can send/receive data (including user data) over a network (e.g., smart phone, smart TV,
computer, refrigerator, car, etc.).
• IoT devices are connected to the Internet and send information about themselves or about their
surroundings (e.g. information sensed by the connected sensors) over a network (to other devices
or servers/storage) or allow actuation upon the physical entities/environment around them
remotely.
MRITS/ECE/IV-I 67
INTERNET OF THINGS – LECTURE MATERIAL
Raspberry Pi
MRITS/ECE/IV-I 68
INTERNET OF THINGS – LECTURE MATERIAL
Linux on Raspberry Pi
1. Raspbian: Raspbian Linux is a Debian Wheezy port optimized for RaspberryPi.
2. Arch: Arch is an Arch Linux port for AMDdevices.
3. Pidora: Pidora Linux is a Fedora Linux optimized for RaspberryPi.
4. RaspBMC: RaspBMC is an XBMC media-center distribution for RaspberryPi.
5. OpenELEC: OpenELEC is a fast and user-friendly XBMC media-centerdistribution.
6. RISC OS: RISC OS is a very fast and compact operatingsystem.
Raspberry Pi GPIO
Raspberry Pi Interfaces
MRITS/ECE/IV-I 69
INTERNET OF THINGS – LECTURE MATERIAL
1. Serial: The serial interface on Raspberry Pi has receive (Rx) and transmit (Tx) pins for
communication with serialperipherals.
2. SPI: Serial Peripheral Interface (SPI) is a synchronous serial data protocol used for
communicating with one or more peripheraldevices.
3. I2C: The I2C interface pins on Raspberry Pi allow you to connect hardware modules. I2C
interface allows synchronous data transfer with just two pins - SDA (data line) and SCL
(clockline).
UNIT V
MRITS/ECE/IV-I 70