raspberry pi in higher education - databaselabdatabaselab.org/files/cambridge.pdf · raspberry pi...

Post on 09-Jun-2018

214 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Seite 1

Raspberry Pi in Higher Education

Alexander ElsasGoethe University Frankfurt, Germany

aelsas@finance.uni-frankfurt.de

The Raspberry Pi Big Birthday Weekend, Cambridge

Seite 2

Alexander Elsas

Assistant Professor

Economics, Management & Information Systems

Database developer with APEX

Information Systems for Business Students

Management for Computer Science Students

Raspberry Pi since February 2012

Seite 3

Seite 4

To Carry Coals to Newcastle

● Price tag● Performance● Flexibility● GPIO● Wolfram● ...

Seite 5

Experiences so far

Introduced the Raspberry Pi in every introductory course for business students since winter semester 2012:

● Always an overwhelming positive reaction,● lots of questions far beyond the syllabus,● biggest motivation the multimedia center.

Based on these positive reactions the “Two Simple Projects“ have been created.

Seite 6

Two Simple Projects

PiMMS: Pi-based Multimedia System

FRAdir: Operating directions of Frankfurt Airport

Objective:

Get business students an intro into computer science (information systems) and provide them a feeling of success to boost their motivation.

Seite 7

PiMMS

Turn-key digital signage system:

Power-on on premise

No network connectivity needed

No manual configuration necessary

Boots into slideshow No coding, just configuration of existing programs

Fast results, product can be used in a real-life scenario

Possible extension: integrate network connectivity

Seite 8

FRAdir

FRAport publishes the actual direction of operation of Frankfurt Airport (FRA) on their website (07 East / 25 West)

Objective: Gather data from the website, store it in a database for later analysis

Programming exercise in Python in a nutshell

Possible extension: 7-segment LED display

Seite 9

Show-and-Tell

Both projects can be seen tomorrow.

Seite 10

Computer Science Students

● Course “Introduction into ERP“● Very SAP-oriented● Students “hate“ SAP● Open Source ERP with Raspberry Pi● Installation and configuration of OpenERP (now Odoo:

http://en.wikipedia.org/wiki/Odoo) ● Comparison of performance, GUI, etc

Seite 11

Further projects in the pipeline

● SQL-Box:

Raspberry Pi as database server, equipped with MySQL or SQLite as SQL learning tool

● Pi-Lab:

Establish an infrastructure on campus to support more advanced projects

● Ideas from the audience ...

Seite 12

Best Programming Language?

● Learning to programme is independent from a specific language.

● A problem must be analyzed, divided in sub-problems, etc …

● At the end of the day the remaining problems are on the level of individual statements of the chosen programming language.

Programming is a process, not a language!

Seite 13

Something completely different

Raspberry Pi and its success, ecosystem, created jobs and businesses as object of economic analysis.

Seite 14

Contact

Alexander Elsas

Goethe-Universität Frankfurt

Theodor-W.-Adorno-Platz 3

D-60323 Frankfurt

Telephone: +49 69-798 33636

Fax: +49 69-798 33639

Email: aelsas@finance.uni-frankfurt.de

Internet: databaselab.de

Seite 1

PiMMS & FRAdir – Two Simple Projects

Alexander ElsasGoethe University Frankfurt, Germany

aelsas@finance.uni-frankfurt.de

The Raspberry Pi Big Birthday Weekend, Cambridge

Seite 2

Two Simple Projects

PiMMS: Pi-based Multimedia System

FRAdir: Operating directions of Frankfurt Airport

Objective:

Get business students an intro into computer science (information systems) and provide them a feeling of success to boost their motivation.

Seite 3

PiMMS

Turn-key digital signage system:

Power-on on premise

No network connectivity needed

No manual configuration necessary

Boots into slideshow No coding, just configuration of existing programs

Fast results, product can be used in a real-life scenario

Possible extension: integrate network connectivity on premise

Seite 4

Seite 5

Seite 6

Seite 7

Components

Monitor feh as slideshow application

starts automatically after booting into LXDE xscreensaver to disable screensaver of LXDE

sudo apt-get install feh xscreensaver

Seite 8

Technical Details

feh -pzrFYD10 slideshows in slideshow, make slideshow executable(http://man.finalrewind.org/1/feh/ for options of feh)

Autostart in LXDE:Add @/home/pi/slideshow to /etc/xdg/lxsession/LXDE-pi/autostart

Seite 9

Looking for ...

Replacement for feh which can also show video (like Irfanview)

Seite 10

FRAdir

FRAport publishes the actual direction of operation of Frankfurt Airport (FRA) on their website (07 East / 25 West)

Objective: Gather data from the website, store it in a database for later analysis

Programming exercise in Python in a nutshell

Possible extension: 7-segment LED display

Seite 11

Data source: http://apps.fraport.de/betriebsrichtung/betriebsrichtung.html

Seite 12

Source Code: betriebsrichtung.py

#!/usr/bin/python

import urllib, time, sqlite3, smtplib

from email.message import Message

#URl einlesen

sock = urllib.urlopen("http://apps.fraport.de/betriebsrichtung/betriebsrichtung.html")

htmlSource = sock.read()

sock.close()

beg = htmlSource.find("Betriebsrichtung")

betriebsrichtung = htmlSource[beg+60]

if (betriebsrichtung == "0"):

betriebsrichtung = "Ost 07"

else:

betriebsrichtung = "West 25"

Seite 13

seit = htmlSource.find("seit")

datum = htmlSource[seit+5:seit+15]

zeit = htmlSource[seit+17:seit+25]

sep = ";"

ausgabe = betriebsrichtung+ sep+ datum+" "+ zeit+ sep+ time.strftime("%c")

print ausgabe

Seite 14

f = open('status.br', 'r')

last = f.readline()

f.close()

#print last

msg = Message()

msg.set_payload(ausgabe)

msg["Subject"] = "Betriebsrichtung: "+betriebsrichtung

msg["From"] = "aelsas@gmail.com"

msg["To"] = "aelsas@gmail.com"

Seite 15

if (last[0] <> betriebsrichtung[0]):

#print "Wechsel!!!"

f = open('status.br', 'w')

f.write(betriebsrichtung)

f.close

# csv fortschreiben

f = open('br.csv', 'a')

f.write(ausgabe+'\n')

f.close

# html datei updaten

sep = "<br>"

ausgabe = "<div style>"+betriebsrichtung+ sep+ "Seit: " +datum+" "+ zeit+ sep+"Update: "+ time.strftime("%c")+"</div>"

f = open('/var/www/br.html', 'w')

f.write(ausgabe)

f.close

Seite 16

# datenbank

#if (True):

db = sqlite3.connect('br.db')

cursor = db.cursor()

cursor.execute('''INSERT INTO br(id, richtung, zeit, bemerkung)VALUES(NULL,?,?,?)''', (betriebsrichtung, zeit+";"+datum, ' '))

db.commit()

db.close()

Seite 17

# email

#if (True):

smtpobj = smtplib.SMTP("smtp.gmail.com", 587)

smtpobj.ehlo()

smtpobj.starttls()

smtpobj.ehlo()

smtpobj.login('pegasuselsas@gmail.com', 'mysecretpassword')

smtpobj.sendmail('pegasuselsas@gmail.com', 'aelsas@gmail.com', msg.as_string())

smtpobj.quit

Seite 18

Email on midday: statusbr.py

#!/usr/bin/python

import smtplib

from email.message import Message

f = open('status.br', 'r')

last = f.readline()

f.close()

msg = Message()

msg.set_payload(last)

msg["Subject"] = "Betriebsrichtung: "+last

msg["From"] = "aelsas@gmail.com"

msg["To"] = "aelsas@gmail.com"

smtpobj = smtplib.SMTP("smtp.gmail.com", 587)

smtpobj.ehlo()

smtpobj.starttls()

smtpobj.ehlo()

smtpobj.login('pegasuselsas@gmail.com', 'mysecretpassword')

smtpobj.sendmail('pegasuselsas@gmail.com', 'aelsas@gmail.com', msg.as_string())

smtpobj.quit

Seite 19

Crontab

betriebsrichtung.py is started hourly

statusbr.py always on midday

Seite 20

Seite 21

Contact

Alexander Elsas

Goethe-Universität Frankfurt

Theodor-W.-Adorno-Platz 3

D-60323 Frankfurt

Telephone: +49 69-798 33636

Fax: +49 69-798 33639

Email: aelsas@finance.uni-frankfurt.de

Internet: databaselab.de

top related