Raspberry pi

of 60 /60
Raspberry Pi .. what we have learned so far .. Copyright © 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved. http://wolfpaulus.com

Embed Size (px)

description

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.

Transcript of Raspberry pi

  • 1. Raspberry Pi .. what we have learned so far ..http://wolfpaulus.comCopyright 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved.

2. General Purpose ComputerHeadless ServerEmbedded SystemCopyright 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved. 3. Model BCopyright 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved. 4. RaspberryPi PrototypeModel 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. 5. H!toryMay 2011Video of the Raspberry Pi, recorded bytech journalist Rory Cellan-Jones withhis phone, goes viral.Feb 29th 2012Google shows more searches forRaspberry Pi than Lady Gaga andhardware suppliers Websites crashunder the load of up to 7 orders persecond.June 2012Raspberry Pi User Forum has 20Kmembers who have written more than100K posts.Feb 2013One Million Raspberry Pi soldCopyright 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved. 6. Model BCopyright 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved. 7. Model ACopyright 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved. 8. 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 oating 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. 9. Creating a bootable SDCardMac OS X System Information Tool Copyright 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved. 10. 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/rdisk2Copyright 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved. 11. Copyright 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved. 12. Congu#ngRa$berry PiCopyright 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved. 13. DemoCopyright 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved. 14. Congu#ng Ra$berry Pi sudo raspi-cong Expand the disk image from 2GB all the way ... Re-boot sudo raspi-cong Congure Local Congure Keyboard Layout Congure TimeZone Change Password Enable SSHCopyright 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved. 15. Ra$berryPiLXDE Copyright 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved. 16. Ra$berryPi $ sudo nano /etc/wpa_supplicant/$ cat /etc/network/interfaces wpa_supplicant.conf ..auto lo network={iface lo inet loopbackssid=SSIDiface eth0 inet dhcppsk=******proto=RSNallow-hotplug wlan0key_mgmt=WPA-PSKiface wlan0 inet manualpairwise=CCMPwpa-roam /etc/wpa_supplicant/wpa_supplicant.confauth_alg=OPENiface default inet dhcp }Copyright 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved. 17. Ho"name raspberrypi Change Hostname:sudo nano /etc/hostnamesudo nano /etc/hosts Copyright 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved. 18. Ra$berry Pi Headless ServerPt.2 Copyright 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved. 19. 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. 20. 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 conguration lesapt get autoclean - removes les, needed during upgrade processapt-get autoremove - removes not longer needed dependencies Copyright 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved. 21. Ra$berryPiVNC ServerInstall: sudo apt-get install tightvncserverStart: tightvncserverStop: tightvncserver -kill :1 Copyright 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved. 22. DemoCopyright 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved. 23. Ra$berry Pi Camera Server Copyright 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved. 24. Ra$berry PiCamera 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"

:8080/?action=stream" width="1280" height="960" />

Copyright 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved. 25. DemoCopyright 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved. 26. Ra$berry Pi Embedded Sy"emPt.3 Copyright 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved. 27. Arduino UNO : Arduino MEGA : Raspberry PiCopyright 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved. 28. UNO MEGA DUEPiOperating Voltage5V 5V3.3 V 3.3 V SRAM2 KB 8 KB 96 KB 512 MBFLASH-Memory 32 KB 256 KB 512 KB up to 64 MBClock Speed 16 MHz 16 MHz 84 MHz700 MHz USB Hostn/an/a 12Networkn/an/an/a10/100 wired Ethernet RJ45HDMI, Composite Video, Audio / Video n/an/an/a TRS-audio jackCurrent I/O pins40 mA40 mA total 130 mA2 to 16 mA Digital I/O Pins14 (6 PWM)54 (15 PWM) 54 (12 PWM) 17 (1 PWM)12Analog Input Pins 6 162DAC Analog Out 0Price $30$59 $50$35Copyright 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved. 29. Ra$berryPi wi& ADCMCP3008 8-Channel 10-Bit ADC With SPI InterfaceCopyright 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved. 30. I2CSPICopyright 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved. 31. Ra$berryPiInter-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 ClockCopyright 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved. 32. Ra$berryPiSe#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-selectCopyright 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved. 33. [email protected] ~ $ 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 conrm 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 0Copyright 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved. 34. [email protected] ~ $ 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 conrm 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.soCopyright 2012-2013, Wolf Paulus. A Tech Casita Production. All rights reserved. 35. IN =[0000 0001][1CNL ----][---- ----](8+channel)