SlideShare une entreprise Scribd logo
1  sur  20
Lloyd Moore, President
   Lloyd@CyberData-Robotics.com
    www.CyberData-Robotics.com
Seattle Robotics Society 1/19/2013
Agenda
Overview of the Raspberry Pi
Installing the OS
Setting up VNC
Setting up Qt locally
Serial port communications
Resources
Using a Mac
Overview of the Raspberry Pi (Model B)
                  Broadcom BCM2835 SOC
                   •   700 Mhz ARM 11 processor
                   •   Hardware floating point
                   •   Videocore 4 GPU (Open GL ES2.0)

                  512 MB RAM + SD Card for mass storage
                  Camera connector – camera coming soon!
                  JTAG connector
                  Low level I/O
                   •   12 GPIO
                   •   UART (3.3V TTL)
                   •   SPI, with two CS lines
                   •   I2C

                  Full schematics available
Additional Hardware
To get started with the system you will need to add:
    • USB Keyboard
    • USB Mouse
    • SD Memory Card: 4GB or larger, Class 10 or better
    • Micro USB cable (Dollar stores have these cheap, and so does Amazon!
      http://www.amazon.com/gp/product/B003ES5ZSW/ref=oh_details_o00_s00_i01 )
    • 5V USB Power Plug, 700mA or better (Can also use a bench supply, etc.)
    • Ethernet cable and wired network, wireless USB adapters also available
    • HDMI cable and monitor
     • Can also use HDMI to DVI converter/cable (Amazon has these cheap!
        http://www.amazon.com/gp/product/B004S4R5CK/ref=oh_details_o00_s00_i0o)


May also want:
•       Multiple SD cards – really handy for experimenting
•       1/8” stereo audio cable
•       26 position IDC connectors and ribbon cable (Fry’s)
•       USB hub
Installing the OS
Image will be placed directly onto the SD card using a Windows PC (can also
use Linux or Mac for this step with appropriate software).
1. Download and install Win32DiskImage from:
   https://launchpad.net/win32-image-writer/+download
2. Download the “Raspbian wheezy” image from:
   http://www.raspberrypi.org/downloads
 1. This is a Debian based Linux image using hardware floating point and LXDE

3. Insert the SD Card into your computer THEN run Win32DiskImage
 1. May get an error message “Incorrect Function”, just ignore it

4. Select the SD Card and image to load, then press “Write” – copy will take
   some time!
First OS Run
Install the SD card, attach USB keyboard, USB mouse, monitor into the Pi and apply power
to the Pi.




First screen configuration
1.   Set time zone

2.   Set memory allocation between CPU and GPU, 448M/64M standard

3.   Enable SSH, if desired

4.   Set boot behavior – straight to desktop or not, we’ll turn this on for now

5.   Expand_rootfs and reboot



Use the command sudo raspi-config to run the configuration program at any time after the
first boot.
Demo – Walk around the OS
Points of Interest
          Start Menu Button
          Logout Button
          Multiple Desktops
          File Manager
          CPU Graph
          LX Terminal
          nano
At this point you should also update the OS!
1. Open LX Terminal
2. sudo apt-get update
3. sudo apt-get upgrade
Setup VNC – Optional Step
By setting up VNC you eliminate the need for a dedicated keyboard, mouse
and monitor for the Raspberry Pi.
1. Open a command window: Accessories -> LXTerminal
2. Type: sudo apt-get install tightvncserver
3. Run vncserver and enter a password – srs_demo for the demo image
4. Edit /etc/init.d/bootmisc.sh to start vnc server on boot up
 A. sudo nano /etc/init.d/bootmisc.sh
 B. Scroll to end of text and add:
       su –c “vncserver :1 –geometry 1200x800 – depth 16” pi &
 C. Ctl-o, Ctl-x to save and exit
 D. Note: There are other more formal ways to do this – this one is simple!

5. Download and install Tight VNC Viewer for your desktop from:
   http://www.tightvnc.com/download.php
Setup Qt Development Environment
From a console window type:
   sudo apt-get install g++-4.7
   sudo apt-get install qt4-dev-tools
   sudo apt-get install qtcreator



Qt Creator will now show up in the programming menu:
Configure Your Tool Chain
Start Qt Creator and then choose Tools->Options->Build&Run->Tool Chains
Configure as shown by clicking Add->GCC:
Configure Qt Versions
On the same panel choose Qt Versions and configure as shown (may already
be configured):
Configuring the Serial Port
3 wire serial port located on GPIO Pins 6 (GND), 8(Tx), 10(Rx)
Device name is: /dev/ttyAMA0
Voltage levels are 3.3V, and directly connected to SOC!!!! The good news is
this will directly connect to a microcontroller! Not good for a PC!


I’m using a level shifter for the demo to connect to the PC. AdaFruit has one
for $10 (http://adafruit.com/products/954)
Default is to use this for an OS console port, need to disable functionality:
Configuring the Serial Port
Disable the console output in /boot/cmdline.txt
• In a console window type:
       sudo nano /boot/cmdline.txt
       Remove all references to /dev/ttyAMA0
       Ctl-o <Enter> Ctl-x (to write the file back out and exit)
  • Typical modified line will appear as:
     dwc_otg.lpm_enable=0 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline
     rootwait

Disable the getty in /etc/inittab
In a console window type:
• sudo nano /etc/inittab
• comment last line: T0:23: respawn /sbin/getty –L ttyAMA0 115200 vt100
• Ctl-o <Enter> Ctl-x (to write the file back out and exit)

Restart the Raspberry Pi for this to take effect
• sudo reboot
The Demo Program
Can use standard GCC/Eclipse to program, however Qt provides a nice IDE
and is cross platform environment (Windows, Linux, Mac, Android,
Embedded Linux, Windows CE, iOS on the way)
And it is FREE! (LGPL v2.1 and commercial licenses available)
Will also be using QtExtSerialPort, a free Qt compatible serial port
abstraction (MIT license)
Will simply open the serial port set 57600N81 and send out “Hello World”


Located in ~/SerialPi/SerialPi in the demo image, the project file is named
SerialPi.pro
Configure SerialPi Project
The first time you open the SerialPi project you will be asked to configure it
for the types of builds that you want to create. Configure the project as
shown:
Configure No Deployment Runtime
Normally for embedded development you build on a host computer and
deploy to a target computer. This can be faster overall but is much more
complex to set up.
To configure this project to run locally choose:
1.   Deployment: Projects->Run Settings,
2.   Run: Add->Deploy Configuration and set the path to the executable
Demo – Run Program in Qt
Few More Things
Gertboard Kit– Plugs into the IO header on the Raspberry Pi and contains:
         12 buffered I/O lines
         3 pushbutton switches
         6 open collector drivers (50V 0.5A)
         48V 4A motor controller
         28 pin, DIP, Atmega controller
         2 channel 12 bit ADC
         2 channel 10 bit DAC
BCM2835 Library – Open source library containing drivers and examples for:
         SPI
         GPIO
Adapteva Project - $99 board, 16 cores, 26GFLOPS:
http://arstechnica.com/information-technology/2012/09/99-raspberry-pi-sized-
supercomputer-touted-in-kickstarter-project/
Using a Mac to Create the SD Card
Use Stuffit to unzip the download file (http://www.stuffit.com/mac-expander.html)

To set up the SD card:
• Insert the SD card into a card reader. I used the built-in card reader on my MacBook Air.
• The card should show up in the Finder. Run Disk Utility (from the Applications/Utilities folder), find the SD card on the left,
  select the volume associated with that device, and then click on the "Unmount" button. This unmounts the volume but leaves
  the card connected we can blast it with the disk image. Do not click on the “Eject” button as this will also disconnect the card,
  and we won’t be able to talk to it.
• Now we need to figure out the low-level (BSD) name to use to access the SD card. In Disk Utility, click on the item for the card
  reader and then click on the Info button at the top of the window. In the resulting window, you should see a line with the "disk
  identifier". On the MacBook Air it's "disk2", on the Mac Pro it's "disk5". Note that you want the disk identifier of the card, not
  the name of the volume (partition) on the card, which is generally something like “disk2s1”. If you get a volume device name,
  you need to click on the parent item, which is typically the name of the card reader, then choose Info.
• Run the Terminal application
• “cd” to the directory with the file decoded from the zip. If you haven't used the command line before and have no idea what I'm
  talking about, you can just move the SrsRaspPiDemo2.img file to your home folder, the folder the OS creates with your login
  name and holds all of your other folders, like Documents and Downloads.
• Finally, we're going the use the dd command to transfer the image onto the card. A note of caution: this lets you blast data
  directly onto a drive, INSTANTLY destroying any data already there. That's a good thing, it's what we want to do, BUT if you
  get the wrong BSD name or do something stupid like swap the arguments, you can COMPLETELY trash your valuable data.
  BE CAREFUL!!! If you've done the steps above correctly, type the command below, replacing <diskX> with the disk identifier
  you found in the step above. The "if" argument means "input file" and "of" means "output file" so the command above says
  input the disk image file and output to the card reader.


      • dd if=SrsRaspPiDemo2.img of=/dev/<diskX>
The transfer will take about 2 -3 hours depending on your system, this is normal and there is very
little feedback – good time for having dinner!
References
Raspberry Pi Home Page: http://www.raspberrypi.org/
Tight VNC Home Page: http://www.tightvnc.com/
Qt Home Page: http://qt-project.org/
QExtSerialPort Home Page: http://code.google.com/p/qextserialport/
Gertboard: http://www.raspberrypi.org/archives/tag/gertboard
BCM2835 Drivers: http://www.open.com.au/mikem/bcm2835/index.html
BCM2835 Peripherals Datasheet: http://www.raspberrypi.org/wp-
content/uploads/2012/02/BCM2835-ARM-Peripherals.pdf
MagPi Magazine: http://www.themagpi.com/
Image of today’s session (8GB SD Card): http://www.CyberData-
Robotics/Transfer/RaspPiImage.zip (Will be available until 2/28/2013)

Contenu connexe

Tendances

Embedded_Linux_Booting
Embedded_Linux_BootingEmbedded_Linux_Booting
Embedded_Linux_Booting
Rashila Rr
 
Readme
ReadmeReadme
Readme
Tealc1
 
Aplus essentials-exam-cram
Aplus essentials-exam-cramAplus essentials-exam-cram
Aplus essentials-exam-cram
Peter Sonko
 
Intrack14dec tips tricks_clean
Intrack14dec tips tricks_cleanIntrack14dec tips tricks_clean
Intrack14dec tips tricks_clean
chinitooo
 

Tendances (19)

Hardware
HardwareHardware
Hardware
 
Raymond Payne: How to Build a Computer - Hardware Basics
Raymond Payne: How to Build a Computer - Hardware BasicsRaymond Payne: How to Build a Computer - Hardware Basics
Raymond Payne: How to Build a Computer - Hardware Basics
 
Embedded_Linux_Booting
Embedded_Linux_BootingEmbedded_Linux_Booting
Embedded_Linux_Booting
 
Bootstrap process of u boot (NDS32 RISC CPU)
Bootstrap process of u boot (NDS32 RISC CPU)Bootstrap process of u boot (NDS32 RISC CPU)
Bootstrap process of u boot (NDS32 RISC CPU)
 
Readme
ReadmeReadme
Readme
 
2.3
2.32.3
2.3
 
U-Boot Porting on New Hardware
U-Boot Porting on New HardwareU-Boot Porting on New Hardware
U-Boot Porting on New Hardware
 
Aplus essentials-exam-cram
Aplus essentials-exam-cramAplus essentials-exam-cram
Aplus essentials-exam-cram
 
Ps3 linux
Ps3 linuxPs3 linux
Ps3 linux
 
Embedding Linux On The Encore Simputer
Embedding Linux On The Encore SimputerEmbedding Linux On The Encore Simputer
Embedding Linux On The Encore Simputer
 
Building
BuildingBuilding
Building
 
Device Tree for Dummies (ELC 2014)
Device Tree for Dummies (ELC 2014)Device Tree for Dummies (ELC 2014)
Device Tree for Dummies (ELC 2014)
 
Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)Embedded Linux BSP Training (Intro)
Embedded Linux BSP Training (Intro)
 
Hw notes- aim Technologies
Hw notes- aim TechnologiesHw notes- aim Technologies
Hw notes- aim Technologies
 
UNIT 2 P1
UNIT 2 P1UNIT 2 P1
UNIT 2 P1
 
Computer systems|Computer Networking & Communication System Assignment - Netw...
Computer systems|Computer Networking & Communication System Assignment - Netw...Computer systems|Computer Networking & Communication System Assignment - Netw...
Computer systems|Computer Networking & Communication System Assignment - Netw...
 
Intrack14dec tips tricks_clean
Intrack14dec tips tricks_cleanIntrack14dec tips tricks_clean
Intrack14dec tips tricks_clean
 
Linux Device Driver parallelism using SMP and Kernel Pre-emption
Linux Device Driver parallelism using SMP and Kernel Pre-emptionLinux Device Driver parallelism using SMP and Kernel Pre-emption
Linux Device Driver parallelism using SMP and Kernel Pre-emption
 
Dx diag
Dx diagDx diag
Dx diag
 

Similaire à Starting Raspberry Pi

computer archtecture lab, computer hardware , problem and solutons in computer
computer archtecture lab, computer hardware , problem and solutons in computercomputer archtecture lab, computer hardware , problem and solutons in computer
computer archtecture lab, computer hardware , problem and solutons in computer
GS Kosta
 
Raspi_TOR_Access_Point_BenMoore
Raspi_TOR_Access_Point_BenMooreRaspi_TOR_Access_Point_BenMoore
Raspi_TOR_Access_Point_BenMoore
Benjamin Moore
 

Similaire à Starting Raspberry Pi (20)

Tac Presentation October 72014- Raspberry PI
Tac Presentation October 72014- Raspberry PITac Presentation October 72014- Raspberry PI
Tac Presentation October 72014- Raspberry PI
 
Beagle board101 esc-boston-2009b
Beagle board101 esc-boston-2009bBeagle board101 esc-boston-2009b
Beagle board101 esc-boston-2009b
 
101 1.1 hardware settings
101 1.1 hardware settings101 1.1 hardware settings
101 1.1 hardware settings
 
computer archtecture lab, computer hardware , problem and solutons in computer
computer archtecture lab, computer hardware , problem and solutons in computercomputer archtecture lab, computer hardware , problem and solutons in computer
computer archtecture lab, computer hardware , problem and solutons in computer
 
ChromePad - Chromium OS for ThinkPad
ChromePad - Chromium OS for ThinkPadChromePad - Chromium OS for ThinkPad
ChromePad - Chromium OS for ThinkPad
 
ChromePad - Chromium OS ThinkPad X220
ChromePad - Chromium OS ThinkPad X220ChromePad - Chromium OS ThinkPad X220
ChromePad - Chromium OS ThinkPad X220
 
Raspi_TOR_Access_Point_BenMoore
Raspi_TOR_Access_Point_BenMooreRaspi_TOR_Access_Point_BenMoore
Raspi_TOR_Access_Point_BenMoore
 
Lab Handson: Power your Creations with Intel Edison!
Lab Handson: Power your Creations with Intel Edison!Lab Handson: Power your Creations with Intel Edison!
Lab Handson: Power your Creations with Intel Edison!
 
Raspberry with laptop
Raspberry with laptopRaspberry with laptop
Raspberry with laptop
 
Getting started with Intel IoT Developer Kit
Getting started with Intel IoT Developer KitGetting started with Intel IoT Developer Kit
Getting started with Intel IoT Developer Kit
 
Presentation on Computer Peripheral by Atharva Jawalkar
Presentation on Computer Peripheral by Atharva JawalkarPresentation on Computer Peripheral by Atharva Jawalkar
Presentation on Computer Peripheral by Atharva Jawalkar
 
Raspberry pi technical documentation
Raspberry pi technical documentationRaspberry pi technical documentation
Raspberry pi technical documentation
 
Hardware hacking
Hardware hackingHardware hacking
Hardware hacking
 
How to Hack Edison
How to Hack EdisonHow to Hack Edison
How to Hack Edison
 
Feature satip4
Feature satip4Feature satip4
Feature satip4
 
Raspberry Pi tutorial
Raspberry Pi tutorialRaspberry Pi tutorial
Raspberry Pi tutorial
 
Computer Systems Servicing COC1-COC2
Computer Systems Servicing COC1-COC2Computer Systems Servicing COC1-COC2
Computer Systems Servicing COC1-COC2
 
Feature satip4
Feature satip4Feature satip4
Feature satip4
 
Feature satip4
Feature satip4Feature satip4
Feature satip4
 
Feature satip4
Feature satip4Feature satip4
Feature satip4
 

Plus de LloydMoore

Raspberry pi robotics
Raspberry pi roboticsRaspberry pi robotics
Raspberry pi robotics
LloydMoore
 

Plus de LloydMoore (12)

Less Magical Numbers - A coding standard proposal
Less Magical Numbers - A coding standard proposalLess Magical Numbers - A coding standard proposal
Less Magical Numbers - A coding standard proposal
 
Debugging Intermittent Issues - A How To
Debugging Intermittent Issues - A How ToDebugging Intermittent Issues - A How To
Debugging Intermittent Issues - A How To
 
Successful Software Projects - What you need to consider
Successful Software Projects - What you need to considerSuccessful Software Projects - What you need to consider
Successful Software Projects - What you need to consider
 
A Slice Of Rust - A quick look at the Rust programming language
A Slice Of Rust - A quick look at the Rust programming languageA Slice Of Rust - A quick look at the Rust programming language
A Slice Of Rust - A quick look at the Rust programming language
 
What Have We Lost - A look at some historical techniques
What Have We Lost - A look at some historical techniquesWhat Have We Lost - A look at some historical techniques
What Have We Lost - A look at some historical techniques
 
Raspberry pi robotics
Raspberry pi roboticsRaspberry pi robotics
Raspberry pi robotics
 
High Reliabilty Systems
High Reliabilty SystemsHigh Reliabilty Systems
High Reliabilty Systems
 
Real Time Debugging - What to do when a breakpoint just won't do
Real Time Debugging - What to do when a breakpoint just won't doReal Time Debugging - What to do when a breakpoint just won't do
Real Time Debugging - What to do when a breakpoint just won't do
 
PSoC USB HID
PSoC USB HIDPSoC USB HID
PSoC USB HID
 
Using PSoC Creator
Using PSoC CreatorUsing PSoC Creator
Using PSoC Creator
 
Using the Cypress PSoC Processor
Using the Cypress PSoC ProcessorUsing the Cypress PSoC Processor
Using the Cypress PSoC Processor
 
C for Microcontrollers
C for MicrocontrollersC for Microcontrollers
C for Microcontrollers
 

Dernier

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Dernier (20)

Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 

Starting Raspberry Pi

  • 1. Lloyd Moore, President Lloyd@CyberData-Robotics.com www.CyberData-Robotics.com Seattle Robotics Society 1/19/2013
  • 2. Agenda Overview of the Raspberry Pi Installing the OS Setting up VNC Setting up Qt locally Serial port communications Resources Using a Mac
  • 3. Overview of the Raspberry Pi (Model B) Broadcom BCM2835 SOC • 700 Mhz ARM 11 processor • Hardware floating point • Videocore 4 GPU (Open GL ES2.0) 512 MB RAM + SD Card for mass storage Camera connector – camera coming soon! JTAG connector Low level I/O • 12 GPIO • UART (3.3V TTL) • SPI, with two CS lines • I2C Full schematics available
  • 4. Additional Hardware To get started with the system you will need to add: • USB Keyboard • USB Mouse • SD Memory Card: 4GB or larger, Class 10 or better • Micro USB cable (Dollar stores have these cheap, and so does Amazon! http://www.amazon.com/gp/product/B003ES5ZSW/ref=oh_details_o00_s00_i01 ) • 5V USB Power Plug, 700mA or better (Can also use a bench supply, etc.) • Ethernet cable and wired network, wireless USB adapters also available • HDMI cable and monitor • Can also use HDMI to DVI converter/cable (Amazon has these cheap! http://www.amazon.com/gp/product/B004S4R5CK/ref=oh_details_o00_s00_i0o) May also want: • Multiple SD cards – really handy for experimenting • 1/8” stereo audio cable • 26 position IDC connectors and ribbon cable (Fry’s) • USB hub
  • 5. Installing the OS Image will be placed directly onto the SD card using a Windows PC (can also use Linux or Mac for this step with appropriate software). 1. Download and install Win32DiskImage from: https://launchpad.net/win32-image-writer/+download 2. Download the “Raspbian wheezy” image from: http://www.raspberrypi.org/downloads 1. This is a Debian based Linux image using hardware floating point and LXDE 3. Insert the SD Card into your computer THEN run Win32DiskImage 1. May get an error message “Incorrect Function”, just ignore it 4. Select the SD Card and image to load, then press “Write” – copy will take some time!
  • 6. First OS Run Install the SD card, attach USB keyboard, USB mouse, monitor into the Pi and apply power to the Pi. First screen configuration 1. Set time zone 2. Set memory allocation between CPU and GPU, 448M/64M standard 3. Enable SSH, if desired 4. Set boot behavior – straight to desktop or not, we’ll turn this on for now 5. Expand_rootfs and reboot Use the command sudo raspi-config to run the configuration program at any time after the first boot.
  • 7. Demo – Walk around the OS Points of Interest Start Menu Button Logout Button Multiple Desktops File Manager CPU Graph LX Terminal nano At this point you should also update the OS! 1. Open LX Terminal 2. sudo apt-get update 3. sudo apt-get upgrade
  • 8. Setup VNC – Optional Step By setting up VNC you eliminate the need for a dedicated keyboard, mouse and monitor for the Raspberry Pi. 1. Open a command window: Accessories -> LXTerminal 2. Type: sudo apt-get install tightvncserver 3. Run vncserver and enter a password – srs_demo for the demo image 4. Edit /etc/init.d/bootmisc.sh to start vnc server on boot up A. sudo nano /etc/init.d/bootmisc.sh B. Scroll to end of text and add: su –c “vncserver :1 –geometry 1200x800 – depth 16” pi & C. Ctl-o, Ctl-x to save and exit D. Note: There are other more formal ways to do this – this one is simple! 5. Download and install Tight VNC Viewer for your desktop from: http://www.tightvnc.com/download.php
  • 9. Setup Qt Development Environment From a console window type: sudo apt-get install g++-4.7 sudo apt-get install qt4-dev-tools sudo apt-get install qtcreator Qt Creator will now show up in the programming menu:
  • 10. Configure Your Tool Chain Start Qt Creator and then choose Tools->Options->Build&Run->Tool Chains Configure as shown by clicking Add->GCC:
  • 11. Configure Qt Versions On the same panel choose Qt Versions and configure as shown (may already be configured):
  • 12. Configuring the Serial Port 3 wire serial port located on GPIO Pins 6 (GND), 8(Tx), 10(Rx) Device name is: /dev/ttyAMA0 Voltage levels are 3.3V, and directly connected to SOC!!!! The good news is this will directly connect to a microcontroller! Not good for a PC! I’m using a level shifter for the demo to connect to the PC. AdaFruit has one for $10 (http://adafruit.com/products/954) Default is to use this for an OS console port, need to disable functionality:
  • 13. Configuring the Serial Port Disable the console output in /boot/cmdline.txt • In a console window type: sudo nano /boot/cmdline.txt Remove all references to /dev/ttyAMA0 Ctl-o <Enter> Ctl-x (to write the file back out and exit) • Typical modified line will appear as: dwc_otg.lpm_enable=0 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait Disable the getty in /etc/inittab In a console window type: • sudo nano /etc/inittab • comment last line: T0:23: respawn /sbin/getty –L ttyAMA0 115200 vt100 • Ctl-o <Enter> Ctl-x (to write the file back out and exit) Restart the Raspberry Pi for this to take effect • sudo reboot
  • 14. The Demo Program Can use standard GCC/Eclipse to program, however Qt provides a nice IDE and is cross platform environment (Windows, Linux, Mac, Android, Embedded Linux, Windows CE, iOS on the way) And it is FREE! (LGPL v2.1 and commercial licenses available) Will also be using QtExtSerialPort, a free Qt compatible serial port abstraction (MIT license) Will simply open the serial port set 57600N81 and send out “Hello World” Located in ~/SerialPi/SerialPi in the demo image, the project file is named SerialPi.pro
  • 15. Configure SerialPi Project The first time you open the SerialPi project you will be asked to configure it for the types of builds that you want to create. Configure the project as shown:
  • 16. Configure No Deployment Runtime Normally for embedded development you build on a host computer and deploy to a target computer. This can be faster overall but is much more complex to set up. To configure this project to run locally choose: 1. Deployment: Projects->Run Settings, 2. Run: Add->Deploy Configuration and set the path to the executable
  • 17. Demo – Run Program in Qt
  • 18. Few More Things Gertboard Kit– Plugs into the IO header on the Raspberry Pi and contains: 12 buffered I/O lines 3 pushbutton switches 6 open collector drivers (50V 0.5A) 48V 4A motor controller 28 pin, DIP, Atmega controller 2 channel 12 bit ADC 2 channel 10 bit DAC BCM2835 Library – Open source library containing drivers and examples for: SPI GPIO Adapteva Project - $99 board, 16 cores, 26GFLOPS: http://arstechnica.com/information-technology/2012/09/99-raspberry-pi-sized- supercomputer-touted-in-kickstarter-project/
  • 19. Using a Mac to Create the SD Card Use Stuffit to unzip the download file (http://www.stuffit.com/mac-expander.html) To set up the SD card: • Insert the SD card into a card reader. I used the built-in card reader on my MacBook Air. • The card should show up in the Finder. Run Disk Utility (from the Applications/Utilities folder), find the SD card on the left, select the volume associated with that device, and then click on the "Unmount" button. This unmounts the volume but leaves the card connected we can blast it with the disk image. Do not click on the “Eject” button as this will also disconnect the card, and we won’t be able to talk to it. • Now we need to figure out the low-level (BSD) name to use to access the SD card. In Disk Utility, click on the item for the card reader and then click on the Info button at the top of the window. In the resulting window, you should see a line with the "disk identifier". On the MacBook Air it's "disk2", on the Mac Pro it's "disk5". Note that you want the disk identifier of the card, not the name of the volume (partition) on the card, which is generally something like “disk2s1”. If you get a volume device name, you need to click on the parent item, which is typically the name of the card reader, then choose Info. • Run the Terminal application • “cd” to the directory with the file decoded from the zip. If you haven't used the command line before and have no idea what I'm talking about, you can just move the SrsRaspPiDemo2.img file to your home folder, the folder the OS creates with your login name and holds all of your other folders, like Documents and Downloads. • Finally, we're going the use the dd command to transfer the image onto the card. A note of caution: this lets you blast data directly onto a drive, INSTANTLY destroying any data already there. That's a good thing, it's what we want to do, BUT if you get the wrong BSD name or do something stupid like swap the arguments, you can COMPLETELY trash your valuable data. BE CAREFUL!!! If you've done the steps above correctly, type the command below, replacing <diskX> with the disk identifier you found in the step above. The "if" argument means "input file" and "of" means "output file" so the command above says input the disk image file and output to the card reader. • dd if=SrsRaspPiDemo2.img of=/dev/<diskX> The transfer will take about 2 -3 hours depending on your system, this is normal and there is very little feedback – good time for having dinner!
  • 20. References Raspberry Pi Home Page: http://www.raspberrypi.org/ Tight VNC Home Page: http://www.tightvnc.com/ Qt Home Page: http://qt-project.org/ QExtSerialPort Home Page: http://code.google.com/p/qextserialport/ Gertboard: http://www.raspberrypi.org/archives/tag/gertboard BCM2835 Drivers: http://www.open.com.au/mikem/bcm2835/index.html BCM2835 Peripherals Datasheet: http://www.raspberrypi.org/wp- content/uploads/2012/02/BCM2835-ARM-Peripherals.pdf MagPi Magazine: http://www.themagpi.com/ Image of today’s session (8GB SD Card): http://www.CyberData- Robotics/Transfer/RaspPiImage.zip (Will be available until 2/28/2013)