SlideShare une entreprise Scribd logo
1  sur  16
Serial Data from Arduino to Raspberry Pi
to MySQL using CoAP Protocol
By Deligence Technologies
www.deligence.com
Getting Serial Data from Arduino to Raspberry Pi and saving
it in MySQL database & Explaining how to run CoAP server
on Raspberry Pi -
In this tutorial I'm going to tell you how we can get the sensor
data from Arduino Uno and sending it to the Raspberry pi
through UART. Mostly We are going to do two important things.
First we will use a CoAP server For making a GET request which
will run on raspberry pi and in our CoAP browser we will get the
DHT22 data immediately. And the second thing is we are going
to make a mysql database in raspberry pi to store the value of
DHT22 sensor.
Constrained Application Protocol (CoAP) is an Internet Application Protocol for constrained
devices. It enables those constrained devices to communicate with the wider Internet using
similar protocols. CoAP is designed for use between Devices on the same constrained
network, between Devices and general nodes on the Internet, and between Devices on
different constrained networks both joined by an Internet.
CoAP is designed to easily translate to HTTP for simplified integration with the web, while
also meeting specialized requirements such as multicast support, very low overhead, and
simplicity.
CoAP supports the basic methods of GET, POST, PUT, DELETE, which are easily mapped to
HTTP.
Now here above was the brief description of CoAP. As I told you that you will get a lot of
things about CoAP but as far as interfacing with real hardware is concerned there are very
less stuff. So that's why I am going to tell you about this CoAP server and how we can interact
with real hardware.
1. In this step we will tell you that how we can run a CoAP server in our raspberry pi.
txThings Tutorial :
In this tutorial, we will describe how to run a CoAP server on Raspberry Pi, and run the CoAP
client on a PC. The CoAP server and clients are implemented using txThings, which is a
Phyton implementation of CoAP.
ABOUT TXTHINGS
txThings - CoAP library for Twisted framework
txThings is a Python implementation of Constrained Application Protocol (CoAP):
http://tools.ietf.org/html/rfc7252
txThings is based on Twisted - asynchronous I/O framework and networking engine written
in Python.
http://twistedmatrix.com/
txThings uses MIT License (like Twisted itself).
http://opensource.org/licenses/mit-license.php
Copyright (c) 2012 Maciej Wasilak
http://sixpinetrees.blogspot.com/
txThings has the following features:
 Support for draft-ietf-core-coap-13 - including automatic piggyback/separate response
handling. No caching support.
 Support for draft-ietf-core-block-12 (no support for server initiative though - waiting for
the resolution)
 Limited support for RFC6690 (Core Link Format) - server only.
Other nice things:
 txThings works nicely on RaspberryPi
 txThings is compatible with Kivy - brilliant new Python GUI library (I'll post some examples
soon).
 txThings is fully asynchronous (thanks to twisted framework)
txThings is posted on Github. The easiest way to get it is to clone the repository to your local
machine using the command below:
git clone git://github.com/siskin/txThings.git
Library contains CoAP code (inside "iot" directory) and three examples:
server.py - CoAP server that starts on localhost, port 5683 and hosts several resources
client_GET.py - example client which performs GET request to localhost, port 5683
client_PUT.py - example client which performs PUT request to localhost, port 5683
Client_GET and client_PUT both use port 61616 - to use them simultaneously change port
number in one of the clients. Server will send blockwise responses for default settings. To use
txThings you need Python 2.7 with Twisted installed (I suggest using the latest Twisted
version, but older releases also work - tested with 11.1).
1. Install OS on Raspberry Pi (set the appropriate raspi-config for all,including ssh and
desktop boot)
2. Install setup tools for python (such as pip)
https://pip.pypa.io/en/stable/installing.html#install-pip
3. Install Twisted on Raspberry Pi
sudo apt-get install python-pip
pip install twisted==15.1.0
4. Install txThings on Raspberry Pi
pip install txThings
2. Now this is the time to move on Arduino. Here I've connected DHT22 sensor to
an arduino and our arduino is connected to our raspberry pi(which is working here
as an IOT gateway or server ) through USB cable to one of its USB port. But before
going to connect Arduino to our raspberry pi we have to put a Arduino snippet for
DHT22 interfacing to our arduino. Since we are using Raspberry pi remotely in
ubuntu.
Connect your arduino to your PC to upload this code (Arduino code). Now just
unplug your arduino from PC and connect it to your pi.
3. Now we need to install some of the things to get data in raspberry pi
First one is Python-serial and then python-mysqldb.
Now this URI we have to type in Mozilla Firefox -
caop://<Raspberry pi IP Address>:5683
For that we need to do a little modification in our server.py code which we got while
installing txThings.
You just check your server.py code and edit accordingly. Now we need to run our server.py
code. It'll take a little time.
Here, you can see the temperature and humidity in Copper on firefox.
Humidity Temperature and Heat Index
The Copper (Cu) CoAP user-agent is an add-on for the Firefox Web browser. It allows
browsing, bookmarking, and direct interaction with CoAP resources. Simply enter a CoAP URI
into the address bar.
For getting the data in our smartphone we need to install Aneska. At the end section of the
video you can see how we can get data in our smartphone.
Humidity and Temperature In Smartphone
The Second Part of this Project is creating a Database of DHT22 Data
For that you have to install Apache Mysql and PHP and then save data in phpmyadmin.
You can easily get about these installation in many links. So I'm not going to demonstrate
that. In short you have to set up a LAMP server in your raspberry pi. I am assuming you have
install these necessary things.
So Let's get started -
• Go to localhost/phpmyadmin or <pi IP address>/phpmyadmin (if you are using pi remotely)
• Create Database give it some name
• Then create table for that
• I have made 6 columns
• For getting the data in database from arduino serial out we have to write a small script in
pi.
This is the script(You can find all the files in our github page -
https://github.com/DeligenceTechnologies/Serial-Data-from-Arduino-to-Raspberry-Pi-to-
MySQL-using-CoAP-Protocol) for getting data in mysql datbase from arduino.
If I run this script I can see the updated data in database but if we want this thing
automatically let's say for every single minute then we have to edit crontab -e
All the process Regarding this project is explained in our video that you can see in the slide
15.
Arduino Interfacing with DHT22 and connected to Pi with USB
Arduino Connection with DHT22
We at Deligence Technologies, offer a range of Arduino Software Development Services
to turn your design into a fully functional system.
Deligence Technologies - your growing technology partner!
www.deligence.com/contact-us
Email : info@deligence.com
Phone : +91 9910130340
Serial Data from Arduino to Raspberry Pi to MySQL using CoAP Protocol

Contenu connexe

Tendances

Sprytniejsze testowanie kodu java ze spock framework (zaawansowane techniki) ...
Sprytniejsze testowanie kodu java ze spock framework (zaawansowane techniki) ...Sprytniejsze testowanie kodu java ze spock framework (zaawansowane techniki) ...
Sprytniejsze testowanie kodu java ze spock framework (zaawansowane techniki) ...PROIDEA
 
Job Automation using Linux
Job Automation using LinuxJob Automation using Linux
Job Automation using LinuxJishnu Pradeep
 
最新版Hadoopクラスタを運用して得られたもの
最新版Hadoopクラスタを運用して得られたもの最新版Hadoopクラスタを運用して得られたもの
最新版Hadoopクラスタを運用して得られたものcyberagent
 
IT エンジニアのための 流し読み Windows 10 - Windows のネットワーク最適化機能
IT エンジニアのための 流し読み Windows 10 - Windows のネットワーク最適化機能IT エンジニアのための 流し読み Windows 10 - Windows のネットワーク最適化機能
IT エンジニアのための 流し読み Windows 10 - Windows のネットワーク最適化機能TAKUYA OHTA
 
ちょっと理解に自信がないな という皆さまに贈るHadoop/Sparkのキホン (IBM Datapalooza Tokyo 2016講演資料)
ちょっと理解に自信がないなという皆さまに贈るHadoop/Sparkのキホン (IBM Datapalooza Tokyo 2016講演資料)ちょっと理解に自信がないなという皆さまに贈るHadoop/Sparkのキホン (IBM Datapalooza Tokyo 2016講演資料)
ちょっと理解に自信がないな という皆さまに贈るHadoop/Sparkのキホン (IBM Datapalooza Tokyo 2016講演資料)hamaken
 
BigtopでHadoopをビルドする(Open Source Conference 2021 Online/Spring 発表資料)
BigtopでHadoopをビルドする(Open Source Conference 2021 Online/Spring 発表資料)BigtopでHadoopをビルドする(Open Source Conference 2021 Online/Spring 発表資料)
BigtopでHadoopをビルドする(Open Source Conference 2021 Online/Spring 発表資料)NTT DATA Technology & Innovation
 
SSL Configuration within SAP HANA
SSL Configuration within SAP HANASSL Configuration within SAP HANA
SSL Configuration within SAP HANADebajit Banerjee
 
Windows で PHP をビルドしてみた
Windows で PHP をビルドしてみたWindows で PHP をビルドしてみた
Windows で PHP をビルドしてみたy-uti
 
Transaction launcher
Transaction launcherTransaction launcher
Transaction launcherkalyan238
 
A GraphQL approach to Healthcare Information Exchange with HL7 FHIR
A GraphQL approach to Healthcare Information Exchange with HL7 FHIRA GraphQL approach to Healthcare Information Exchange with HL7 FHIR
A GraphQL approach to Healthcare Information Exchange with HL7 FHIRSuresh KUMAR Mukhiya
 
NTTデータ流 Hadoop活用のすすめ ~インフラ構築・運用の勘所~
NTTデータ流 Hadoop活用のすすめ ~インフラ構築・運用の勘所~NTTデータ流 Hadoop活用のすすめ ~インフラ構築・運用の勘所~
NTTデータ流 Hadoop活用のすすめ ~インフラ構築・運用の勘所~NTT DATA OSS Professional Services
 
HANA SPS07 Backup & Recovery
HANA SPS07 Backup & RecoveryHANA SPS07 Backup & Recovery
HANA SPS07 Backup & RecoverySAP Technology
 
Apache Spark超入門 (Hadoop / Spark Conference Japan 2016 講演資料)
Apache Spark超入門 (Hadoop / Spark Conference Japan 2016 講演資料)Apache Spark超入門 (Hadoop / Spark Conference Japan 2016 講演資料)
Apache Spark超入門 (Hadoop / Spark Conference Japan 2016 講演資料)NTT DATA OSS Professional Services
 
手作業なしの安定環境実現に向けたZabbix活用方法紹介+Zabbix2.4最新機能紹介
手作業なしの安定環境実現に向けたZabbix活用方法紹介+Zabbix2.4最新機能紹介手作業なしの安定環境実現に向けたZabbix活用方法紹介+Zabbix2.4最新機能紹介
手作業なしの安定環境実現に向けたZabbix活用方法紹介+Zabbix2.4最新機能紹介Daisuke Ikeda
 
Hadoopの概念と基本的知識
Hadoopの概念と基本的知識Hadoopの概念と基本的知識
Hadoopの概念と基本的知識Ken SASAKI
 
Apache Hadoop YARNとマルチテナントにおけるリソース管理
Apache Hadoop YARNとマルチテナントにおけるリソース管理Apache Hadoop YARNとマルチテナントにおけるリソース管理
Apache Hadoop YARNとマルチテナントにおけるリソース管理Cloudera Japan
 
Sap fiori-ux-architecture-for-s4h
Sap fiori-ux-architecture-for-s4hSap fiori-ux-architecture-for-s4h
Sap fiori-ux-architecture-for-s4hAkhilendra Singh
 
Hadoop/Spark を使うなら Bigtop を使い熟そう! ~並列分散処理基盤のいま、から Bigtop の最近の取り組みまで一挙ご紹介~(Ope...
Hadoop/Spark を使うなら Bigtop を使い熟そう! ~並列分散処理基盤のいま、から Bigtop の最近の取り組みまで一挙ご紹介~(Ope...Hadoop/Spark を使うなら Bigtop を使い熟そう! ~並列分散処理基盤のいま、から Bigtop の最近の取り組みまで一挙ご紹介~(Ope...
Hadoop/Spark を使うなら Bigtop を使い熟そう! ~並列分散処理基盤のいま、から Bigtop の最近の取り組みまで一挙ご紹介~(Ope...NTT DATA Technology & Innovation
 

Tendances (20)

Sprytniejsze testowanie kodu java ze spock framework (zaawansowane techniki) ...
Sprytniejsze testowanie kodu java ze spock framework (zaawansowane techniki) ...Sprytniejsze testowanie kodu java ze spock framework (zaawansowane techniki) ...
Sprytniejsze testowanie kodu java ze spock framework (zaawansowane techniki) ...
 
Job Automation using Linux
Job Automation using LinuxJob Automation using Linux
Job Automation using Linux
 
最新版Hadoopクラスタを運用して得られたもの
最新版Hadoopクラスタを運用して得られたもの最新版Hadoopクラスタを運用して得られたもの
最新版Hadoopクラスタを運用して得られたもの
 
IT エンジニアのための 流し読み Windows 10 - Windows のネットワーク最適化機能
IT エンジニアのための 流し読み Windows 10 - Windows のネットワーク最適化機能IT エンジニアのための 流し読み Windows 10 - Windows のネットワーク最適化機能
IT エンジニアのための 流し読み Windows 10 - Windows のネットワーク最適化機能
 
ちょっと理解に自信がないな という皆さまに贈るHadoop/Sparkのキホン (IBM Datapalooza Tokyo 2016講演資料)
ちょっと理解に自信がないなという皆さまに贈るHadoop/Sparkのキホン (IBM Datapalooza Tokyo 2016講演資料)ちょっと理解に自信がないなという皆さまに贈るHadoop/Sparkのキホン (IBM Datapalooza Tokyo 2016講演資料)
ちょっと理解に自信がないな という皆さまに贈るHadoop/Sparkのキホン (IBM Datapalooza Tokyo 2016講演資料)
 
BigtopでHadoopをビルドする(Open Source Conference 2021 Online/Spring 発表資料)
BigtopでHadoopをビルドする(Open Source Conference 2021 Online/Spring 発表資料)BigtopでHadoopをビルドする(Open Source Conference 2021 Online/Spring 発表資料)
BigtopでHadoopをビルドする(Open Source Conference 2021 Online/Spring 発表資料)
 
ヤフー発のメッセージキュー「Pulsar」のご紹介
ヤフー発のメッセージキュー「Pulsar」のご紹介ヤフー発のメッセージキュー「Pulsar」のご紹介
ヤフー発のメッセージキュー「Pulsar」のご紹介
 
SSL Configuration within SAP HANA
SSL Configuration within SAP HANASSL Configuration within SAP HANA
SSL Configuration within SAP HANA
 
Windows で PHP をビルドしてみた
Windows で PHP をビルドしてみたWindows で PHP をビルドしてみた
Windows で PHP をビルドしてみた
 
Transaction launcher
Transaction launcherTransaction launcher
Transaction launcher
 
A GraphQL approach to Healthcare Information Exchange with HL7 FHIR
A GraphQL approach to Healthcare Information Exchange with HL7 FHIRA GraphQL approach to Healthcare Information Exchange with HL7 FHIR
A GraphQL approach to Healthcare Information Exchange with HL7 FHIR
 
NTTデータ流 Hadoop活用のすすめ ~インフラ構築・運用の勘所~
NTTデータ流 Hadoop活用のすすめ ~インフラ構築・運用の勘所~NTTデータ流 Hadoop活用のすすめ ~インフラ構築・運用の勘所~
NTTデータ流 Hadoop活用のすすめ ~インフラ構築・運用の勘所~
 
HANA SPS07 Backup & Recovery
HANA SPS07 Backup & RecoveryHANA SPS07 Backup & Recovery
HANA SPS07 Backup & Recovery
 
Apache Spark超入門 (Hadoop / Spark Conference Japan 2016 講演資料)
Apache Spark超入門 (Hadoop / Spark Conference Japan 2016 講演資料)Apache Spark超入門 (Hadoop / Spark Conference Japan 2016 講演資料)
Apache Spark超入門 (Hadoop / Spark Conference Japan 2016 講演資料)
 
手作業なしの安定環境実現に向けたZabbix活用方法紹介+Zabbix2.4最新機能紹介
手作業なしの安定環境実現に向けたZabbix活用方法紹介+Zabbix2.4最新機能紹介手作業なしの安定環境実現に向けたZabbix活用方法紹介+Zabbix2.4最新機能紹介
手作業なしの安定環境実現に向けたZabbix活用方法紹介+Zabbix2.4最新機能紹介
 
Hadoopの概念と基本的知識
Hadoopの概念と基本的知識Hadoopの概念と基本的知識
Hadoopの概念と基本的知識
 
Apache Hadoop YARNとマルチテナントにおけるリソース管理
Apache Hadoop YARNとマルチテナントにおけるリソース管理Apache Hadoop YARNとマルチテナントにおけるリソース管理
Apache Hadoop YARNとマルチテナントにおけるリソース管理
 
Sap fiori-ux-architecture-for-s4h
Sap fiori-ux-architecture-for-s4hSap fiori-ux-architecture-for-s4h
Sap fiori-ux-architecture-for-s4h
 
Hadoop/Spark を使うなら Bigtop を使い熟そう! ~並列分散処理基盤のいま、から Bigtop の最近の取り組みまで一挙ご紹介~(Ope...
Hadoop/Spark を使うなら Bigtop を使い熟そう! ~並列分散処理基盤のいま、から Bigtop の最近の取り組みまで一挙ご紹介~(Ope...Hadoop/Spark を使うなら Bigtop を使い熟そう! ~並列分散処理基盤のいま、から Bigtop の最近の取り組みまで一挙ご紹介~(Ope...
Hadoop/Spark を使うなら Bigtop を使い熟そう! ~並列分散処理基盤のいま、から Bigtop の最近の取り組みまで一挙ご紹介~(Ope...
 
KafkaとPulsar
KafkaとPulsarKafkaとPulsar
KafkaとPulsar
 

Similaire à Serial Data from Arduino to Raspberry Pi to MySQL using CoAP Protocol

Extending Piwik At R7.com
Extending Piwik At R7.comExtending Piwik At R7.com
Extending Piwik At R7.comLeo Lorieri
 
Scale Apache with Nginx
Scale Apache with NginxScale Apache with Nginx
Scale Apache with NginxBud Siddhisena
 
maXbox_Arduino_Pascal_Magazine
maXbox_Arduino_Pascal_MagazinemaXbox_Arduino_Pascal_Magazine
maXbox_Arduino_Pascal_MagazineMax Kleiner
 
Project-make a public website server using raspberry pi
Project-make a public website server using raspberry piProject-make a public website server using raspberry pi
Project-make a public website server using raspberry piFahim Hossain
 
An introduction to workflow-based programming with Node-RED
An introduction to workflow-based programming with Node-REDAn introduction to workflow-based programming with Node-RED
An introduction to workflow-based programming with Node-REDBoris Adryan
 
Node-RED and Minecraft - CamJam September 2015
Node-RED and Minecraft - CamJam September 2015Node-RED and Minecraft - CamJam September 2015
Node-RED and Minecraft - CamJam September 2015Boris Adryan
 
Workshop For pycon13
Workshop For pycon13Workshop For pycon13
Workshop For pycon13Steven Pousty
 
Raspi_TOR_Access_Point_BenMoore
Raspi_TOR_Access_Point_BenMooreRaspi_TOR_Access_Point_BenMoore
Raspi_TOR_Access_Point_BenMooreBenjamin Moore
 
Maxbox starter18
Maxbox starter18Maxbox starter18
Maxbox starter18Max Kleiner
 
Final ProjectFinal Project Details Description Given a spec.docx
Final ProjectFinal Project Details Description  Given a spec.docxFinal ProjectFinal Project Details Description  Given a spec.docx
Final ProjectFinal Project Details Description Given a spec.docxAKHIL969626
 
maXbox starter30 Web of Things
maXbox starter30 Web of ThingsmaXbox starter30 Web of Things
maXbox starter30 Web of ThingsMax Kleiner
 
Python for IoT, A return of experience
Python for IoT, A return of experiencePython for IoT, A return of experience
Python for IoT, A return of experienceAlexandre Abadie
 
Using Python for IoT: a return of experience, Alexandre Abadie
Using Python for IoT: a return of experience, Alexandre AbadieUsing Python for IoT: a return of experience, Alexandre Abadie
Using Python for IoT: a return of experience, Alexandre AbadiePôle Systematic Paris-Region
 
Node-RED and getting started on the Internet of Things
Node-RED and getting started on the Internet of ThingsNode-RED and getting started on the Internet of Things
Node-RED and getting started on the Internet of ThingsBoris Adryan
 
IoT with OpenPicus Flyport
IoT with OpenPicus FlyportIoT with OpenPicus Flyport
IoT with OpenPicus FlyportIonela
 
Raspberry pi home automation idea
Raspberry pi home automation ideaRaspberry pi home automation idea
Raspberry pi home automation ideashashi gautam
 
maXbox Arduino Tutorial
maXbox Arduino TutorialmaXbox Arduino Tutorial
maXbox Arduino TutorialMax Kleiner
 
5 IOT MODULE 5 RaspberryPi Programming using Python.pdf
5 IOT MODULE 5 RaspberryPi Programming using Python.pdf5 IOT MODULE 5 RaspberryPi Programming using Python.pdf
5 IOT MODULE 5 RaspberryPi Programming using Python.pdfJayanthi Kannan MK
 
Automated Deployment using Open Source
Automated Deployment using Open SourceAutomated Deployment using Open Source
Automated Deployment using Open Sourceduskglow
 

Similaire à Serial Data from Arduino to Raspberry Pi to MySQL using CoAP Protocol (20)

Extending Piwik At R7.com
Extending Piwik At R7.comExtending Piwik At R7.com
Extending Piwik At R7.com
 
Scale Apache with Nginx
Scale Apache with NginxScale Apache with Nginx
Scale Apache with Nginx
 
maXbox_Arduino_Pascal_Magazine
maXbox_Arduino_Pascal_MagazinemaXbox_Arduino_Pascal_Magazine
maXbox_Arduino_Pascal_Magazine
 
Project-make a public website server using raspberry pi
Project-make a public website server using raspberry piProject-make a public website server using raspberry pi
Project-make a public website server using raspberry pi
 
An introduction to workflow-based programming with Node-RED
An introduction to workflow-based programming with Node-REDAn introduction to workflow-based programming with Node-RED
An introduction to workflow-based programming with Node-RED
 
Node-RED and Minecraft - CamJam September 2015
Node-RED and Minecraft - CamJam September 2015Node-RED and Minecraft - CamJam September 2015
Node-RED and Minecraft - CamJam September 2015
 
Workshop For pycon13
Workshop For pycon13Workshop For pycon13
Workshop For pycon13
 
Raspi_TOR_Access_Point_BenMoore
Raspi_TOR_Access_Point_BenMooreRaspi_TOR_Access_Point_BenMoore
Raspi_TOR_Access_Point_BenMoore
 
Maxbox starter18
Maxbox starter18Maxbox starter18
Maxbox starter18
 
Final ProjectFinal Project Details Description Given a spec.docx
Final ProjectFinal Project Details Description  Given a spec.docxFinal ProjectFinal Project Details Description  Given a spec.docx
Final ProjectFinal Project Details Description Given a spec.docx
 
maXbox starter30 Web of Things
maXbox starter30 Web of ThingsmaXbox starter30 Web of Things
maXbox starter30 Web of Things
 
Python for IoT, A return of experience
Python for IoT, A return of experiencePython for IoT, A return of experience
Python for IoT, A return of experience
 
Using Python for IoT: a return of experience, Alexandre Abadie
Using Python for IoT: a return of experience, Alexandre AbadieUsing Python for IoT: a return of experience, Alexandre Abadie
Using Python for IoT: a return of experience, Alexandre Abadie
 
Triple Blitz Strike
Triple Blitz StrikeTriple Blitz Strike
Triple Blitz Strike
 
Node-RED and getting started on the Internet of Things
Node-RED and getting started on the Internet of ThingsNode-RED and getting started on the Internet of Things
Node-RED and getting started on the Internet of Things
 
IoT with OpenPicus Flyport
IoT with OpenPicus FlyportIoT with OpenPicus Flyport
IoT with OpenPicus Flyport
 
Raspberry pi home automation idea
Raspberry pi home automation ideaRaspberry pi home automation idea
Raspberry pi home automation idea
 
maXbox Arduino Tutorial
maXbox Arduino TutorialmaXbox Arduino Tutorial
maXbox Arduino Tutorial
 
5 IOT MODULE 5 RaspberryPi Programming using Python.pdf
5 IOT MODULE 5 RaspberryPi Programming using Python.pdf5 IOT MODULE 5 RaspberryPi Programming using Python.pdf
5 IOT MODULE 5 RaspberryPi Programming using Python.pdf
 
Automated Deployment using Open Source
Automated Deployment using Open SourceAutomated Deployment using Open Source
Automated Deployment using Open Source
 

Plus de Sanjay Kumar

Mobile app development
Mobile app developmentMobile app development
Mobile app developmentSanjay Kumar
 
Accelerated Mobile Pages (AMP)
Accelerated Mobile Pages (AMP)Accelerated Mobile Pages (AMP)
Accelerated Mobile Pages (AMP)Sanjay Kumar
 
Attendance System using ESP8266(Wi-Fi) with MySQL
Attendance System using ESP8266(Wi-Fi) with MySQLAttendance System using ESP8266(Wi-Fi) with MySQL
Attendance System using ESP8266(Wi-Fi) with MySQLSanjay Kumar
 
Attendance system using MYSQL with Raspberry pi and RFID-RC522
Attendance system using MYSQL with Raspberry pi and RFID-RC522Attendance system using MYSQL with Raspberry pi and RFID-RC522
Attendance system using MYSQL with Raspberry pi and RFID-RC522Sanjay Kumar
 
Arduino to Control Bulbs using Web App
Arduino to Control Bulbs using Web AppArduino to Control Bulbs using Web App
Arduino to Control Bulbs using Web AppSanjay Kumar
 
Bulb Control using Web App with Raspberry Pi
Bulb Control using Web App with Raspberry Pi Bulb Control using Web App with Raspberry Pi
Bulb Control using Web App with Raspberry Pi Sanjay Kumar
 
Obstacle detection Robot using Ultrasonic Sensor and Arduino UNO
Obstacle detection Robot using Ultrasonic Sensor and Arduino UNOObstacle detection Robot using Ultrasonic Sensor and Arduino UNO
Obstacle detection Robot using Ultrasonic Sensor and Arduino UNOSanjay Kumar
 
Arduino Interface LM35 MQTT Using UART
Arduino Interface LM35 MQTT Using UARTArduino Interface LM35 MQTT Using UART
Arduino Interface LM35 MQTT Using UARTSanjay Kumar
 
Arduino Interface with MySQL for Storing RFID Access Details
Arduino Interface with MySQL for Storing RFID Access DetailsArduino Interface with MySQL for Storing RFID Access Details
Arduino Interface with MySQL for Storing RFID Access DetailsSanjay Kumar
 
Rain Drop Sensor using Arduino!
Rain Drop Sensor using Arduino!Rain Drop Sensor using Arduino!
Rain Drop Sensor using Arduino!Sanjay Kumar
 
Arduino Programming Software Development
Arduino Programming Software DevelopmentArduino Programming Software Development
Arduino Programming Software DevelopmentSanjay Kumar
 
Embedded Software Development
Embedded Software DevelopmentEmbedded Software Development
Embedded Software DevelopmentSanjay Kumar
 
Ionic - Hybrid Mobile Application Framework
Ionic - Hybrid Mobile Application FrameworkIonic - Hybrid Mobile Application Framework
Ionic - Hybrid Mobile Application FrameworkSanjay Kumar
 
Internet of Things - IOT
Internet of Things - IOTInternet of Things - IOT
Internet of Things - IOTSanjay Kumar
 
Meteor Mobile App Development
Meteor Mobile App DevelopmentMeteor Mobile App Development
Meteor Mobile App DevelopmentSanjay Kumar
 
Digital Marketing Strategy
Digital Marketing StrategyDigital Marketing Strategy
Digital Marketing StrategySanjay Kumar
 
Web Application Development
Web Application DevelopmentWeb Application Development
Web Application DevelopmentSanjay Kumar
 
Joomla Website Development Company
Joomla Website Development CompanyJoomla Website Development Company
Joomla Website Development CompanySanjay Kumar
 
Meteor js App Development
Meteor js App DevelopmentMeteor js App Development
Meteor js App DevelopmentSanjay Kumar
 

Plus de Sanjay Kumar (19)

Mobile app development
Mobile app developmentMobile app development
Mobile app development
 
Accelerated Mobile Pages (AMP)
Accelerated Mobile Pages (AMP)Accelerated Mobile Pages (AMP)
Accelerated Mobile Pages (AMP)
 
Attendance System using ESP8266(Wi-Fi) with MySQL
Attendance System using ESP8266(Wi-Fi) with MySQLAttendance System using ESP8266(Wi-Fi) with MySQL
Attendance System using ESP8266(Wi-Fi) with MySQL
 
Attendance system using MYSQL with Raspberry pi and RFID-RC522
Attendance system using MYSQL with Raspberry pi and RFID-RC522Attendance system using MYSQL with Raspberry pi and RFID-RC522
Attendance system using MYSQL with Raspberry pi and RFID-RC522
 
Arduino to Control Bulbs using Web App
Arduino to Control Bulbs using Web AppArduino to Control Bulbs using Web App
Arduino to Control Bulbs using Web App
 
Bulb Control using Web App with Raspberry Pi
Bulb Control using Web App with Raspberry Pi Bulb Control using Web App with Raspberry Pi
Bulb Control using Web App with Raspberry Pi
 
Obstacle detection Robot using Ultrasonic Sensor and Arduino UNO
Obstacle detection Robot using Ultrasonic Sensor and Arduino UNOObstacle detection Robot using Ultrasonic Sensor and Arduino UNO
Obstacle detection Robot using Ultrasonic Sensor and Arduino UNO
 
Arduino Interface LM35 MQTT Using UART
Arduino Interface LM35 MQTT Using UARTArduino Interface LM35 MQTT Using UART
Arduino Interface LM35 MQTT Using UART
 
Arduino Interface with MySQL for Storing RFID Access Details
Arduino Interface with MySQL for Storing RFID Access DetailsArduino Interface with MySQL for Storing RFID Access Details
Arduino Interface with MySQL for Storing RFID Access Details
 
Rain Drop Sensor using Arduino!
Rain Drop Sensor using Arduino!Rain Drop Sensor using Arduino!
Rain Drop Sensor using Arduino!
 
Arduino Programming Software Development
Arduino Programming Software DevelopmentArduino Programming Software Development
Arduino Programming Software Development
 
Embedded Software Development
Embedded Software DevelopmentEmbedded Software Development
Embedded Software Development
 
Ionic - Hybrid Mobile Application Framework
Ionic - Hybrid Mobile Application FrameworkIonic - Hybrid Mobile Application Framework
Ionic - Hybrid Mobile Application Framework
 
Internet of Things - IOT
Internet of Things - IOTInternet of Things - IOT
Internet of Things - IOT
 
Meteor Mobile App Development
Meteor Mobile App DevelopmentMeteor Mobile App Development
Meteor Mobile App Development
 
Digital Marketing Strategy
Digital Marketing StrategyDigital Marketing Strategy
Digital Marketing Strategy
 
Web Application Development
Web Application DevelopmentWeb Application Development
Web Application Development
 
Joomla Website Development Company
Joomla Website Development CompanyJoomla Website Development Company
Joomla Website Development Company
 
Meteor js App Development
Meteor js App DevelopmentMeteor js App Development
Meteor js App Development
 

Dernier

How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 

Dernier (20)

How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 

Serial Data from Arduino to Raspberry Pi to MySQL using CoAP Protocol

  • 1. Serial Data from Arduino to Raspberry Pi to MySQL using CoAP Protocol By Deligence Technologies www.deligence.com
  • 2. Getting Serial Data from Arduino to Raspberry Pi and saving it in MySQL database & Explaining how to run CoAP server on Raspberry Pi - In this tutorial I'm going to tell you how we can get the sensor data from Arduino Uno and sending it to the Raspberry pi through UART. Mostly We are going to do two important things. First we will use a CoAP server For making a GET request which will run on raspberry pi and in our CoAP browser we will get the DHT22 data immediately. And the second thing is we are going to make a mysql database in raspberry pi to store the value of DHT22 sensor.
  • 3. Constrained Application Protocol (CoAP) is an Internet Application Protocol for constrained devices. It enables those constrained devices to communicate with the wider Internet using similar protocols. CoAP is designed for use between Devices on the same constrained network, between Devices and general nodes on the Internet, and between Devices on different constrained networks both joined by an Internet. CoAP is designed to easily translate to HTTP for simplified integration with the web, while also meeting specialized requirements such as multicast support, very low overhead, and simplicity. CoAP supports the basic methods of GET, POST, PUT, DELETE, which are easily mapped to HTTP. Now here above was the brief description of CoAP. As I told you that you will get a lot of things about CoAP but as far as interfacing with real hardware is concerned there are very less stuff. So that's why I am going to tell you about this CoAP server and how we can interact with real hardware.
  • 4. 1. In this step we will tell you that how we can run a CoAP server in our raspberry pi. txThings Tutorial : In this tutorial, we will describe how to run a CoAP server on Raspberry Pi, and run the CoAP client on a PC. The CoAP server and clients are implemented using txThings, which is a Phyton implementation of CoAP. ABOUT TXTHINGS txThings - CoAP library for Twisted framework txThings is a Python implementation of Constrained Application Protocol (CoAP): http://tools.ietf.org/html/rfc7252 txThings is based on Twisted - asynchronous I/O framework and networking engine written in Python. http://twistedmatrix.com/ txThings uses MIT License (like Twisted itself). http://opensource.org/licenses/mit-license.php Copyright (c) 2012 Maciej Wasilak http://sixpinetrees.blogspot.com/
  • 5. txThings has the following features:  Support for draft-ietf-core-coap-13 - including automatic piggyback/separate response handling. No caching support.  Support for draft-ietf-core-block-12 (no support for server initiative though - waiting for the resolution)  Limited support for RFC6690 (Core Link Format) - server only. Other nice things:  txThings works nicely on RaspberryPi  txThings is compatible with Kivy - brilliant new Python GUI library (I'll post some examples soon).  txThings is fully asynchronous (thanks to twisted framework)
  • 6. txThings is posted on Github. The easiest way to get it is to clone the repository to your local machine using the command below: git clone git://github.com/siskin/txThings.git Library contains CoAP code (inside "iot" directory) and three examples: server.py - CoAP server that starts on localhost, port 5683 and hosts several resources client_GET.py - example client which performs GET request to localhost, port 5683 client_PUT.py - example client which performs PUT request to localhost, port 5683 Client_GET and client_PUT both use port 61616 - to use them simultaneously change port number in one of the clients. Server will send blockwise responses for default settings. To use txThings you need Python 2.7 with Twisted installed (I suggest using the latest Twisted version, but older releases also work - tested with 11.1).
  • 7. 1. Install OS on Raspberry Pi (set the appropriate raspi-config for all,including ssh and desktop boot) 2. Install setup tools for python (such as pip) https://pip.pypa.io/en/stable/installing.html#install-pip 3. Install Twisted on Raspberry Pi sudo apt-get install python-pip pip install twisted==15.1.0 4. Install txThings on Raspberry Pi pip install txThings
  • 8. 2. Now this is the time to move on Arduino. Here I've connected DHT22 sensor to an arduino and our arduino is connected to our raspberry pi(which is working here as an IOT gateway or server ) through USB cable to one of its USB port. But before going to connect Arduino to our raspberry pi we have to put a Arduino snippet for DHT22 interfacing to our arduino. Since we are using Raspberry pi remotely in ubuntu. Connect your arduino to your PC to upload this code (Arduino code). Now just unplug your arduino from PC and connect it to your pi. 3. Now we need to install some of the things to get data in raspberry pi First one is Python-serial and then python-mysqldb.
  • 9. Now this URI we have to type in Mozilla Firefox - caop://<Raspberry pi IP Address>:5683 For that we need to do a little modification in our server.py code which we got while installing txThings. You just check your server.py code and edit accordingly. Now we need to run our server.py code. It'll take a little time. Here, you can see the temperature and humidity in Copper on firefox. Humidity Temperature and Heat Index
  • 10. The Copper (Cu) CoAP user-agent is an add-on for the Firefox Web browser. It allows browsing, bookmarking, and direct interaction with CoAP resources. Simply enter a CoAP URI into the address bar.
  • 11. For getting the data in our smartphone we need to install Aneska. At the end section of the video you can see how we can get data in our smartphone. Humidity and Temperature In Smartphone
  • 12. The Second Part of this Project is creating a Database of DHT22 Data For that you have to install Apache Mysql and PHP and then save data in phpmyadmin. You can easily get about these installation in many links. So I'm not going to demonstrate that. In short you have to set up a LAMP server in your raspberry pi. I am assuming you have install these necessary things. So Let's get started - • Go to localhost/phpmyadmin or <pi IP address>/phpmyadmin (if you are using pi remotely) • Create Database give it some name • Then create table for that • I have made 6 columns • For getting the data in database from arduino serial out we have to write a small script in pi. This is the script(You can find all the files in our github page - https://github.com/DeligenceTechnologies/Serial-Data-from-Arduino-to-Raspberry-Pi-to- MySQL-using-CoAP-Protocol) for getting data in mysql datbase from arduino. If I run this script I can see the updated data in database but if we want this thing automatically let's say for every single minute then we have to edit crontab -e All the process Regarding this project is explained in our video that you can see in the slide 15.
  • 13. Arduino Interfacing with DHT22 and connected to Pi with USB
  • 15. We at Deligence Technologies, offer a range of Arduino Software Development Services to turn your design into a fully functional system. Deligence Technologies - your growing technology partner! www.deligence.com/contact-us Email : info@deligence.com Phone : +91 9910130340