Boise Linux Users Group Meeting Report - December 16

Good Meeting, lots of discussion during Clint's 90 Minute presentation on his "Out of the Box" experience including a live demonstration on the overhead of what he was presenting.  The following is Clint's Outline that he used.  This is a work in process and will be updated as work continues:

CanaKit Raspberry Pi B+ Ultimate Starter Kit
What's in the box (picture)
Kit Includes:
1 x Raspberry Pi Model B+ (B Plus) 512 MB - Made in UK (Sony Factory)
1 x 8 GB Samsung MicroSD Card - Raspberry Pi Recommended MicroSD Card with the new NOOBS
1 x Raspberry Pi B+ Case
1 x CanaKit 2.5A MicroUSB Power Supply specially designed for the Raspberry Pi B+ (5-foot cable)
1 x Premium Quality HDMI Cable (6-foot)
1 x WiFi Adapter/Dongle (Ralink RT5370 chipset)
1 x Breadboard
1 x GPIO Ribbon Cable
1 x GPIO to Breadboard Interface Board
1 x GPIO Quick Reference Card
2 x Push Button Switches
2 x Red LEDs
2 x Green LEDs
2 x Yellow LEDs
2 x Blue LEDs
10 x 220 Ohm Resistors
5 x 10K Ohm Resistors
1 x CanaKit General Guide for Beginners to Electronic Components


Amazon Price:
List Price:     $129.99
Price:            $ 99.99
Sale:             $ 69.95

Setting up

Loading software:

SD Preparation
Unmount all partitions on SD (Usually sdb)

> unmount /dev/sdb1...

df -h (confirm no mounted partitions on USB: /dev/sdb)

Use Parted to Clear the partition table:
> parted /dev/sdb
  mklabel msdos

Write image out to card:
dd if=wheezy-raspbian.img of=/dev/sdb bs=4M

Configuring Raspian:

configures auto-login to the desktop and advanced features:
> raspi-config

Display configuration:
edit /boot/config.txt (This is mine to enable VGA 1280X1024)
# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan

# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border


# uncomment to force a console size. By default it will be display's size minus
# overscan.

# uncomment if hdmi display is not detected and composite is being output

# uncomment to force a specific HDMI mode (this will force VGA)
# 1280X1024 VGA

# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes

# uncomment to increase signal to HDM if you have interference, blanking, or
# no display

# uncomment for composite PAL

#uncomment to overclock the arm. 700 MHz is the default.

Timezone Settings:
dpkg-reconfigure tzdata

> date
> free
> date --set 2014-12-13
> date --set 05:20:00

Check network time protocol status:
> ntpdate
> ping
> ntpdate -q

Bring your Pi up to date:
> sudo -i
> apt-get update
> apt-get upgrade
> apt-get install python-dev
> apt-get install python-rpi.gpio
Also, update the pi firmware:
> wget  -O /usr/bin/rpi-update && sudo chmod +x /usr/bin/rpi-update
> rpi-update
> reboot

GPIO Pin Out (General Scheme)

Pin 7    GPIO 04        7
Pin 11  GPIO 17 *     0
Pin 12  GPIO 18 *     1
Pin 13  GPIO 27        2
Pin 15  GPIO 22        3
Pin 16  GPIO 23        4
Pin 18  GPIO 24        5
Pin 22  GPIO 25        6

Pin 8    TX (out)      15
Pin 10  RX (in)        16

Grounds pin 6, 9, 14, 20
5V   pin 2, 4
3.3V pin 1, 17

There seems to be a bit of disparity between users of the Pi as to how to address the GPIO pins.  Here is a table for the man page for the gpio utility:

WiringPi vs. BCM_GPIO Pin numbering
WiringPi   GPIO-r1   GPIO-r2   P1-Phys   Function
    0        17        17        11
    1        18        18        12      (PWM)
    2        21        27        13
    3        22        22        15
    4        23        23        16
    5        24        24        18
    6        25        25        22
    7          4          4         7
    8          0          2         3        I2C: SDA0
    9          1          3         5        I2C: SCL0
   10         8          8        24       SPI: CE0
   11         7          7        26       SPI: CE1
   12       10        10        19       SPI: MOSI
   13         9          9        21       SPI: MISO
   14       11        11        23       SPI: SCLK
   15       14        14          8       TxD
   16       15        16        10       RxD
   17         -        28
   18         -        29
   19         -        30
   20         -        31

Note  that  "r1"  and "r2" above refers to the board revision.
Normally wiringPi detects the correct board revision with use
for it's own numbering scheme, but if you are using a Revision
2 board with some of the pins which change numbers between
revisions you will need to alter your software.

import RPi.GPIO as GPIO
import time
GPIO.setup( 11, GPIO.OUT)
while True:        
  GPIO.output( 11, True)        
  time.sleep( 2)        
  GPIO.output( 11, False)        
  time.sleep( 2)

Another script that I used to test a led breadboard:
(Uses pin 11 but generally referred to GPIO logical pin 17)

import RPi.GPIO as GPIO
from time import *
GPIO.setup(led_pin, GPIO.OUT)
while True:
    GPIO.output(led_pin, True)
    GPIO.output(led_pin, False)
import RPi.GPIO as GPIO
GPIO.setup( 12, GPIO.IN)
while True:        
  input_value = GPIO.input( 12)        
  if input_value = = False:                
     print(" The button has been pressed.")                
     while input_value = = False:                        
       input_value = GPIO.input( 12)

A great breadboard project complete with code and explanation can be found in issue 144 of Linux User & Developer Raspberry Pi sampler p. 62. This project provides a looping sound machine complete with pushbuttons and leds as well as sound output!  And with the code analysis, you get a good feel for programing in python 2.

A very basic hardward programing project can be found in LinuxFormat issue 181 (March 2014), p. 38 and includes a small python script that you can type in to find out how GPIO works.

Raspberry Pi User Guide
Wiley Press
ISBN 978-1-118-92166-1
Available on Kindle

One of the limitations of the Raspberry Pi is its I/O (GPIO) features. The chip used by the Pi is a low voltage device and is easily damaged.  The operates at the 3.3 volt level and does not interface easily to 5 volt or higher devices, nor can it sink readily sink current where the voltage exceeds 3.3v.  There are a number of devices available to get around these limitations.  One is a simple level shifter that translates 3.3 to 5 volt logic: which is based on the Texas Instruments TXB0104 chip, a 4-Bit Bidirectional Voltage-Level Translator with Auto Direction Sensing and +/-15 kV ESD Protection. These are standalone "boards" that would have to be hardwired into your project.  The Pi has 8 pins that are commonly used for I/O so one would need two of these.

Another solution is the PiFace Digital interface that plugs directly piggybacks on the Pi's GPIO socket and provides the following:
* 2 dry changeover relays
* 4 tactile pushbutton switches
* 8 digital inputs
* 8 open collector outputs (current sinking, positive voltate)
* 8 LED indicators

The PiFace software is available on Pi's Raspian operating system. To install:
apt-get install python3-pifacedigitalio python-pifacedigitalio
There is also an emulator you can install and use with Scratch:
apt-get install python3-pifacedigital-emulator python3-pifacedigital-scratch-handler  
Visit for more information and Pi projects. The PiFace digital board is available from Newark Element 14 at 27.95.

For advanced users, there is the Gertboard which also plugs directly onto Raspberry Pi GPIO socket and features:
Motor controller, capable controlling a motor bi-directionally, delivering 18V and 2A maximum
* Dual-channel D-to-A converter, 8-bit
* Dual-channel  A-to-D converter, 10-bit
* Onboard Atmel ATmega328 MCU for running off-board programmes which are written, compiled and uploaded to Gertboard from Raspberry Pi
* 6 open collector outputs
* 12 LED indicators
* 3 momentary push switches
Kit includes 10 strap cables and 18 pin jumpers. Software and manuals available for download to operate and learn how to use Gertboard
Price at Newark Element 14 is 39.95

As an electronics engineer in a earlier career, I bought both of these devices and look forward to using them in the future.

There seems to be some interest in making the Pi a "HTPC" (Home Theater PC) which you can connect via the HDMI connection on your TV.  I have spent more than a couple of hours in this effort and found the results less than satisfying and it appears that what is out there for doing this is "beta", somethings works, resolution was poor, and it took multiple attempts at imaging an SD card to get a working HTPC configuration.

At the meeting, a webserver running the Pi was demonstrated and is very easy to setup.

Since the meeting, I have found a number of resources on the net for all kinds of projects based on the Pi.  Just be aware that the Pi is not a high performance system and has been compared to a 300 MHz Pentium, anybody remember having one of them? 

I set up USB "Storage" using the Pi and it took 10 minutes to upload a file compared to 2 minutes using a USB storage drive attached to my router.  Also, invest in powered USB hub as very little power is available for USB devices from the Pi or use a USB drive that has its own power supply.  I tried two USB "pocket" drives and neither of them were recognized by the Pi until I used the powered USB hub to connect them.

Here is a potpourri of links for your Pi Pleasure:

Instructables Raspberry Pi How-To (Extensive)

Lifehacker - Australia - Projects

Rasberry Pi: Top 15 Projects to try over Christmas
(from scratch, includes configuration & updating)

Wordpress Install:

RPi Distrobutions

Fedora 21 Conversation (Links):

Fedy (Fedora Utils) - post installation, installs and tweaks for everything that Fedora didn't do including multi-media support.