Raspberry Pi Lab

Installation

Overclocking the RPi

by on Apr.13, 2014, under Installation

The RPi runs at a default speed of 700 mhz.  I don’t know about you, but that is a bit slow for my tastes.  While I understand that overclocking does generate additional heat and does reduce the life of the device, I am willing to take that risk to get a lttle more speed out of my RPi.  After all at a price of $35 USD, I can afford to replace one occasionally.

The overclocking can be done from the ‘sudo raspi-config’ utility.  However, the real settings are in the file “/boot/config.txt”.

Just for those who aren’t aware… the RPi does NOT have a BIOS.  Therefore the base paramaters that would normally be loaded from a BIOS are moved to the filesystem of the SD card on “/dev/mmcblk0p1”.  This file system is mounted in the OS as “/boot”.

First, make a copy of your “/boot/config.txt” file with “sudo cp /boot/config.txt config.txt.original”.  It’s always good practive to back-up a file before monkeying around with it.

I tried pushing my RPi to the 1 ghz max clocck speed, but it did not work.  The system immediately crashed.  So I resored my config.txt file, re-booted and tried again.  This time I configured it for 950mhz.  This setting has been working for about 48 hours without issue.

Here is the relevant portion of my /boot/config.txt file…

#uncomment to overclock the arm. 700 MHz is the default.
arm_freq=950

# for more options see http://elinux.org/RPi_config.txt
core_freq=250
sdram_freq=450
over_voltage=6

 

 

 

 

Leave a Comment :, , , , more...

RPi GPIO Setup Script

by on Jan.02, 2014, under Code, Installation

I figure I’ll be setting up and re-setting up RPi units for the forseeable future, so I converted my last post on installing the Python libraries for the GPIO into a Bash script.

Copy and paste the code to a text file in your home directory and make sure it is executable with ‘chmod +x filename’.  Then cd into your home directory and ‘./filename’ to run the script.

Here is the code…

#!/bin/bash

#####################################
# Setup the Raspberry Pi GPIO       #
# Script:  R00t  root@bjbranson.com #
# Version: 1 January 2014  V1.0     #
#                                   #
# Change Log: V1.0  Initial Script  #
#                                   #
#####################################

#########################
# CONFIGURATION SECTION #
#########################
mydir=$HOME/RPiDev

######################################
# Make sure the repository source is #
# up-to-date.                        #
######################################
echo '[I] Updating repository sources. Be Patient!'
sudo apt-get -qq update

#######################################
# Make sure the git utility is both   #
# installed and at the latest version #
#######################################
echo "[I] Verifying latest version of 'git' is installed."
sudo apt-get -y -q install git

#######################################
# Download the AdaFruit Rapberry Pi   #
# Python development libraries then   #
# list the directory to show that the #
# files were successfully downloaded  #
#######################################
if [ -d "$mydir" ]; then
   echo '[W] Specified download directory already exists.'
   echo '[I] Download of AdaFruit Python libraries skipped.'
else
   echo '[I] Downloading Python libraries from AdaFruit.'
   mkdir $mydir
   cd $mydir
   git clone http://github.com/adafruit/Adafruit-Raspberry-Pi-Python-Code.git
   cd $mydir/Adafruit-Raspberry-Pi-Python-Code
   ls
fi

#########################################
# Download and install Python libraries #
# for controlling the RPi's GPIO        #
#########################################
echo '[I] Installing Python Dev libraries for the RPi GPIO'
sudo apt-get -y -q install python-dev
sudo apt-get -y -q install python-rpi.gpio
sudo apt-get -y -q install python-pip


#################
## END OF FILE ##
#################

 

Leave a Comment :, , , , , , , , more...

Create A Baseline Image

by on Dec.30, 2013, under Installation

sd-cardNow that you have installed the stock image, configured the video, set-up the WiFi, and updated the system, it it time to do a baseline image of your new, working system.

By making your own image, you will be able to re-flash your SD card back to this current state at some point in the future.  Like, for example, if your file systems gets corrupted.

To do this you need to…

  • Properly shutdown your Rpi.  Run ‘sudo shutdown now -h‘.  The ‘h’ means halt.
  • Remove the SD card from the RPi and mount it on your Linux PC.
  • Determine the device id of the SD card.  ‘sudo fdisk -l‘.   NOT the mounted partition.  For example.  My device is /dev/mmcbkl0 but mounted partitions are /dev/mmcblk0p1 and /dev/mmcblk0p2.  You want ONLY the device.
  • Now we’ll make an image of the card… sudo dd bs=1M if=/dev/mmcblk0 of=/home/myhomedir/imagename.img
  • sudo sync
  • Remove the card, replace it in the RPi and boot up.

NOTE:  This will take quite some time to complete.  The dd command displays absolutely no indication that it is working and may appear frozen.  Be patient.

NOTE II:  The stock Occidentalis image is only 2.6Gb.  But your image, if you followed all the steps I have outlined in my previous articles, will be the full size of your SD card.  In my case, that is 8Gb.

 

Leave a Comment :, , , , , more...

Final Setup

by on Dec.30, 2013, under Installation

Now that the OS is installed, the video is working, and the WiFi is setup, there is one more step before the RPi is ready to get down to business.

Run ‘sudo raspi-config

On this screen, you need to…

  • Expand the partition to fill the SD card.
  • Create the local.  Only create the ones you need or this will be time consuming.
  • Set the Timezine
  • Enable SSH
  • Set the hostname

Now update the system.

  • Run ‘sudo apt-get update
  • Run ‘sudo apt-get install sl cowsay htop
  • Run ‘sudo apt-get upgrade

OK… ‘sl’ and ‘cowsay’ aren’t necessary.  Those are just for fun.  But ‘htop’ is MUCH better than the standard ‘top’ command.

The first time you run the upgrade command will, very likely, take quite some time.  Be patient.  You need to have the system up-to-date.

Now that everything is setup, it’s time to backup the SD card.  See my next post.

 

Leave a Comment :, , , , more...

Setting Up WiFi From the Command Line

by on Dec.29, 2013, under Installation

RTL8188CUS-with-Rpi-transparentI have my RPi up and running.  It is patched into the network via the built-in RJ-45 ethernet port.  However, I have a motto in my lab… “One less wire is a good thing.”

My RPi package I received fro Christmas includes a USB WiFi adapter, so I’m proceeding to set it up and have “one less wire.”

Here are my steps to set up the USB WiFi adapter on my RPi running Occitdentalis.  Given that Occidentalis is a Debian variant, I am fairly confident is saying this should work with Debian, Raspbian, and Occidentalis.  It would, probably also work with x86 Debian and x86 Debian varients such as Ubuntu.  However, take care on systems running Gnome, KDE, etc…  Those systems may (probably are) running network managers within X that would conflict with the command line configurations I am about to describe.

My Wifi adapter is a Realtek RTL8188CUS purchased from AdaFruit.  This particular WiFi adapter is supported by Occidentalis so we won’t have to worry about drivers.

  • Run ‘iwconfig‘ to make sure your adapter is attached and functional.
  • Run ‘iwlist scan | grep ESSID‘ to get a list of WiFi SSIDs in range.
  • Make a backup of your interfaces file by running ‘sudo cp /etc/network/interfaces /etc/network/interfaces.original
  • Now edit /etc/network/interfaces to include your SSID and password
  • Make sure wpa_supplicant is installed and updated by running the command ‘sudo apt-get install wpasupplicant
  • Now delete a file. Run ‘sudo rm /etc/udev/rules.d/70-persistent-net.rules
  • Reboot.  Run ‘sudo reboot

The WiFi should, now, automatically connect to the network and receive an address via DHCP.

 

Here is my /etc/network/interfaces

auto lo
iface lo inet loopback
iface eth0 inet dhcp
auto wlan0
allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-ssid “my-network-ssid”
wpa-psk “my-wifi-password”

 

Leave a Comment :, , , , more...

More On The /boot/config.txt File

by on Dec.29, 2013, under Installation, Troubleshooting

Well, I have the /boot/config.txt file working!

Once I figured out the problem was the /boot/config.txt, I knew I could go back to my original plan of using Occidentalis on the RPi.  So I re-flashed an 8Gb SD card with the Occidentalis image and mounted it on my laptop.

Navigating to the /boot/config.txt file, I made the following changes…

disable_overscan=0
hdmi_force_hotplug=1
hdmi_group=2
hdmi_mode=46
hdmi_drive=2
config_hdmi_boost=4

Obviously, there is more in the file than that, but you don’t need me to post all the comment lines.  These are the lines that are left after removing all comment lines.

BE CAREFUL…Read the documentation for your specific monitor AND check out the config.txt resource link I posted in my previous article.  The group and mode lines are specific to your monitor’s resolution and timing.   See that previous article here.

 

 

Leave a Comment :, , , , , more...

Great Resource for the config.txt file

by on Dec.29, 2013, under Installation, Troubleshooting

Here is a great resource for configuring the config.txt file…

http://raspberrypi.stackexchange.com/tags/config.txt/info

 

 

Leave a Comment :, , , more...

NOT A Hardware Problem

by on Dec.29, 2013, under Installation, Troubleshooting

I, now, know for certain that my problem is NOT hardware.

I loaded Raspbian on an SD card and modified the /boot/config.txt file to enable  the force VGA option.  So the display “works.”  The resolution and alignment aren’t right, but I’ll work on tweaking that out.

When I get it working correctly, I’ll post my /boot/config.txt file.

 

Leave a Comment :, , , , more...

Confused?

by on Dec.27, 2013, under Installation, Troubleshooting

So I tested the HDMI output on the RPi by connecting it to the HDMI cable coming from one of the regular computers to a television.  There is nothing wrong with the RPi.

Re-tested the HDMI to VGA converter on the same television and it works also.

Recall, from my previous posts, I already tested the monitor on the iPad’s VGA adapter.

So if the RPi works and the HDMI converter works, and the VGA cable works, and the monitor works, then why don’t they all work together?

Back to the thinking box!

 

Leave a Comment :, , , more...

Flaw In My Logic

by on Dec.26, 2013, under Installation, Troubleshooting

Although I am fairly confident in my conclusion that the HDMI to VGA converter I was using is, in fact, defective.  However, it occurred to me that my logic has a flaw.  I could be the HDMI converter, but it could also be the HDMI port on the RPi itself.

When I got the RPi up the first time, it was via the composite video port — not the HDMI.  Therefore, not all variables have been eliminated.

I will devise a test to verify both the HDMI port on the RPi and the HDMI converter and post the results.

 

Leave a Comment :, , , more...

Archives

All entries, chronologically...

Our Partners

Please take a minute to visit our partners

Looking for something?

Search the Site

If you can't find what you are looking for, please leave a comment somewhere, subscribe to our feed and hopefully your question will be answered shortly, so please visit again!