raspberry pi tutorial 2 - new jersey state library · raspberry pi tutorial 2 . date: 2/20/2014 ....

15
Raspberry Pi Tutorial 2 Date: 2/20/2014 Demonstrations: 1. John Mosser will demonstrate a motion sensor using a Raspberry Pi. 2. Alain Tschanz will demonstrate how to access and monitor your Raspberry Pi from anywhere in the world via the Internet. Tutorial 2: The second Raspberry Pi tutorial will cover the recommended Raspberry Pi operating system called “Raspbian.” We will learn how to update the RasberryPi firmware, the operating system and how to install additional software from an external software repository.

Upload: truongtu

Post on 08-Oct-2018

229 views

Category:

Documents


0 download

TRANSCRIPT

Raspberry Pi Tutorial 2

Date: 2/20/2014 Demonstrations: 1. John Mosser will demonstrate a motion sensor using a Raspberry Pi. 2. Alain Tschanz will demonstrate how to access and monitor your Raspberry Pi from anywhere in the world via the Internet. Tutorial 2: The second Raspberry Pi tutorial will cover the recommended Raspberry Pi operating system called “Raspbian.” We will learn how to update the RasberryPi firmware, the operating system and how to install additional software from an external software repository.

Raspberry Pi Motion Sensor • Tutorial is available at: http://learn.adafruit.com/downloads/pdf/pir-

passive-infrared-proximity-motion-sensor.pdf

Remote Access to Raspberry Pi Method 1: SSH (Secure Connection) Requirements:

- Home router configured to accept SSH traffic - Raspberry Pi: SSH enabled - Know your router’s Internet IP address (To find your routers

Internet IP address, go to http://ip-lookup.net/) - Have SSH client installed (for ex. Putty) on computer - Command to run: raspberrypi@pi $ > ssh <username>@<host> For example: > ssh [email protected]

Remote Access to Raspberry Pi, cont.

Command line interface:

Remote Access to Raspberry Pi, cont. Method 2: RaspCTL is an application that lets you control you Raspberry Pi through a web interface. URL: http://raspctl.com/ To access your Raspberry Pi, go to: http://raspberrypi-ip-address:8086 (8086 is the default port)

Remote Monitoring Raspberry Pi

Method 1: Rpi-Monitor Access your Raspberry Pi via a web browser or a phone*: http://raspberrypi-ip-address:8888 (default port)

*You must have a QR Code Reader installed.

Remote Monitoring Raspberry Pi, cont.

Method 3: PSIAndroid PSIAndroid is an Android phpSysInfo client Source: https://github.com/rk4an/psiandroid

Features: - Operating System Information (Version, Uptime, ...) - CPU, Memory and Disk usage - Multi-host - HTTPS - Basic/Digest Authentication - Temperatures (Motherboard and IPMI) - Fans speed (Motherboard) - Network informations - PSStatus - SMART - RAID - UPS - UpdateNotifier - Printers (SNMP) - Other plugins (coming soon)

Remote Monitoring Raspberry Pi, cont.

Method 4: Raspcontrol URL: http://raspberrypi-ip-address/raspcontrol

Upgrade Raspberry Pi Firmware

• raspberrypi@pi $ > sudo apt-get install rpi-update Or raspberrypi@pi $ > wget http://goo.gl/1BOfJ -O /usr/bin/rpi-update && sudo chmod +x /usr/bin/rpi-update Note: If wget is not installed run the following command: raspberrypi@pi $ > sudo apt-get install wget

Update and Upgrade Raspbian

Step 1: Update the repositories raspberrypi@pi $ > sudo apt-get update

Step 2: Upgrade the packages raspberrypi@pi $ > sudo apt-get upgrade

Installing and Uninstalling Software

Step 1: Search for the package raspberrypi@pi $ > sudo apt-cache search xeyes Step 2: Install a package raspberrypi@pi $ > sudo apt-get install tuxeyes To verify installation, run this command: raspberrypi@pi $ > tuxeyes

Step 3: Uninistall a package raspberrypi@pi $ > sudo apt-get remove tuxeyes To verify removal of software, run this command: raspberrypi@pi $ > tuxeyes

Basic Command line Commands • sudo (allows a permitted user to execute a command as superuser) • ls (ls -l, ls -al, ls -ah) • cd (cd ../, cd /, cd /home) • man (man apt-get) • cp (copy) • mv (move) • rm (remove) • mkdir (create directory) • rmdir (remove directory) • whomai (display current user name) • date (display current date) • hostname (display current host name) • exit (exit terminal window) • du (du -h)

Poll: What should the next RaspberryPi Demonstration be?

• Raspberry Pi Camera • Home Theater (Raspbmc) • Scratch programming • Temperature Sensor • Raspberry Pi as a Tor Router and Web Filter • Connecting to an Arduino

PhpSysInfo Installation raspberrypi@pi $ > sudo apt-get install apache2 php5 libapache2-mod-php5 raspberrypi@pi $ > cd /var/www raspberrypi@pi $ > sudo git clone https://github.com/rk4an/phpsysinfo.git raspberrypi@pi $ > sudo chown -R www-data phpsysinfo/ raspberrypi@pi $ > cd /var/www/phpsysinfo raspberrypi@pi $ > cp phpsysinfo.ini.new phpsysinfo.ini