IOT Lab Da 01

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 10

INTERNET OF THINGS FUNDAMENTALS

ECE 3501
LAB SLOT : L55+L56
PROF. SASIKUMAR.P
VELLORE INSTITUTE OF TECHNOLOGY
2021-2022
LAB TASK - 01

DINESH HANUMATH KUMAR


19BEC0355
Q1.) Using Browser to write and read the data in Thingspeak cloud.
AIM: Using Browser to write and read the data in ThingSpeak cloud.
SOFTWARE USED: ThingSpeak Software.
ThingSpeak Software: ThingSpeak is an IoT analytics platform service that allows
you to aggregate, visualize, and analyze live data streams in the cloud. You can send
data to ThingSpeak from your devices, create instant visualization of live data, and
send alerts. ThingSpeak has a simple interface that makes it easy to learn cloud
analytics and teach IoT. Then use ThingSpeak communities to provide support for
your cloud education curriculum. ThingSpeak also supports and integrates with
Arduino, RPI, and other hardware. ThingSpeak enables sensors, instruments, and
websites to send data to the cloud where it is stored in either a private or a public
channel. Once data is in a ThingSpeak channel, you can analyze and visualize it,
calculate new data, or interact with social media, web services, and other devices.
ThingSpeak is an API known among developers and already has a large community.
ThingSpeak API always works with channels, which contain data, location and status
fields. Features of ThingSpeak include real-time data collection, data processing,
visualizations, apps, and plugins. At the heart of ThingSpeak is a ThingSpeak
Channel. A channel is where you send your data to be stored. Each channel includes
8 fields for any type of data, 3 location fields, and 1 status field.
PROCEDURE:
1.) Go to ThingSpeak copy the URL of write in channel feed and paste it in the
browser.
2.) Go to ThingSpeak and click on public view you can see the data you entered in the
browser .
3.) For Reading(Accessing): Copy the read channel feed link URL and paste the link in
the browser.
4.) By default, at last results =2 and field =1 change it accordingly as per the need of
experiment.
5.) You will get the data of ThingSpeak channel.
OUTPUTS: (BROWSER SCREEN)
FOR WRITING DATA:

FOR READING DATA:(JSON)


FOR READING DATA: (RAW DATA)

THINGSPEAK CHANNEL:
Q2.) Using Python programming from desktop to access and Publish-
Data Using ThingSpeak cloud channel.
Ans.)
AIM: To use python programming from desktop to access and publish data in
ThingSpeak cloud channel.
SOFTWARE USED: ThingSpeak and Python.
ThingSpeak Software: ThingSpeak is an IoT analytics platform service that allows
you to aggregate, visualize, and analyze live data streams in the cloud. You can send
data to ThingSpeak from your devices, create instant visualization of live data, and
send alerts. ThingSpeak has a simple interface that makes it easy to learn cloud
analytics and teach IoT. Then use ThingSpeak communities to provide support for
your cloud education curriculum. An application programming interface (API) key is
a code used to identify and authenticate an application or user. API keys are
available through platforms, such as a white-labeled internal marketplace. They also
act as a unique identifier and provide a secret token for authentication purposes.
ThingSpeak also supports and integrates with Arduino, RPI, and other hardware.
ThingSpeak enables sensors, instruments, and websites to send data to the cloud
where it is stored in either a private or a public channel. Once data is in a ThingSpeak
channel, you can analyze and visualize it, calculate new data, or interact with social
media, web services, and other devices. ThingSpeak is an API known among
developers and already has a large community. ThingSpeak API always works with
channels, which contain data, location and status fields. Features of ThingSpeak
include real-time data collection, data processing, visualizations, apps, and plugins.
At the heart of ThingSpeak is a ThingSpeak Channel. A channel is where you send
your data to be stored. Each channel includes 8 fields for any type of data, 3 location
fields, and 1 status field. ThingSpeak is IoT Cloud platform where you can send
sensor data to the cloud. You can also analyze and visualize your data with MATLAB
or other software, including making your own applications. The ThingSpeak service
is operated by MathWorks.
PYTHON PROGRAM / LANGUAGE :
Python is an interpreted, object-oriented, high-level programming language with
dynamic semantics. Its high-level built in data structures, combined with dynamic
typing and dynamic binding, make it very attractive for Rapid Application
Development, as well as for use as a scripting or glue language to connect existing
components together. Python's simple, easy to learn syntax emphasizes readability
and therefore reduces the cost of program maintenance. Python supports modules
and packages, which encourages program modularity and code reuse. The Python
interpreter and the extensive standard library are available in source or binary form
without charge for all major platforms, and can be freely distributed.
Despite starting out as a hobby project named after Monty Python, Python is now
one of the most popular and widely used programming languages in the world.
Besides web and software development, Python is used for data analytics, machine
learning, and even design. Python is commonly used for developing websites and
software, task automation, data analysis, and data visualization. Since it's relatively
easy to learn, Python has been adopted by many non-programmers such as
accountants and scientists, for a variety of everyday tasks, like organizing finances.
Python's simple, easy to learn syntax emphasizes readability and therefore reduces
the cost of program maintenance. Python supports modules and packages, which
encourages program modularity and code reuse. The Python interpreter and the
extensive standard library are available in source or binary form without charge for
all major platforms, and can be freely distributed. Python itself, testifying to
Python's introspective power. On the other hand, often the quickest way to debug
a program is to add a few print statements to the source: the fast edit-test-debug
cycle makes this simple approach very effective. Python can be used for small tasks,
like powering a simple Reddit moderator bot, or executing extremely complex code,
like analyzing massive amounts of financial data for a hedge fund. For anyone from
corporate software engineers to casual coders, Python is a viable, accessible
programming language.
PROCEDURE:
1. Open python idle if you don’t have python please install it.
2. After opening python idle import necessary libraries.
3. Sign in to ThingSpeak platform.
4. Create one channel and make it public view.
5. Click on API keys.
6. Copy the write channel feed link URL and paste the link in the code of
python command of URL open...
7. If we want to change the field by default value of field is 1 so all the values
given will store till now stored in field 1 now change the value of field to 2.
8. Give print command you will get the link.
9. Give read command it shows the no of the data you inserted in channel.
10.Go to ThingSpeak and click on public view you can see the data you
entered in python command.
11.For Reading (Accessing): Copy the read channel feed link URL and
paste the link in the code of python command of URL open.
12.By default, at last results =2 and field =1 change it accordingly as per the
need of experiment.
13.Give print command and read command.
14.You will get the data of ThingSpeak channel in python as of you will get in
JSON.
OUTPUTS: (PYTHON )

THINGSPEAK API KEYS:


PYTHON PROGRAM FOR WRITING DATA:

PUBLIC VIEW GRAPH ( AS PER CHANGES IN URL):


PYTHON PROGRAM FOR READING THE DATA AND OUTPUT:

RESULT:
Thus, we use python programming from desktop to access and Publish data in
ThingSpeak cloud channel.

You might also like