Raspberry Pi – Web Server for the rest of us



Raspberry Pi – Web Server for the rest of us

9 11


Raspberry-Pi-Web-Server-With-Python

Class exercise to introduce the use of Raspberry Pi as a web server, using Python

On Github SUNY-Albany-CCI / Raspberry-Pi-Web-Server-With-Python

Raspberry Pi

Web Server for the rest of us

Created by Luis Ibanez / @luisibanez

Git Introduction by Luis Ibanez is licensed under a Creative Commons Attribution 3.0 Unported License.

Raspberry Pi

An inexpensive computer designed to empower a new generation of developers.

Open a Terminal

Three Steps

  • Go to home directory
  • Make new directory www
  • Change into new directory www
  • Launch simple Python web server

Like This...

Open a Browser

use port 8000

Output in the Server

Stop Server: CTRL-C

Create index.html file

Relaunch the Server

Refresh the Browser

use port 8000

Stop Server: CTRL-C

Create simpleServer.py file

Run the server with Python

Refresh the Browser page

Talking

Back

Create new server

simpleServerWithHandler.py

Create new Handler

simpleServerWithHandler.py

Create new Handler

simpleServerWithHandler.py

Run the Server

Open a Browser

use port 8000

Review the Server

The

Camera

The Camera

Pi Camera

Modify the Server

MyCameraHandler

Modify the Handler

Call Subprocess

Modify the Handler

Include image in response

Run the Server

Refresh the Browser

use port 8000

Review the Server

Your Turn !

How to set

the image filename

from the browser?

How to set

the image size

from the browser?

THE END

BY Luis Ibanez