Raspberry Pi is a sort of jack of all trades when it comes to being a single board computer based on the Arm processor. It can be a desktop, media player/streamer, web server, forensics machine, and do most of what all linux based machines can do. Pictured is the Raspberry Pi with some of it’s arm based cousins.
it is not a good idea to run the raspberry pi off another computers usb port.
If you need a power adapter, consider: http://www.instructables.com/id/Raspberry-Pi-power-cable-adapter/
Another Arm based install: http://www.instructables.com/id/Give-your-Cisco-Linksys-NSLU2-some-muscle-part-1/ Yet another arm install is in the linux hints instructable.
Quickie monitor: http://www.instructables.com/id/McGuyver-monitor/
Note: if you ever want to get back to the first boot menu
$ sudo raspi-config
Step 1: Network setup.
You will want to go to the services tab on your router to make the IPaddress of the Raspberry Pi semi-permanent. Get the mac address of your Raspberry Pi and then decide what address you want to use. We used 192.168.1.141 for whatever reason.
Llater when you want to SSH into the unit it will make it easier. One thing to note is that you must use a username on the Raspberry Pi to log into it.
$ ssh [email protected]
better (use whatever name you set up for the raspberry pi in the router):
$ ssh [email protected]
Also see: http://www.instructables.com/id/Red-October-network-discovery/
Note: By using ssh means you do not have to leave a keyboard attached to the Raspberry Pi. Saves energy and less cables to deal with.
Step 2: Debian install hints.
If you are installing the Debian install for Raspberry Pi, there are a few hints and tips that can make things easier,
With the opening menu that comes up when you first run the image, be sure to enable ssh, set your time zone and CHANGE YOUR PASSWORD.
You want to get the system updated:
$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get dist-upgrade
It should take a while, but that is ok.
What kind of disk space do you have
$ df -h
What kind of memory do you have?
$ free
You may want to add some software package sets.
$ sudo apt-get update
$ sudo apt-get tasksel
With tasksel, you have to be careful, Any item unchecked will remove that item if it is already installed. (i.e gui environment. For a headless server that is no big deal.
To install the web server just choose that option and ssh. The apache and sqllite will be installed. The sql is for postgresql for most debian versions and you may not need that for most things.
$ sudo tasksel
You will want to take advantage of the full space of your memory card. Generally it only used 2 gigabytes leaving the rest free, if your card holds more than 2 gigabytes. Programs like Gparted and stretch out the free space to take full advantage of the card. You will have to run gparted pon another machine. Do not forget to shut down the raspberry pi
before removing the memory card(s).
Normally the Debian linux install starts up with the text or command line environment. If you want to start up the gui use:
$ startx
You can make the gui the default start up mode but I recommend against it.
You will also want to install screen so you can detach remote sessions.
$ sudo apt-get install screen
For details see: http://www.instructables.com/id/linux-screen-play/
$ screen
Other linux instructables that can be of assistance:
http://www.instructables.com/id/Linux-themed-instructables/
Step 3: Memory useage.
(Try this at your own risk and it is subject to change).
Changing RaspberryPi RAM CPU:GPU Ratio
The Raspberry Pi comes with 256MB of RAM, included in the Broadcom BCM2835 System on chip, which also contains the CPU, GPU and DSP in the same package.
That 256MB of RAM is split between the CPU and GPU at boot time of the Pi, and by default is a 50:50 split, 128MB each. This works well for video decoding and 3D graphics, but if you know you won’t be using such graphically intensive applications, you can change this split to give the CPU a bit more.
To do so, you just need to copy the pre-made .elf files to the start.elf file in /boot, and reboot:
For 192MB for the CPU and 64MB for the GPU:
sudo cp /boot/arm192_start.elf /boot/start.elf
For 224MB for the CPU and 32MB for the GPU:
sudo cp /boot/arm224_start.elf /boot/start.elf
For the default equal split of 128MB for both CPU & GPU:
sudo cp /boot/arm128_start.elf /boot/start.elf
Step 4: Minimal web server hints:
The most simplest web server you can set up on the Raspberry Pi is to use python. Go to a directory that you want to sever out and use:
$ python -m SimpleHTTPServer
Go to your web browser and point it to the Raspberry Pi using port 8000
Alternatively, you could add a simple web page called index.html:
<code>
<html>
<body>
Hello, World!
</body>
</html>
</code>
Note This server is not secure so use carefully!
If you wanted something simple, but light you could also consider Nweb, Goto http://www.ibm.com/developerworks/systems/library/es-nweb/index.html for the details.
You can also install a light apache web server and sqilite with
$ sudo tasksel install web-server
For a blog install see: http://www.instructables.com/id/Raspberry-Pi-simple-blog-server/
Do not forget to check out: http://www.instructables.com/id/Web-related/
Step 5: Write your own programs!
Two popular languages are C (compiled) and Python (interpreted). You can use Nano to edit the source files. Here are two simple hello world examples. You can use nano to edit your files. I prefer vim, but it has to be installed
$ sudo apt-get update
$ sudo apt-get install vim
To edit a file:
$ nano filename.ext
C
[code]
#include <stdio.h> int main () { printf ("Hello World!\n"); } [/code] $ gcc helloworld.c -o hw $./hw Python
[code]
print “Hello, World!”;
[/code]
$ python helloworld.py
You may want to keep all your executalbes in one place and not have to use the ./ prefix.
$ mkdir ~/bin
$ PATH=$PATH:~/bin
Move your programs to that directory.
$sudo mv hw ~/bin/.
Step 6: Teaching your Raspberry Pi to talk.
First you need to add some drivers:
$ sudo apt-get update
$ sudo apt-get install alsa-utils
$ sudo modprobe snd_bcm2835
$ sudo aplay /usr/share/sounds/alsa/Front_Center.wav
You need to add some software:
$ sudo apt-get install festival espeak
Plug in the speakers.
You need to check the sound out put level with alsa mixer. Mine was set way low. Use the up arrow to increase the volume.
$ alsamixer
Test:
$ echo now is the time for all good men | festival –tts
Read a file out loud.
$ festival -tts index.html
More Information at: http://www.instructables.com/id/Text-to-speech-with-linux/
Step 7: LTSP – thin client.
You can use your Raspberry pi as a thin client for the ltsp server (see: http://www.instructables.com/id/Another-almost-free-computers-thin-client-set-up/). it does not support etherwake though yet. I used an older version for testing and it connected to an Ubuntu 10.04 ltsp server. Also worked with a composite monitor, but you need one that will support the higher resolution.
Go to http://www.berryterminal.com/doku.php/start and download the image zip
$ wget http://www.berryterminal.com/dl/berryterminal-20120602.zip
–2012-10-28 14:37:46– http://www.berryterminal.com/dl/berryterminal-20120602.zip
Resolving www.berryterminal.com (www.berryterminal.com)… 83.149.75.177
Connecting to www.berryterminal.com (www.berryterminal.com)|83.149.75.177|:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 24450329 (23M) [application/zip]
Saving to: `berryterminal-20120602.zip’
100%[======================================>] 24,450,329 622K/s in 40s
2012-10-28 14:38:32 (592 KB/s) – `berryterminal-20120602.zip’ saved [24450329/24450329]
Unzip it.
$ unzip berryterminal-20120602.zip
Archive: berryterminal-20120602.zip
inflating: berryterminal-20120602.img
extracting: berryterminal-20120602.img.md5
inflating: berryterminal-20120602.img.sha1
Copy it to your memory card (sudo dd if=berryterminal-20120602.img of=/dev/sd?)
In my case
$ sudo dd if=berryterminal-20120602.img of=/dev/sdb
Safely remove the card from your pc and insert it into the Raspberry Pi
Make sure your ltsp server is up and running. Connect the raspberry pi to the ltsp network and boot.
Bingo!! you have a thin client!
Step 8: Media player.
Installation Script on a took a while, but it completed without a hitch. Everything is menu driven and for the most part pretty straight forward. Using an old B&W tv for testing purposes. If you use an hdmi monitor, you have have to change some settings to work correctly. There is a menu to help with those settings. Weather detected the area of the isp and grabbed the weather info easily. Streamed music from the web from a nearby radio station without a hitch. Even supports local media streaming from upnp and other protocols. Streamed video from the usb stick. When the Mythtv server is back up, I will give you an update.
Somehow the memory card becamed foobarred, so I plan to reinstall raspbmc.
See: http://www.raspbmc.com/download/
Use the xbox remote: http://wiki.xbmc.org/index.php?title=How-to:Wire_your_XBOX_DVD-Remote_for_USB
Follow this simple procedure:
Open the receiver’s plastic case using a small screw driver. Carefully pry around the case. Solder the wire to the receiver using the picture below
Note: This might damage the casing of the dongle.
1 Color Coded Pinout
If you’re using a standard USB cable you should just be able to match the colors and solder away, but to be sure check your cable with a continuity tester according to the USB spec provided here.
Red = Positive Power (+5V DC) White = Data – Green = Data + Yellow = Unused Black = Ground (0V DC)
2 Lirc Config
/etc/lirc/hardware.conf:
#Chosen Remote Control REMOTE=”None” REMOTE_MODULES=”lirc_atiusb lirc_dev” REMOTE_DRIVER=”” REMOTE_DEVICE=”/dev/lirc0″ REMOTE_SOCKET=”” REMOTE_LIRCD_CONF=”” REMOTE_LIRCD_ARGS=”-r”
#Chosen IR Transmitter TRANSMITTER=”None” TRANSMITTER_MODULES=”” TRANSMITTER_DRIVER=”” TRANSMITTER_DEVICE=”” TRANSMITTER_SOCKET=”” TRANSMITTER_LIRCD_CONF=”” TRANSMITTER_LIRCD_ARGS=””
#Enable lircd START_LIRCD=”true”
#Don’t start lircmd even if there seems to be a good config file #START_LIRCMD=”false”
#Try to load appropriate kernel modules LOAD_MODULES=”true”
# Default configuration files for your hardware if any LIRCMD_CONF=”lircd.conf”
#Forcing noninteractive reconfiguration #If lirc is to be reconfigured by an external application #that doesn’t have a debconf frontend available, the noninteractive #frontend can be invoked and set to parse REMOTE and TRANSMITTER #It will then populate all other variables without any user input #If you would like to configure lirc via standard methods, be sure #to leave this set to “false” FORCE_NONINTERACTIVE_RECONFIGURATION=”true” START_LIRCMD=”” /etc/lirc/lircd.conf:
# brand: Microsoft Xbox DVD Receiever (also works with generic) # remote control: Xbox remote or any remote using RCA DVD player codes
begin remote
name XboxDVDDongle bits 8 eps 30 aeps 100
one 0 0 zero 0 0 gap 163983 toggle_bit_mask 0x0
begin codes LEFT 0xA9 UP 0xA6 RIGHT 0xA8 DOWN 0xA7 SELECT 0x0B 1 0xCE 2 0xCD 3 0xCC 4 0xCB 5 0xCA 6 0xC9 7 0xC8 8 0xC7 9 0xC6 0 0xCF MENU 0xF7 DISPLAY 0xD5 REVERSE 0xE2 FORWARD 0xE3 PLAY 0xEA PAUSE 0xE6 STOP 0xE0 SKIP- 0xDD SKIP+ 0xDF TITLE 0xE5 INFO 0xC3 BACK 0xD8 end codes
end remote If using the Xbox DVD IR dongle, add this line to the bottom of /etc/modprobe.d/blacklist.conf:
blacklist xpad
Note: With the latest raspbmc network install, I had to change the default sound output from hdmi to analog/You also may want to change the screen demensions. Not hard to do, but if you have not done it before, it can be a little scarry. Took a couple of tries for the raspxbmc to see my firefly music server, then it worked well. Local area network files work fine. Off network was a bit slow in loading, but still played at normal speed.. i.e. youtube
Step 9: All for now.
Gave you a bit much to chew so More instructables coming!!
To power down, there are several ways, but I like:
$ sudo poweroff
Check out: http://www.instructables.com/id/Linux-themed-instructables/
For more deatil: Raspberry Pi – Jack of all trades.