Raspberry Pi
From ATI Chennai IT and ITES Wiki
Back to IoT Course Material
In India, Element14 sells RaspberryPi. See Video.
Contents |
Boards
Technical Specifications
Parameter | Value |
---|---|
Brand | Raspberry Pi |
Series | Model B |
Colour | Black |
Item Height | 34 Millimeters |
Item Width | 7.6 Centimeters |
Screen Size | 60 Inches |
Item Weight | 45.4 g |
Product Dimensions | 12.2 x 7.6 x 3.4 cm |
Item model number | RASPBERRYPI3-MODB-1GB |
Processor Count | 4 |
RAM Size | 1 GB |
Wireless Type | 802.11bgn |
Number of USB 2.0 Ports | 4 |
Voltage | 5 Volts |
Operating System | Ubuntu Mate, Snappy Ubuntu Core, PINET, Windows 10 IOT, Raspbian, Pidora, OSMC, OpenElec, RISC OS, Arch Linux |
Included Components | Motherboard |
Pinout
- The live size Raspberry Pi 2/3 Model B pinout header image can be used for creating plugin cards / legends on the board.
- PinOut.xyz is a site dedicated to the various Raspberry Pi board headers | GitHub Repo.
- Low Level Peripherals Pinout Wiki
- Sysfs for GPIO
- PWM via Sysfs | Pigpio Library for PWM | PiScope | Hardware Clock
Running PHP on Raspberry Pi
PHP is installed along with Git and WiringPi by:
sudo apt-get install apache2 git-core php5 # or a more lightweight one # sudo apt-get install lighttpd git-core php5 git clone git://git.drogon.net/wiringPi cd wiringPi ./build # Check the install gpio -v gpio readall
The LED.php script in the webroot can be like:
<html> <head> <meta name="viewport" content="width=device-width" /> <title>LED Control</title> </head> <body> LED Control: <form method="get" action="gpio.php"> <input type="submit" value="ON" name="on"> <input type="submit" value="OFF" name="off"> </form> <?php $setmode17 = shell_exec("/usr/local/bin/gpio -g mode 17 out"); if(isset($_GET['on'])) { $gpio_on = shell_exec("/usr/local/bin/gpio -g write 17 1"); echo "LED is on"; } else if(isset($_GET['off'])) { $gpio_off = shell_exec("/usr/local/bin/gpio -g write 17 0"); echo "LED is off"; } ?> </body> </html>
Raspberry Pi Cheat Sheet
# RPi.GPIO Basics cheat sheet - Don't try to run this. It'll fail! # Alex Eames http://RasPi.TV # http://RasPi.TV/?p=4320 # RPi.GPIO Official Documentation http://sourceforge.net/p/raspberry-gpio-python/wiki/Home/ # PWM Usage: https://sourceforge.net/p/raspberry-gpio-python/wiki/PWM/ import RPi.GPIO as GPIO # import RPi.GPIO module # choose BOARD or BCM GPIO.setmode(GPIO.BCM) # BCM for GPIO numbering GPIO.setmode(GPIO.BOARD) # BOARD for P1 pin numbering # Set up Inputs GPIO.setup(port_or_pin, GPIO.IN) # set port/pin as an input GPIO.setup(port_or_pin, GPIO.IN, pull_up_down=GPIO.PUD_DOWN) # input with pull-down GPIO.setup(port_or_pin, GPIO.IN, pull_up_down=GPIO.PUD_UP) # input with pull-up # Set up Outputs GPIO.setup(port_or_pin, GPIO.OUT) # set port/pin as an output GPIO.setup(port_or_pin, GPIO.OUT, initial=1) # set initial value option (1 or 0) # Switch Outputs GPIO.output(port_or_pin, 1) # set an output port/pin value to 1/GPIO.HIGH/True GPIO.output(port_or_pin, 0) # set an output port/pin value to 0/GPIO.LOW/False # Read status of inputs OR outputs i = GPIO.input(port_or_pin) # read status of pin/port and assign to variable i if GPIO.input(port_or_pin): # use input status directly in program logic # Clean up on exit GPIO.cleanup() # What Raspberry Pi revision are we running? GPIO.RPI_REVISION # 0 = Compute Module, 1 = Rev 1, 2 = Rev 2, 3 = Model B+ # What version of RPi.GPIO are we running? GPIO.VERSION # What Python version are we running? import sys; sys.version
Availability and Accessories
- RPi Buying Guide - International
- Other than Amazon, all other vendors quote prices before GST (18%).
- Buy Pi 3 in INR at
- DIY 16 in 1 Sensor Module Kit for Raspberry Pi @ Rs 1001 + 18% GST
- Raspberry Pi 3 Aluminum Alloy Metal Case With Fan @ Rs 667 + 18% GST
Video Lectures
References
- IoT 101 | RPi CLI
- RasPi System Software Reference
- Raspberry Pi Hardware Reference
- ARM Assembly Programming in RasPi GUI
- RaspControl Web Interface for Raspberry Pi | Code
- Beginners Guide | Download | Tute | Clemson Tutorial | Flashing LED
- RPi.GPIO - soft PWM | Usage | Interface
- PHP GPIO Library | Compile | Web Server | Temperature
- Control Relay from Anywhere
- Hardware Interfacing RasPi
- Raspberry Pi GPIO PWM
- Downloads
- Useful Raspberry CLI Commands | Github Gist
- Not Vulnerable to Spectre and Meltdown Attacks
- Manual | Basics
- Official eBooks
- Raspberry Pi Cookbook
- Mastering the Raspberry Pi
- Raspberry Pi Projects for the Evil Genius
- Raspberry Pi By Example
- Ruby Robot | IoT Printing | CUPS Printing
- Raspberry Pi for Dummies, 2013
- Raspberry Pi Annual 2015
- Learning Computer Architecture with Raspberry Pi 2016
- Send EMail from RaspberryPi | Code
- MagPi - Issue 68 April 2018
- RasPi Issue 45
- CDP Studio IDE