Raspberry Pi: Full Stack
4.5 (455 ratings)
Instead of using a simple lifetime average, Udemy calculates a course's star rating by considering a number of different factors such as the number of ratings, the age of ratings, and the likelihood of fraudulent ratings.
7,284 students enrolled
Wishlisted Wishlist

Please confirm that you want to add Raspberry Pi: Full Stack to your Wishlist.

Add to Wishlist

Raspberry Pi: Full Stack

A whirlwind tour of full-stack web application development on the Raspberry Pi
4.5 (455 ratings)
Instead of using a simple lifetime average, Udemy calculates a course's star rating by considering a number of different factors such as the number of ratings, the age of ratings, and the likelihood of fraudulent ratings.
7,284 students enrolled
Created by Peter Dalmaris
Last updated 3/2017
Current price: $10 Original price: $50 Discount: 80% off
1 day left at this price!
30-Day Money-Back Guarantee
  • 7.5 hours on-demand video
  • 2 Articles
  • 1 Supplemental Resource
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of Completion
Have a coupon?
What Will I Learn?
Setup the minimal Raspbian operating system to the RPi.
Install the a Python virtual environment.
Install and use Flask, a Python-based web micro-framework
Install and use uWSGI as the application server for Flask
Install and use Nginx light-weight web server
Use the RPi GPIOs as digital input and outputs
Use a DHT22 humidity and temperature sensor
Install and use the SQLite database
Use the Google Chart API to create visual representations of the sensor data
Use JQuery to add interactivity to web pages
Use Plotly for graphical analysis of sensor data
Install and configure a USB Wifi adaptor for your RPi
View Curriculum
  • A Raspberry Pi, any version
  • A Windows, Mac or Linux computer
  • A DHT11 or DHT22 sensor
  • An 5mm LED
  • Resistors
  • A breadboard and jumper wires
  • Access to the Internet
  • A USB Wifi dongle, if available

The objective of this course is to take you to a whirlwind tour of the Raspberry Pi, and introduce you to everything that is great about it.

Structured as a project, you will become familiar with the various components that make up the web development stack: the operating system, the hardware (including the GPIOs), the application server, web server, database server, and the Python programming language.

You will also become familiar with Cloud services that you will integrate into your Raspberry Pi-powered web application.

You application will take sensor data and make them available to the user via a web interface that is constructed based on jQuery and HTML5.

You will need a Raspberry Pi, a DHT22 sensor, a button, an LED, a few resistors and a breadboard. If you wish to setup wireless networking on your Raspberry Pi, you will also need a USB Wifi dongle.

To make the most from this course, you should be familiar with basic programming and be comfortable with the command line.

Who is the target audience?
  • Some experience in programming is useful.
  • Python, Javascript (jQuery) and HTML is used throughout the course and some familiarity with basic programming concepts is expected.
  • Ability to wire electronics.
  • Ability to do independent research using online resources
Students Who Viewed This Course Also Viewed
Curriculum For This Course
Expand All 59 Lectures Collapse All 59 Lectures 07:20:05
Introduction to the course
5 Lectures 13:54

A few things about this course, how it is organized and its objectives.

Preview 02:17

What is the Raspberry Pi? Why is it such an important machine? ... and more details about the RPi.

About the Raspberry Pi

An overview of the main components that you will need in this course.

Preview 04:22

A shoping list for the components needed in this course.

Preview IFrame

A few things to help you get the most out of this course.

Please read this before continuing!
The Operating System
5 Lectures 40:10

Introduction to Section 2, The operating system.

Section Introduction

How to extract a tar.gz file

This section shows you how to install Minibian to your RPi using a Macintosh.

If you are using a Windows computer you could skip to the next lecture (although this one still contains information that you will find useful).

If you are using a Raspberry Pi 3, please note that you will need the updated Minibian Jessie 2016-3-12 release of the OS. I have worked through the stack setup guide and I can confirm that it works for RPi 3.

Installing mini Raspbian using Mac OS X

This lecture shows you how to install Minibian on your RPi using a Windows 8 computer.

If you are using a Raspberry Pi 3, please note that you will need the updated Minibian Jessie 2016-3-12 release of the OS. I have worked through the stack setup guide and I can confirm that it works for RPi 3.


You can simplify the login procedure by modifying the shortcut's target in the properties:

C:\Users\USERNAME\Downloads\putty.exe -ssh YOURUSERHERE@ -pw YOURPASSWORD HERE

Installing mini Raspbian using Windows

Section Quiz
3 questions

The conclusion to Section 2.

Section Conclusion
Python and GPIOs
7 Lectures 01:07:03

Section 3 introduction: Python and GPIOs.

Section Introduction

In this lecture, we'll install Python and the convenient Python Virtual Environment. Although you can use several other languages with your Raspberry Pi, Python is the most popular, with a lot of documentation of publicly available code that we can use.

Setup Python

In this lecture, I will explain the basics of GPIOs, and this will help a lot in understanding their use.

GPIO basics

In this lecture, we'll take the next step. I will show you how to connect an LED to the Raspberry Pi and turn it on and off via a Python script.

Make an LED blink

In this lecture, I will show how to use a GPIO pin as a digital input to read the state of a connected digital device. We'll use a simple button to simulate such a device.

If you don't have a pull-up resistor handy, you can activate the RPi's internal pull-up. To do this, use this code:

GPIO.setup(inPin, GPIO.IN, pull_up_down = GPIO.PUD_DOWN)

Thank you to Fabio Quinzi for suggesting this!

As an aside, I am not sure what the actual resistance of the internal pull-up or down is (it seems that the pull-down is 50KOhm, a very large value, and the pull-ups is smaller), and I have heard rumors of electrical noise being an issue in electrically "noisy" environments (like in a factory), so in most cases using a known external resistor is a better option.

Read the status of a button

In this lecture I will show you how to use a digital sensor, the DHT22, with your RPi.

Read temperature and humidity from a digital sensor

Section Quiz
4 questions

Section 3 conclusion.

Section Conclusion
Setup the Web application stack
11 Lectures 01:24:33

Section 4 introduction: Setting up the Web application stack.

Section Introduction

Understanding the application stack will help you understand the role that each of the components you will see going forward plays. It may sound a bit "academic", but it is worth the effort.

This lecture is about the application stack.

Preview 07:03

In this lecture, you will learn how to install the web server, Nginx.

Install Nginx, the Web server

I this lecture I will show you how to install the Python virtual environment that we will dedicate to running our application, and then install and test the Flask web development micro-framework.


At 2:11 in this lecture I mention that the "dot command executes executable files". This is not correct.

The "activate" file is a script, not executable.

As per the documentation, "(the dot) command, when invoked from the command-line, executes a script".

Please read more about this here: http://www.tldp.org/LDP/abs/html/internal.html#SOURCEREF

Install Flask and venv

In this lecture, I will show you how to install our application server, uWSGI, and configure it so that it works with Nginx to execute our Flask application.

It is a fairly long and error-prone process, so you will get the most out of this lecture if you can allocate yourself 20 uninterrupted minutes.

Install uWSGI

In this lecture you will learn how to configure your application so that the operating system is in charge of starting uWSGI when it boots.

Setup Upstart

Log files are invaluable in helping us find and fix bugs. In this lecture, I'll discuss the most important of the log files that are relevant to our application.

About log files

In this lecture, we will shift our focus to the user interface. I like it when the application I work on looks better than bare-bones, so I choose to apply a nice template to it early on. I will show you how to install and apply the Skeleton boilerplate template and make our application look better than basic.

Serving static assets and Skeleton

In this lecture I will show you how to apply the Skeleton style to the application.

Styling our Web application with Skeleton

In this lecture I will give you a few simple tips on debugging a Flask application.

Debugging a Flask application

Section Quiz
6 questions

Section 4 conclusion.

Section Conclusion
Building a simple Flask application on the Raspberry Pi
7 Lectures 01:02:24

Section 5 Introduction: Building the Flask application.

Section Intro

In this lecture I will show you how to display temperature and humidity values from the DHT22 in a web browser window.

Show DHT22 sensor data in the browser

In this lecture I will show you how to install the SQLite3 database in your RPi.

Install the SQLite3 database

In this lecture we'll use a Python script to get values from the DHT22 and store them in new database records.

Use a Python script to store sensor reading to the database

In this lecture, we'll automate the collection of values from the DHT22 by setting up a cron job.

Automate sensor data logging with cron and SQLite3

In this lecture we will setup a new page in our application in which we will display historical DHT22 data coming from the database.

Show historical sensor data in the browser

Section Quiz
3 questions

Section 5 conclusion.

Section Conclusion
Improving our application with date-time range record selector
7 Lectures 30:57

Section 6 introduction: Adding date/time range widgets and validation.

Section Introduction

In this lecture I will show you how to create database queries that return data based on start and end date/time stamps.

Selecting historical sensor data records with a time-date range

In this lecture, I will show you how to display DHT22 database records based on a date/time range specified in the URL.

Define a date-time range in the URL

In this lecture, I discuss timezones in Raspbian/Minibian.

Timezones in Rasbian

In this lecture, I show you how to validate the date/time range information submitted by the user.

Validating timestamps

In this lecture, we will do a basic refactoring the Python code.

Tidying up: refactor our application code

Section Quiz
3 questions

Section 6 conclusion.

Section Conclusion
Improving the user interface
9 Lectures 01:21:57

Section 7 introduction: Improving the UI.

Section Introduction

In this section I will show you how to add date/time radio buttons to make easy to browse through past records.

Adding date range radio buttons

In this lecture, we'll visualise the temperature and humidity values for the selected date/time range by embedding Google charts to the records page.

Visualise sensor data with Google Charts

In this lecture, we will continue improving the user interface. We'll make it easy to select a datetime range for the records that we want to retrieve from the database by installing datetime widgets. In the next lecture, I'll show you how to set it up.

Install a datetime picker widgets

In this lecture, I'll show you how to set up the datetime picker widget and make it work.

If you are having trouble with the datetime picker widget, please try to install the full version of the plugin using the link in the External Resouces box (below).

Setting up the datetime picker widget

In this lecture, I will start the process of fixing the annoying time zone problem by updating the code on the client side, and then move on to the server.

Setting up time zones on the client side

In this lecture, I will show you how to complete the timezone calculation capability on the server side.

Setting up time zones on the server side

In this lecture, we'll add links to make it easy to move between the two pages of the application.

It's only a small change to the user interface.

Link the two pages of the application

Section Quiz
3 questions

Section 7 conclusion.

Section Conclusion
Setup cloud charting and analysis with Plotly
5 Lectures 32:18

Section 7 conclusion: Plotly.

Section Introduction

In this lecture, I will discuss Plotly, show you some of the things you can do with it, and set it up on your Raspberry Pi.

Setup Plotly

In this lecture I'll show you how to create the user interface for Plotly on the client side of the application.

Even though it looks simple from a user perspective, the way that it works under the hood is fairly involved.

Add Plotly links

In this lecture, which is the last for this section, I will show you how to create this application logic on the server side.

Add Plotly support to the Flask application script

Section Quiz
3 questions

Section 8 conclusion.

Section Conclusion
Other useful things to know
1 Lecture 22:22

In this lecture I will show you how to install a Wifi USB dongle to your Raspberry Pi and go wireless (at least for the networking part).

As long as you have a Wifi dongle with a supported chipset and a WPA/WPA2 wireless router, the process described in this lecture should work for you.

Install and configure a Wifi USB dongle for wireless networking
2 Lectures 04:47

Course conclusion. What's next??


Other educational content from Peter, including coupon offers
About the Instructor
Peter Dalmaris
4.5 Average rating
3,455 Reviews
35,638 Students
11 Courses
Tech Explorer

Peter Dalmaris is an electronics hobbyist and Maker, creator of eight online video courses on DIY electronics and author of three technical books. 

As a Chief Tech Explorer since 2013 at Tech Explorations, the company he founded in Sydney, Australia, Peter’s mission is to explore technology and help educate the world. 

A life-long learner, Peter’s core skill is in explaining difficult concepts through video and text. With over 15 years in tertiary teaching experience, Peter has developed a simple yet comprehensive style in teaching that students from all around the world appreciate. 

His passion for technology and in particular for the world of DIY open source hardware has been a powerful driver that has guided his own personal development and his work through Tech Explorations.

Peter’s current online courses have helped over 30,000 people from around the world to be better Makers. His video courses include:

* Arduino Step by Step: Your Complete Guide

* Advanced Arduino Boards and Tools

* Raspberry Pi: Full Stack

* Raspberry Pi: Make a Workbench Automation Computer

* Kicad Like a Pro

* The Electronics Workbench: A Setup Guide

* Arduino Fun: Make a High Tech Remote Controlled Car

* Beginning Arduino: Make a environment monitor system

Peter’s books are:

* Kicad Like a Pro: Learn the World’s Favourite Open Source PCB Electronic Design Automation tool

* Raspberry Pi: Full Stack: A whirlwind tour of full-stack web application development on the Raspberry Pi

* Arduino: a comprehensive starting up guide for complete beginners