UNIT IV
UNIT IV
Platform IoT
It is a cross-platform IoT IDE.
It comes with the integrated debugger.
It is the best for mobile app development and developers can use a friendly IoT
environment for development.
A developer can port the IDE on Atom editor or it can install it as a plugin.
It is compatible with more than 400 embedded boards and has more than 20
development frameworks and platforms.
It offers a remarkable interface and is easy to use.
Eclipse IoT
This tool or instrument allows the user to develop, adopt and promote open
source IoT technologies.
It is best suited to build IoT devices, Cloud platforms, and gateways.
Eclipse supports various projects related to IoT.
These projects include open-source implementations of IoT protocols, application
frameworks and services, and tools for using Lua programming language which is
promoted as the best-suited programming language for IoT.
Tessel 2
It is used to build basic IoT prototypes and applications.
It helps through its numerous modules and sensors.
Using Tessel 2 board, a developer can avail the following features
o Ethernet connectivity,
o Wi-Fi connectivity,
o two USB ports,
o a micro USB port,
o 32MB of Flash,
o 64MB of RAM.
Additional modules can also be integrated like cameras, accelerometers, RFID, GPS,
etc.
Tessel 2 can support Node.JS and can use the libraries of Node.JS.
Programming Language
Programming for IoT is usually a polyglot (multiple languages) effort since the
Internet-of-Things (IoT) is a system of inter-related computing devices that are
provided with unique identifiers and the ability to transfer data over a network.
The choice of programming-language depends on the capability and purpose of the
device.
IoT encompasses a variety of devices including edge devices, gateways, and cloud
servers.
The most popular languages in IoT are Java, C, C++, Python, JavaScript, Node.js,
Assembler, PHP, C#, Lua, R, Go, Ruby, Swift and Rust.
Debugging
The important technique to find and remove the number of errors or bugs or defects
in a program is called Debugging.
It is a multistep process in software development.
It involves identifying the bug, finding the source of the bug and correcting the
problem to make the program error-free.
Hardware
The Hardware development includes the following steps:
o Design the schematic circuit Diagram
o Make the required connections to the IoT Tools and other peripherals with the
help of jumper wires and cables with reference to the circuit diagram.
o Connect the power supply to the respective tool.
o Execute the program.
Openness
Openness is the technical method includes transparent Internet standards
development where someone can participate on a similar basis, and open
nonproprietary protocols that anyone can execute.
It supports more opportunity for variety of thought.
Figure 2: Openness in IoT Tools
Some of the benefits are transparency, convenience, and fast development resulting
in significant cost savings.
The most common openness types encountered in open IoT platforms is open-
source, open standards, open APIs, open data, and open layers.
Data encryption using TLS (Transport Layer Security) allows you to ensure data
security for sensitive data.
Reliable downloads of over-the-air update images will ensure frequent updates that
improve efficiency and device performance over time.
Library Description
RPi.GPIO Used to control the GPIO on a Raspberry Pi.
Not Suitable for real time data
gpiozero It allows the programmers control the GPIO pins by importing them directly at the start
of a code.
time It allows functionality like getting the current time, pausing the Program from executing,
etc.
machine It contains specific functions related to the hardware on a particular board.
Most functions in this module allow to achieve direct and unrestricted access to and
control of hardware blocks on a system (like CPU, timers, buses, etc.).
mraa Used for I2C,UART & SPI
Mysqldb Used to send data to the internet
Generating some predictions using ML
Numpy Used to read sensor data in bulk from my database and work on them using inbuilt
functions
Tkinter Used for GUI development
Used in situations such as functionality testing or repeated execution of the same code
OpenCv Used for image Processing
Some of the best solutions for implementing IoT in the Python programming language
are as follows:
o Python on Raspberry Pi
o Python on PyBoard
o ESP8266, ESP32 with Micro python
Python on Raspberry Pi
Python is pre-installed in the operating system, and the only objective left for us is to
write the coding script.
In Raspberry Pi, we can control the I/O ports on the expansion bar of the Raspberry
Pi.
Python on PyBoard
PyBoard runs Micro Python, a lightweight implementation of the standard Python
interpreter.
The Micro Python PyBoard is a compact electronic circuit board that runs Micro Python
on the bare metal, giving you a low-level Python operating system that can be used to
control all kinds of electronic projects.
The built-in pyb module contains functions and classes to control the peripherals
available on the board, such as UART, I2C, SPI, ADC, and DAC.
Below is an example of Micro Python Programming on PyBoard
import pyb
led = pyb.LED (4)
while True:
led.on()
pyb.delay(1000)
led.off()
pyb.delay(1000)