18
Pi in the Sky (Scripts for Web Interface) Whitney Nelson Hampton University SiParcs Mentors: Dr. Richard Loft and Raghu Raj Prasanna Kumar

Pi in the Sky (Scripts for Web Interface) · Pi in the Sky (Scripts for Web Interface) Whitney Nelson Hampton University SiParcs Mentors: Dr. Richard Loft and Raghu Raj Prasanna Kumar

  • Upload
    others

  • View
    43

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Pi in the Sky (Scripts for Web Interface) · Pi in the Sky (Scripts for Web Interface) Whitney Nelson Hampton University SiParcs Mentors: Dr. Richard Loft and Raghu Raj Prasanna Kumar

Pi in the Sky

(Scripts for Web Interface)

Whitney Nelson

Hampton University

SiParcs

Mentors: Dr. Richard Loft and Raghu Raj Prasanna Kumar

Page 2: Pi in the Sky (Scripts for Web Interface) · Pi in the Sky (Scripts for Web Interface) Whitney Nelson Hampton University SiParcs Mentors: Dr. Richard Loft and Raghu Raj Prasanna Kumar

Objective

- Use a Weather Pi

to upload data

- Store data using

cloud storage

- Query and display

data onto an

interface

2

Page 3: Pi in the Sky (Scripts for Web Interface) · Pi in the Sky (Scripts for Web Interface) Whitney Nelson Hampton University SiParcs Mentors: Dr. Richard Loft and Raghu Raj Prasanna Kumar

Overview of Raspberry Pi

- Raspberry Pi 2

Model B ($35)

- Single board

computer

running at 900

MHz

- Linux based

operating system

HDMI Port

Ethernet Port

GPIO Pins

Quad

USB

ports

Micro USB

3

Page 4: Pi in the Sky (Scripts for Web Interface) · Pi in the Sky (Scripts for Web Interface) Whitney Nelson Hampton University SiParcs Mentors: Dr. Richard Loft and Raghu Raj Prasanna Kumar

Personal Objective

• View data that has been uploaded from

the sensors

• Allow client to interact with the server

• Display data in tables and graphs

• Handle any missing values in case of

error in the sensors

4

Page 5: Pi in the Sky (Scripts for Web Interface) · Pi in the Sky (Scripts for Web Interface) Whitney Nelson Hampton University SiParcs Mentors: Dr. Richard Loft and Raghu Raj Prasanna Kumar

Sensors

Built in Sensors e.g.

Temperature and Pressure

Python scripts read

data from Weather Pi

Weather Pi connects to Raspberry

Pi through GPIO pins

Weather Pi Raspberry Pi

5

Page 6: Pi in the Sky (Scripts for Web Interface) · Pi in the Sky (Scripts for Web Interface) Whitney Nelson Hampton University SiParcs Mentors: Dr. Richard Loft and Raghu Raj Prasanna Kumar

Cloud

• Owncloud 7.0.1- self

hosted share server

• Remotely stores data

that were uploaded

from the sensors

• Information can be

acccessed by any

Raspberry Pi within

storage cluster

6

Page 7: Pi in the Sky (Scripts for Web Interface) · Pi in the Sky (Scripts for Web Interface) Whitney Nelson Hampton University SiParcs Mentors: Dr. Richard Loft and Raghu Raj Prasanna Kumar

My Role in the Project

Temperature

Pressure

Altitude

Humidity

Wind Speed

7

Page 8: Pi in the Sky (Scripts for Web Interface) · Pi in the Sky (Scripts for Web Interface) Whitney Nelson Hampton University SiParcs Mentors: Dr. Richard Loft and Raghu Raj Prasanna Kumar

MYSQL

• Send data from cloud

to the database

• Organize data into

tables

• Index through the data

to be extracted from

database to display

onto a webpage

Server request database

for information

8

Client makes

request

Page 9: Pi in the Sky (Scripts for Web Interface) · Pi in the Sky (Scripts for Web Interface) Whitney Nelson Hampton University SiParcs Mentors: Dr. Richard Loft and Raghu Raj Prasanna Kumar

Why PHP and HTML?

Hypertext Markup Language (HTML5)

• Works on client side

• Language that describes and

displays browsers

• Users sends HTML code

Hypertext Preprocessor (PHP5)

• Works on server side

• Intelligent programming

language

• PHP processes HTML code

9

Page 10: Pi in the Sky (Scripts for Web Interface) · Pi in the Sky (Scripts for Web Interface) Whitney Nelson Hampton University SiParcs Mentors: Dr. Richard Loft and Raghu Raj Prasanna Kumar

User makes web page request 10

Page 11: Pi in the Sky (Scripts for Web Interface) · Pi in the Sky (Scripts for Web Interface) Whitney Nelson Hampton University SiParcs Mentors: Dr. Richard Loft and Raghu Raj Prasanna Kumar

1. Connect to the database

11

Page 12: Pi in the Sky (Scripts for Web Interface) · Pi in the Sky (Scripts for Web Interface) Whitney Nelson Hampton University SiParcs Mentors: Dr. Richard Loft and Raghu Raj Prasanna Kumar

2. Query the database

12

Page 13: Pi in the Sky (Scripts for Web Interface) · Pi in the Sky (Scripts for Web Interface) Whitney Nelson Hampton University SiParcs Mentors: Dr. Richard Loft and Raghu Raj Prasanna Kumar

3. Display data in tables

13

Page 14: Pi in the Sky (Scripts for Web Interface) · Pi in the Sky (Scripts for Web Interface) Whitney Nelson Hampton University SiParcs Mentors: Dr. Richard Loft and Raghu Raj Prasanna Kumar

Web Interface 14

Page 15: Pi in the Sky (Scripts for Web Interface) · Pi in the Sky (Scripts for Web Interface) Whitney Nelson Hampton University SiParcs Mentors: Dr. Richard Loft and Raghu Raj Prasanna Kumar

Updating graphics and error

handling

• JpGraph: tool for graphing data

• Display graphs for current time and date

• Queries that were made for tables can also be used

for graphs

• Missing values in database are replaced with nearest

value

15

Page 16: Pi in the Sky (Scripts for Web Interface) · Pi in the Sky (Scripts for Web Interface) Whitney Nelson Hampton University SiParcs Mentors: Dr. Richard Loft and Raghu Raj Prasanna Kumar

Image Credits

• http://cdn.xenlife.com.au/wp-

content/uploads/nuvem.jpg

• http://www.wpclipart.com/computer/PCs/more_c

omputers/computer_thin_client.png

• https://s3.amazonaws.com/otreva-cdn-3/wp-

content/uploads/2013/12/mysql-logo.jpg

• http://imgsdown.1mobile.com/group3/M00/0C/A

B/S34UR1S8jTWAYQ29AABfnKh2CHs607.png

16

Page 17: Pi in the Sky (Scripts for Web Interface) · Pi in the Sky (Scripts for Web Interface) Whitney Nelson Hampton University SiParcs Mentors: Dr. Richard Loft and Raghu Raj Prasanna Kumar

Acknowledgments

• Dr. Richard Loft

• Raghu Raj Prasanna Kumar

• Rashmi Oak

• Harish Ramachandran

• Priyanka Sanghavi

• Amogh Simha

• Ian Bragg

• Gaston Seneza

• Jenish Koirala

17

Page 18: Pi in the Sky (Scripts for Web Interface) · Pi in the Sky (Scripts for Web Interface) Whitney Nelson Hampton University SiParcs Mentors: Dr. Richard Loft and Raghu Raj Prasanna Kumar

QUESTIONS???

18