Raspberry pi
Upcoming SlideShare
Loading in...5
×
 

Raspberry pi

on

  • 5,428 views

The Raspberry Pi is an ultra-low-cost credit-card sized Linux computer. I.e., $35 buys you a small device with 2 USB ports, ethernet, HDMI, and analog video and audio out. The device has 512MByte ...

The Raspberry Pi is an ultra-low-cost credit-card sized Linux computer. I.e., $35 buys you a small device with 2 USB ports, ethernet, HDMI, and analog video and audio out. The device has 512MByte SDRAM on board and comes equipped with an SDCard slot for 'external storage'. There are several Linux Distributions available for the RasPi and what you can build with it, seems almost limitless.
The Raspberry Pi, a general purpose computer, a headless server, an embedded system:
Creating a Raspbian (optimized version of Debian) SDCard to boot from, containing LXDE, Midori, etc.
Cutting the cord, using a small WiFi USB-dongle with the Raspberry Pi
TightVNC - Providing a GUI even when running the Raspi as an headless server
Using the Raspberry Pi as an IP Web Cam Server
What's happening at boot and how would a tiny "Hello Word" distribution look like
Using a RS-232 Serial connection to talk to the Raspberry Pi
Using the Raspberry Pi as an truely embedded system. Hacking with SPI, light sensors, LEDs etc.

Statistics

Views

Total Views
5,428
Slideshare-icon Views on SlideShare
3,128
Embed Views
2,300

Actions

Likes
4
Downloads
195
Comments
0

10 Embeds 2,300

http://wolfpaulus.com 1714
http://www.scoop.it 559
http://dev.lx-world.com 6
http://lxworld.docebosaas.com 5
http://webcache.googleusercontent.com 4
http://translate.googleusercontent.com 3
http://managerv3.3rdi-technology.com 3
http://www.google.ca 3
http://www.linkedin.com 2
http://www.google.com 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Raspberry pi Raspberry pi Presentation Transcript

    • Raspberry Pi .. what we have learned so far .. http://wolfpaulus.comCopyright © 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved.
    • General Purpose Computer Headless Server Embedded SystemCopyright © 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved.
    • Model BCopyright © 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved.
    • RaspberryPi Prototype Model AWhy ?“From a position in the mid-1990, when 17-year-olds came to the University with agrounding in several computer languages, hardware hacking, and often even withassembly language, we gradually found ourselves in a position where, by 2005, thesekids were arriving having done some HTML - with a bit of PHP and Cascading StyleSheets if you were lucky.” Copyright © 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved.
    • H!tory May 2011 Video of the Raspberry Pi, recorded by tech journalist Rory Cellan-Jones with his phone, goes viral. Feb 29th 2012 Google shows more searches for “Raspberry Pi” than “Lady Gaga” and hardware suppliers’ Websites crash under the load of up to 7 orders per second. June 2012 Raspberry Pi User Forum has 20K members who have written more than 100K posts. Feb 2013 One Million Raspberry Pi sold Copyright © 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved.
    • Model BCopyright © 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved.
    • Model ACopyright © 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved.
    • Operating Sy"ems • AROS • Android 4.0 (Ice Cream Sandwich) • Arch Linux ARM • Debian Squeeze • FreeBSD • Firefox OS • Gentoo Linux • Google Chrome OS • NetBSD • Raspberry Pi Fedora Remix • Open webOS • Raspbian (Debian Wheezy port with faster floating point support) • RISC OS • Slackware ARM • QtonPi (Linux distribution based on the Qt framework) Copyright © 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved.
    • Creating a bootable SDCard Mac OS X System Information Tool Copyright © 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved.
    • Creating a bootable SDCardDownload the compressed image file from http://www.raspberrypi.org/downloadsUn-compress the archive, to get to the image file.df -h, to determine which drive is used for the SDCard $ sudo diskutil unmount /dev/disk2s1 $ sudo dd bs=1m if=./2012-09-18-wheezy-raspbian.img of=/dev/rdisk2 $ sync $ sudo diskutil eject /dev/rdisk2 Copyright © 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved.
    • Copyright © 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved.
    • Configu#ng Ra$berry Pi Copyright © 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved.
    • DemoCopyright © 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved.
    • Configu#ng Ra$berry Pi • sudo raspi-config • Expand the disk image from 2GB all the way ... • Re-boot • sudo raspi-config • Configure Local • Configure Keyboard Layout • Configure TimeZone • Change Password • Enable SSH Copyright © 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved.
    • Ra$berryPi LXDE Copyright © 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved.
    • Ra$berryPi $ sudo nano /etc/wpa_supplicant/$ cat /etc/network/interfaces wpa_supplicant.conf ..auto lo network={iface lo inet loopback ssid=”SSID”iface eth0 inet dhcp psk=”******“ proto=RSNallow-hotplug wlan0 key_mgmt=WPA-PSKiface wlan0 inet manual pairwise=CCMPwpa-roam /etc/wpa_supplicant/wpa_supplicant.conf auth_alg=OPENiface default inet dhcp } Copyright © 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved.
    • Ho"name “raspberrypi” Change Hostname: sudo nano /etc/hostname sudo nano /etc/hosts Copyright © 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved.
    • Ra$berry Pi Headless ServerPt.2 Copyright © 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved.
    • Steps to make a Raspberry Pi Supercomputerhttp://www.southampton.ac.uk/~sjc/raspberrypi/pi_supercomputer_southampton_web.pdfMPI: A High Performance Message Passing Libraryhttp://www.open-mpi.org/ Copyright © 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved.
    • Ra$berryPi Sources to retrieve packages from: /etc/apt/sources.list APT Advanced Packaging Tool (APT)apt-get update - updates current list of available packagesapt-get upgrade - updates currently installed packagesapt-get install package-name - installs or upgrades package-nameapt-cache search name - searches the package list for nameapt-get remove package-name - removes packageapt-get --purge remove package-name - removes package and configuration filesapt get autoclean - removes files, needed during upgrade process apt-get autoremove - removes not longer needed dependencies Copyright © 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved.
    • Ra$berryPi VNC ServerInstall: sudo apt-get install tightvncserverStart: tightvncserverStop: tightvncserver -kill :1 Copyright © 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved.
    • DemoCopyright © 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved.
    • Ra$berry Pi Camera Server Copyright © 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved.
    • Ra$berry Pi Camera Server1.) Get the mpeg-streamer source code:svn co https://mjpg-streamer.svn.sourceforge.net/svnroot/mjpg-streamer mjpg-streamer2.) Installing build dependenciessudo apt-get install libjpeg8-dev imagemagick3.) make4.) Starting the Camera Stream./mjpg_streamer -i "./input_uvc.so" -o "./output_http.so -w ./www"<p  align="center">    <img  src="http://<IP>:8080/?action=stream"  width="1280"  height="960"  /></p> Copyright © 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved.
    • DemoCopyright © 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved.
    • Ra$berry Pi Embedded Sy"emPt.3 Copyright © 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved.
    • Arduino UNO : Arduino MEGA : Raspberry Pi Copyright © 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved.
    • UNO MEGA DUE PiOperating Voltage 5V 5V 3.3 V 3.3 V SRAM 2 KB 8 KB 96 KB 512 MBFLASH-Memory 32 KB 256 KB 512 KB up to 64 MB Clock Speed 16 MHz 16 MHz 84 MHz 700 MHz USB Host n/a n/a 1 2 Network n/a n/a n/a 10/100 wired Ethernet RJ45 HDMI, Composite Video, Audio / Video n/a n/a n/a TRS-audio jackCurrent I/O pins 40 mA 40 mA total 130 mA 2 to 16 mA Digital I/O Pins 14 (6 PWM) 54 (15 PWM) 54 (12 PWM) 17 (1 PWM) 12Analog Input Pins 6 16 2DAC Analog Out 0 Price $30 $59 $50 $35 Copyright © 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved.
    • Ra$berryPi wi& ADC MCP3008 8-Channel 10-Bit ADC With SPI Interface Copyright © 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved.
    • I2C SPICopyright © 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved.
    • Ra$berryPi Inter-IC Bus - I2C I2C connects the same two signal lines to all slaves. I.e. addressing is required and all devices need a unique address SDA - Serial Data SCL - Serial Clock Copyright © 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved.
    • Ra$berryPi Se#al Pe#pheral Interface Bus - SPI SPI requires four signals: clock (SCLK) master output/slave input (MOSI) master input/slave output (MISO) slave select (SS) or (CS) chip-select Copyright © 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved.
    • pi@raspberrypi ~ $ cat /etc/modprobe.d/raspi-blacklist.conf# blacklist spi and i2c by default (many users dont need them)blacklist spi-bcm2708blacklist i2c-bcm2708Loading Kernel Modules:- Edit the raspi-blacklist.conf, so that the i2c module gets enabled. I2C- Add the following lines to /etc/modules  i2c-dev i2c-bcm2708Reboot, and confirm ls /dev/i2c*shows /dev/i2c-0 /dev/i2c-1Installing Dependencies:sudo apt-get install python-smbus i2c-toolsWith i2c devices connected, run somthing like this, to discover devices addresses.sudo i2cdetect -y 0 Copyright © 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved.
    • pi@raspberrypi ~ $ cat /etc/modprobe.d/raspi-blacklist.conf# blacklist spi and i2c by default (many users dont need them)blacklist spi-bcm2708blacklist i2c-bcm2708Loading Kernel Modules:Edit the raspi-blacklist.conf, so that the spi module gets loaded, SPIReboot, and confirm with lsmod that ‘spidev’ and ‘spi_bcm2708’ are now loaded andls /dev/spi* shows two spi devices: /dev/spidev0.0 and /dev/spidev0.1Installing Dependencies:sudo apt-get install python-dev git-coreInstall Python bindings for Linux SPI access through spidev:cd ~git clone git://github.com/doceme/py-spidevcd py-spidev/sudo python setup.py install... which creates /usr/local/lib/python2.7/dist-packages/spidev.so Copyright © 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved.
    • IN =[0000 0001][1CNL ----][---- ----] (8+channel) <<4OUT=[---- ----][---- -XXX][XXXX XXXX] (10bit) ((r[1] & 3) << 8) + r[2] Copyright © 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved.
    • r = spi.xfer2( [1, (8+chnnl)<<4, 0] ) return ((r[1] & 3) << 8) + r[2]IN =[0000 0001][1CNL ----][---- ----] (8+channel) <<4OUT=[---- ----][---- -XXX][XXXX XXXX] r[0] ((r[1] & 3) << 8) + r[2] Copyright © 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved.
    • 1 #!/usr/bin/python2 import spidev3 import time45 # Performs SPI transaction, CS will be held active between blocks6 # Generally, SPI transfer can transport up to 8KBytes7 def readadc(chnnl):8 if (chnnl > 7) or (chnnl < 0):9 return -110 r = spi.xfer2( [1, (8+chnnl)<<4, 0] )11 return ((r[1] & 3) << 8) + r[2]1213 # Sends a String to an 7-Segment LED display, connected via SPI14 # The maximum speed of the SPI clock input is 250kHz.15 # SPI mode 0 (CPOL = 0, CPHA = 0);16 # the clock line should idle low, and data is sampled on the rising edge of the clock.17 def sendDisplay(s) :18 spi.xfer2([118]) # clear screen19 ca = list(s) # convert the string into a char array20 spi.xfer2([ord(ca[0]),ord(ca[1]),ord(ca[2]),ord(ca[3])])21 return2223 # Simple moving average of the list. Up to length item are included.24 # The new value is added to the given list while the 1st value might be removed.25 def movavg(list, length, value):26 list.append(value)27 if length < len(list) :28 del list[0]29 sum=030 for x in list[:] :31 sum+=x32 return sum / len(list) Copyright © 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved.
    • 3334 # Declare Global Variables35 #36 spi = spidev.SpiDev()37 pause = 0.538 adc_channel = 039 movavg_window = 340 l = list()4142 # Main Loop43 #44 while True:45 time.sleep(pause)4647 spi.open(0,0) # Connects the spi object to /dev/spidev-0.048 value = readadc(adc_channel) # Read the current ADC Channel value49 spi.close() # Done with this SPI channel for now5051 ma = movavg(l, movavg_window, value)52 sa = %04d % ma5354 print value # Show current sensor value in console5556 spi.open(0,1) # Connects the SPI object to /dev/spidev-0.157 spi.mode=0 # SPI mode 0 (CPOL = 0, CPHA = 0);58 spi.max_speed_hz = 250000 # Set SPI clock speed to 250kHz.59 sendDisplay(sa) # update the display60 spi.close() # Done with this SPI channel for now Copyright © 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved.
    • Ground SPI ADC SPI3.3V LED-Display Light CS Sensor CS Copyright © 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved.
    • SPI ADC SPI LightLED-Display CS CS Sensor Copyright © 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved.
    • DemoCopyright © 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved.
    • Se#al Access Ra$berry Pi Copyright © 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved.
    • Copyright © 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved.
    • USB to TTL Serial Cable$10 Copyright © 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved.
    • Copyright © 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved.
    • $ 20 USB to Serial Copyright © 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved.
    • Copyright © 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved.
    • FTDI Basic Breakout - 3.3V$ 15 Copyright © 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved.
    • Copyright © 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved.
    • DemoCopyright © 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved.
    • Copyright © 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved.
    • Booting Ra$berry Pi Copyright © 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved.
    • Copyright © 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved.
    • 60MB Boot Partition easily accessible from your PC rootfs and tmpfs Copyright © 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved.
    • Copyright © 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved.
    • Summary .. what we have learned so far .. General Purpose Computer Headless Server Embedded SystemCopyright © 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved.
    • (anks for coming http://wolfpaulus.comCopyright © 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved.