SciPy Conference 2012 A talk on SBHS Virtual labs using Python - - PowerPoint PPT Presentation

scipy conference 2012 a talk on sbhs virtual labs using
SMART_READER_LITE
LIVE PREVIEW

SciPy Conference 2012 A talk on SBHS Virtual labs using Python - - PowerPoint PPT Presentation

SciPy Conference 2012 A talk on SBHS Virtual labs using Python Team SBHS led by Prof. Kannan Moudgalya Speaker Rupak Rokade Indian Institute of Technology Bombay Project funded by National Mission on Education through ICT,MHRD. December


slide-1
SLIDE 1

SciPy Conference 2012 A talk on SBHS Virtual labs using Python Team SBHS led by

  • Prof. Kannan Moudgalya

Speaker Rupak Rokade Indian Institute of Technology Bombay Project funded by National Mission on Education through ICT,MHRD.

December 29, 2012

Rupak Rokade SBHS Vlabs using Python 1/17

slide-2
SLIDE 2

Virtual Labs

◮ Simulation Virtual lab ◮ Remote triggered Virtual lab

Rupak Rokade SBHS Vlabs using Python 2/17

slide-3
SLIDE 3

Single Board Heater System

Rupak Rokade SBHS Vlabs using Python 3/17

slide-4
SLIDE 4

Block diagram of SBHS

Rupak Rokade SBHS Vlabs using Python 4/17

slide-5
SLIDE 5

What does this system do?

Controlling the temperature of a blade

◮ by heating with heater ◮ by cooling with a fan

Rupak Rokade SBHS Vlabs using Python 5/17

slide-6
SLIDE 6

Main components of SBHS

◮ Heater assembly

Rupak Rokade SBHS Vlabs using Python 6/17

slide-7
SLIDE 7

Main components of SBHS

◮ Heater assembly

◮ Consists of an iron plate placed at a distance

  • f about 3.5 mm from the nichrome coil

Rupak Rokade SBHS Vlabs using Python 6/17

slide-8
SLIDE 8

Main components of SBHS

◮ Heater assembly

◮ Consists of an iron plate placed at a distance

  • f about 3.5 mm from the nichrome coil

◮ Coil gets heated on passage of current Rupak Rokade SBHS Vlabs using Python 6/17

slide-9
SLIDE 9

Main components of SBHS

◮ Heater assembly

◮ Consists of an iron plate placed at a distance

  • f about 3.5 mm from the nichrome coil

◮ Coil gets heated on passage of current ◮ Iron plate gets heated due to transfer of heat

from coil through convection

Rupak Rokade SBHS Vlabs using Python 6/17

slide-10
SLIDE 10

Main components of SBHS

◮ Heater assembly

◮ Consists of an iron plate placed at a distance

  • f about 3.5 mm from the nichrome coil

◮ Coil gets heated on passage of current ◮ Iron plate gets heated due to transfer of heat

from coil through convection

◮ Computer fan

Rupak Rokade SBHS Vlabs using Python 6/17

slide-11
SLIDE 11

Main components of SBHS

◮ Heater assembly

◮ Consists of an iron plate placed at a distance

  • f about 3.5 mm from the nichrome coil

◮ Coil gets heated on passage of current ◮ Iron plate gets heated due to transfer of heat

from coil through convection

◮ Computer fan

◮ Positioned below the plate Rupak Rokade SBHS Vlabs using Python 6/17

slide-12
SLIDE 12

Main components of SBHS

◮ Heater assembly

◮ Consists of an iron plate placed at a distance

  • f about 3.5 mm from the nichrome coil

◮ Coil gets heated on passage of current ◮ Iron plate gets heated due to transfer of heat

from coil through convection

◮ Computer fan

◮ Positioned below the plate ◮ Meant for cooling the assembly Rupak Rokade SBHS Vlabs using Python 6/17

slide-13
SLIDE 13

Main components of SBHS

◮ Heater assembly

◮ Consists of an iron plate placed at a distance

  • f about 3.5 mm from the nichrome coil

◮ Coil gets heated on passage of current ◮ Iron plate gets heated due to transfer of heat

from coil through convection

◮ Computer fan

◮ Positioned below the plate ◮ Meant for cooling the assembly

◮ Temperature Sensor

Rupak Rokade SBHS Vlabs using Python 6/17

slide-14
SLIDE 14

Main components of SBHS

◮ Heater assembly

◮ Consists of an iron plate placed at a distance

  • f about 3.5 mm from the nichrome coil

◮ Coil gets heated on passage of current ◮ Iron plate gets heated due to transfer of heat

from coil through convection

◮ Computer fan

◮ Positioned below the plate ◮ Meant for cooling the assembly

◮ Temperature Sensor

◮ AD590 Rupak Rokade SBHS Vlabs using Python 6/17

slide-15
SLIDE 15

Main components of SBHS

◮ Heater assembly

◮ Consists of an iron plate placed at a distance

  • f about 3.5 mm from the nichrome coil

◮ Coil gets heated on passage of current ◮ Iron plate gets heated due to transfer of heat

from coil through convection

◮ Computer fan

◮ Positioned below the plate ◮ Meant for cooling the assembly

◮ Temperature Sensor

◮ AD590 ◮ Reading in µA per Kelvin Rupak Rokade SBHS Vlabs using Python 6/17

slide-16
SLIDE 16

Software architecture SBHS vlabs

Server Database Server Server Web Client

file file

Browser Web

Scilab Server Computer Client Computer

Network/ Internet

SBHS 1 SBHS 2 SBHS 7

USB HUB

Python Python

scilabread scilabwrite Rupak Rokade SBHS Vlabs using Python 7/17

slide-17
SLIDE 17

Implementation

Rupak Rokade SBHS Vlabs using Python 8/17

slide-18
SLIDE 18

Implementation

Server side Hardware access

Rupak Rokade SBHS Vlabs using Python 8/17

slide-19
SLIDE 19

Implementation

Server side Hardware access

◮ Python is used for interfacing to hardware

Rupak Rokade SBHS Vlabs using Python 8/17

slide-20
SLIDE 20

Implementation

Server side Hardware access

◮ Python is used for interfacing to hardware ◮ Serial library included

Rupak Rokade SBHS Vlabs using Python 8/17

slide-21
SLIDE 21

Implementation

Server side Hardware access

◮ Python is used for interfacing to hardware ◮ Serial library included ◮ Baud rate etc can be easily set

Rupak Rokade SBHS Vlabs using Python 8/17

slide-22
SLIDE 22

Implementation

Server side Hardware access

◮ Python is used for interfacing to hardware ◮ Serial library included ◮ Baud rate etc can be easily set ◮ Direct communication to /dev/ttyUSB*

files

Rupak Rokade SBHS Vlabs using Python 8/17

slide-23
SLIDE 23

Implementation contd...

Rupak Rokade SBHS Vlabs using Python 9/17

slide-24
SLIDE 24

Implementation contd...

Server side web hosting

◮ Socket, RMI, http etc.. ways of

client-server communication

Rupak Rokade SBHS Vlabs using Python 9/17

slide-25
SLIDE 25

Implementation contd...

Server side web hosting

◮ Socket, RMI, http etc.. ways of

client-server communication

◮ HTTP is chosen

Rupak Rokade SBHS Vlabs using Python 9/17

slide-26
SLIDE 26

Implementation contd...

Server side web hosting

◮ Socket, RMI, http etc.. ways of

client-server communication

◮ HTTP is chosen ◮ Why?

Rupak Rokade SBHS Vlabs using Python 9/17

slide-27
SLIDE 27

Implementation contd...

Server side web hosting

◮ Socket, RMI, http etc.. ways of

client-server communication

◮ HTTP is chosen ◮ Why?

Rupak Rokade SBHS Vlabs using Python 9/17

slide-28
SLIDE 28

Implementation contd...

Server side web hosting

◮ Socket, RMI, http etc.. ways of

client-server communication

◮ HTTP is chosen ◮ Why?It is browser based

Rupak Rokade SBHS Vlabs using Python 9/17

slide-29
SLIDE 29

Implementation contd...

Server side web hosting

◮ Socket, RMI, http etc.. ways of

client-server communication

◮ HTTP is chosen ◮ Why?It is browser based

Rupak Rokade SBHS Vlabs using Python 9/17

slide-30
SLIDE 30

Implementation contd...

Rupak Rokade SBHS Vlabs using Python 10/17

slide-31
SLIDE 31

Implementation contd...

◮ Obvious need of a web server

Rupak Rokade SBHS Vlabs using Python 10/17

slide-32
SLIDE 32

Implementation contd...

◮ Obvious need of a web server ◮ Examples of web server, apache, nginx,

IIS etc..

Rupak Rokade SBHS Vlabs using Python 10/17

slide-33
SLIDE 33

Implementation contd...

◮ Obvious need of a web server ◮ Examples of web server, apache, nginx,

IIS etc..

◮ But web server will handle only requests,

routine calls and traffic management

Rupak Rokade SBHS Vlabs using Python 10/17

slide-34
SLIDE 34

Implementation contd...

◮ Obvious need of a web server ◮ Examples of web server, apache, nginx,

IIS etc..

◮ But web server will handle only requests,

routine calls and traffic management

◮ Need of server side scripting language

Rupak Rokade SBHS Vlabs using Python 10/17

slide-35
SLIDE 35

Implementation contd...

Rupak Rokade SBHS Vlabs using Python 11/17

slide-36
SLIDE 36

Implementation contd...

◮ Examples of server side scripting

language, php, python, perl, asp etc..

Rupak Rokade SBHS Vlabs using Python 11/17

slide-37
SLIDE 37

Implementation contd...

◮ Examples of server side scripting

language, php, python, perl, asp etc..

◮ We choose python

Rupak Rokade SBHS Vlabs using Python 11/17

slide-38
SLIDE 38

Implementation contd...

◮ Examples of server side scripting

language, php, python, perl, asp etc..

◮ We choose python ◮ But plane python will require coding from

scratch

Rupak Rokade SBHS Vlabs using Python 11/17

slide-39
SLIDE 39

Implementation contd...

◮ Examples of server side scripting

language, php, python, perl, asp etc..

◮ We choose python ◮ But plane python will require coding from

scratch

◮ Choose Django (python based web

development framework)

Rupak Rokade SBHS Vlabs using Python 11/17

slide-40
SLIDE 40

Implementation contd...

Rupak Rokade SBHS Vlabs using Python 12/17

slide-41
SLIDE 41

Implementation contd...

Why Django ?

Rupak Rokade SBHS Vlabs using Python 12/17

slide-42
SLIDE 42

Implementation contd...

Why Django ?

◮ Session management

Rupak Rokade SBHS Vlabs using Python 12/17

slide-43
SLIDE 43

Implementation contd...

Why Django ?

◮ Session management ◮ Data security

Rupak Rokade SBHS Vlabs using Python 12/17

slide-44
SLIDE 44

Implementation contd...

Why Django ?

◮ Session management ◮ Data security ◮ Url management

Rupak Rokade SBHS Vlabs using Python 12/17

slide-45
SLIDE 45

Implementation contd...

Rupak Rokade SBHS Vlabs using Python 13/17

slide-46
SLIDE 46

Implementation contd...

Client side

◮ Python client

Rupak Rokade SBHS Vlabs using Python 13/17

slide-47
SLIDE 47

Implementation contd...

Client side

◮ Python client ◮ Separate settings file

Rupak Rokade SBHS Vlabs using Python 13/17

slide-48
SLIDE 48

Implementation contd...

Client side

◮ Python client ◮ Separate settings file ◮ GET and POST technique

Rupak Rokade SBHS Vlabs using Python 13/17

slide-49
SLIDE 49

Implementation contd...

Rupak Rokade SBHS Vlabs using Python 14/17

slide-50
SLIDE 50

Implementation contd...

URL’s

◮ http://vlabs.iitb.ac.in/sbhs/hardware

/checkconnection

Rupak Rokade SBHS Vlabs using Python 14/17

slide-51
SLIDE 51

Implementation contd...

URL’s

◮ http://vlabs.iitb.ac.in/sbhs/hardware

/checkconnection

◮ http://vlabs.iitb.ac.in/sbhs/hardware

/clientversion

Rupak Rokade SBHS Vlabs using Python 14/17

slide-52
SLIDE 52

Implementation contd...

URL’s

◮ http://vlabs.iitb.ac.in/sbhs/hardware

/checkconnection

◮ http://vlabs.iitb.ac.in/sbhs/hardware

/clientversion

◮ http://vlabs.iitb.ac.in/sbhs/hardware

/communicate

Rupak Rokade SBHS Vlabs using Python 14/17

slide-53
SLIDE 53

Python Server structure

init .py

Rupak Rokade SBHS Vlabs using Python 15/17

slide-54
SLIDE 54

Python Server structure

init .py urls.py

Rupak Rokade SBHS Vlabs using Python 15/17

slide-55
SLIDE 55

Python Server structure

init .py urls.py

◮ define urls for communication

Rupak Rokade SBHS Vlabs using Python 15/17

slide-56
SLIDE 56

Python Server structure

init .py urls.py

◮ define urls for communication

Rupak Rokade SBHS Vlabs using Python 15/17

slide-57
SLIDE 57

Python Server structure

init .py urls.py

◮ define urls for communication

models.py

Rupak Rokade SBHS Vlabs using Python 15/17

slide-58
SLIDE 58

Python Server structure

init .py urls.py

◮ define urls for communication

models.py

◮ create classes for database communication

with tables and corresponding fields

Rupak Rokade SBHS Vlabs using Python 15/17

slide-59
SLIDE 59

Python server structure cont...

sbhs.py

Rupak Rokade SBHS Vlabs using Python 16/17

slide-60
SLIDE 60

Python server structure cont...

sbhs.py

◮ main file for communication with SBHS

  • ver USB

Rupak Rokade SBHS Vlabs using Python 16/17

slide-61
SLIDE 61

Python server structure cont...

sbhs.py

◮ main file for communication with SBHS

  • ver USB

◮ has 11 functions like setHeat, setFan,

getTemp etc.

Rupak Rokade SBHS Vlabs using Python 16/17

slide-62
SLIDE 62

Thank you rupakrokade@gmail.com

Rupak Rokade SBHS Vlabs using Python 17/17