Formatting your Raspberry Pi SD card using an Apple Mac

Before you can use the Raspberry Pi you will need to set up an SD card and load it up with the Raspberry Pi Operating system. The operating System is required to run any programs on the device and the Raspberry PI uses and OS based on Linux.

To create your SD card you need to carry out several steps involving loading an SD card onto a personal computer and loading the card up with the Linux image file provided by the Official Raspberry PI Website (See the link below).

Now many of the how-to’s out there deal with creating this image on a Linux system or a Windows system so to help the increasing number of folk out there with an Apple Mac I have created this post as the procedure on the Mac differs from the Linux procedure. I have used this procedure to create a card on the Mac and have successfully tested it on a Raspberry Pi so it does work.

The SD card itself can be bought from any computer or camera shop or of course you can get one online. It needs to be at least 4GB size and to use with your mac I suggest you get a USB adaptor which will cost about a fiver from PC world.

First Step – Download the disk image.

Currently the Linux variant being recommended by the Raspberry PI foundation is based on Debian (a version of Linux) and you will need to download a copy of this from the raspberry.org website here:

Direct download debian6-19-04-2012.zip

via Downloads | Raspberry Pi.

Download this to your desktop and once downloaded double click on the zip file to unzip the image and open the folder. The file you will be needing is the .img file.

Debian6 19 04 2012

 

OK now you will need to open the Terminal application on your Mac. Terminal allows us to issue commands direct to the Mac OSX system using it’s native unix environment. It’s actually quite easy but the commands may seem a bit daunting so we’ll go through this step by step.

Firstly to open terminal open the finder and select the applications folder. Scroll down until you find a folder called utilities and within that folder you will find the Terminal Application. Double click to open the app. It might be a good idea to drag this app to the dock whilst you’re at it as you may need to use it again so you may as well make life easy.

Once the Terminal is running you will see a window open with – well not much at this stage – but you will get a prompt similar to this.

Mikes  bash  80×24

This is the shell prompt indicating that the terminal is ready for you to type in a command. The ~ symbol indicates you are at your home directory your prompt will be different to this.  (Your prompt will probably contain the hostname of your computer I have shortened my prompt here for simplicity).

At this point you need to insert your SD card into the Mac so you will need to push the card into the USB adaptor and insert it into a USB slot on your Mac.

Once your mac has recognised the card you’re in business.

Go to the Terminal you opened and type the following followed by the enter key

df -H

This will list the devices you have available on your Mac. It looks pretty scary but is really quite simple.

Mikes  bash  80×24 1

What we have to identify is the ‘Name’ of the SD card. The screenshot above has been taken before the card is inserted and lists all the devices attached to the Mac. Now insert the card and run df -H again

 

Mikes  bash  80×24 2

Note the last entry in the list  /dev/disk2s1 . This shows a size of 7.9Gi, well my SD card is 8 Gig so that looks about right. We need to make note of the’ /dev/disk2s1′ bit.

Now for the tricky bit. You are going to need to select the desktop and then select the folder in which your Debian download is stored. It’s actually really easy to do bu t if you haven’t used Terminal before it might seem a bit unwieldily.

First we need to move to the Desktop. We’re going to use the cd (change directory) command for this so click on the terminal window and type

cd Desktop

Then type cd followed by the name of the folder which contains the debian image which you downloaded earlier. The name of this folder may change over time but if you downloaded and unzipped it on your desktop then you can move to the directory containing the image by typing the following command

cd debian

now hit the Tab key.

When you hit the tab key, ‘Terminal’ will see that you want the folder beginning with the word debian (actually debian-19-04-2012 at the time of writing) so it will fill in the rest for you. Hit enter and you will be inside the debian folder with a prompt something like this.

~/Desktop/debian6-19-04-2012$

If you have problems with this just type cd followed by the name of the directory containing the image e.g. cd debian6-19-04-2012

(If you get stuck or lost just type cd ~ and this will place you back in your home directory so you can try again)

Now you can carry out the actual disk loading process but as I mentioned earlier the way we do this on the Mac is a bit different from linux so at this point we have to type the following:

diskutil unmountDisk /dev/disk2

note the /dev/disk2 is specific to my Mac and I didn’t need to type ‘/dev/disk2s’ just ‘/dev/disk2′ . You will use the device you identified in the previous step as being the SD card. You should get a message telling you the unmount was successful.

OK Last bit now we just need to type in this slightly complex command and go make a cuppa (cos it’s going to take a while)

dd if=debian6-19-04-2012.img of=/dev/disk2

dd is the command

if = input file (your downloaded image)

of = output file (your SD card device)

A couple of things to note.

WARNING: dd is a dangerous command so use i with care or you could mess up your system but if you ensure the /dev/disk2 or whatever your SD device is called is typed correctly you will be fine. Do not type the name of your main disk make sure you type the name of the SD card disk as described above.

You only need to /dev/disk2 and not the complete ‘/dev/disk2s’. The ’2s’ bit is not required. If in doubt just experiment here and the Mac will give a warning if it doesn’t like what you have typed e.g. dd: debian6-19-04-2012.imgof=/dev/disk2s: No such file or directory 

type the command and hit enter. If nothing happens then that’s good as the image is probably being copied to the SD card. Sneak round the back of your mac and see if your usb adaptor is flashing. flashing is good. OK go make that well earned cappuccino and come back in about 15 mins.

NB: if you get a message saying dd: <device name> Resource Busy then you have not unmounted the device correctly so go back and repeat that step.

Eventually after a good few minutes the terminal should report that the image was successfully copied with a nice message confirming the dd operation was successful.

Job Done

 

 

 

 

 

 

 

 

Raspberry pi programming for robotics

So it would seem that most kids are bored by IT at school? The new Raspberry Pi computer might be just the thing to put a spring in the step of budding young inventors. way back in the 1970’s just as the microcomputer explosion was just beginning there were no personal computers the microprocessors in those days were used for measuring and controlling things, there was no such thing as a PC, what a weird world we lived in.

The modern computer has it all, games, media, office tools word processors, accounts, you name it… The problem is the ability to create rather than simply use the computer applications has all but disappeared.

But wait it looks like the team at Raspberry Pi foundation are determined to correct that and give our young engineers and programmers of the future a chance to get into real computing and design.

What really seems to have been lost in the modern computing world is the notion that a computer can actually do something! not just run an accounts application or stream a video or browse a web page but actually do something real.

The time has come to remind young minds of today that it is computers that can control a robot, put a man on the moon, fly a plane, and it is my hope that the Raspberry Pi could be just the catalyst to get things moving in the right direction.

The hope is that over the coming months to keep enthusiasts informed about the Raspberry Pi developments and as the Raspberry Pi becomes available to everyone, to develop projects which will marry the software and the hardware capabilities of the system.

If that sounds like fun to you then stay tuned. We’ll be bringing lots more info on the Raspberry Pi phenomenon and bringing it to you as part of our mission to explore this fantastic system.

For up to date availability on the Raspberry Pi Computer visit the Raspberry Pi Foundation website.

Which Operating System does the Raspberry Pi use

Raspberry Pi Programming with Linux

Raspberry Pi runs with Linux. Linux is a free operating system developed by a community of developers and originally based on an operating system developed in the 1960′s called Unix. The key thing is that whilst Unix cost a fortune, Linux is free and has been developed and improved by a dedicated community of software developers and organisations.  Linux is produced in many flavours and can be used to interact with many types of computer system such as intel™ PC’s, Apple macs™ as well as more compact embedded systems and of course the Raspberry Pi.

Particular flavours of Linux are known as distributions or distro’s. The Raspberry Pi Foundation is currently recommending a version of Linux based on the Debian Squeeze Linux distro’. The Debian Squeeze download is intended for ease of use and contains quite a few bundled tools etc.

How do I get the Linux for the Raspberry Pi ?

The Raspberry Pi does not have a hard disk like most larger computers, remember it is intended as a much more compact and efficient system. To allow you to start up the RasPi and get programming the software you need to load the Linux onto an SD Card.

SD Cards are available in various forms and allow you to store data on them such as programs, images etc, just like a hard disk but unlike hard disks they are compact and have no moving parts

For Raspberry Pi installation you have two options, either buy a pre-loaded SD card available from various sources such as Farnell or download the software from the Raspi website and load it onto the SD card yourself.

 

Expanding the Raspberry Pi Hardware

The Raspberry Pi has some neat ways of interacting with the outside world. We will be looking at what is available as well as what you could, with a bit of ingenuity, build yourself.

In the beginning you will want to maybe switch stuff on and off, read a few simple inputs, flash a few LED’s. Once you’ve cut your teeth then maybe you can move on to more advanced stuff, explore ways of controlling a motorised arm or build a simple robot.

Robot builders are already discussing online how the device could be used to control robots. The board already has several interfaces which can be exploited for hardware expansion purposes. The Raspberry Pi should be suited to a wide range of uses thanks to the flexibility of its Linux OS and the board itself, which should allow Raspberry Pi to work with lots of different external devices.

For the more advanced amongst you there is a Raspberry Pi Hardware specification for I/O available here. We will be exploring this in more detail in due course and developing projects to expand the RasPi Hardware as well, so if you have no real knowledge of how to hook up to the RasPi hardware don’t panic.

For those of you who just want to plug in some expansion then there are various projects on the go, with plans to release off the shelf I/O expansion hardware for the Raspberry Pi such as the GertBoard  shown here.

 

For Simple logic I/O (input/output) there are numerous GPIO (general purpose IO) pins available this allows simple on off operations flashing leds , controlling relays etc.

On board I2C interfaces provide a neat method for linking more sophisticated hardware of choice to the system. I2C is a serial system which can link to lots of I2C capable logic chips, Digital to Analogue converters etc which can be used to control servo controllers, light dimmers, heaters etc.

On board networking allows attachment of cameras and IP aware devices to RasPi, which is going to be pretty good at vision and graphics tasks.

The Raspberry Pi should be suited to a wide range of uses thanks to the flexibility of its Linux OS and the board itself, which should allow users to tinker to get Raspberry Pi to work with many different external devices. There are plans to release the schematics and board designs for the Raspberry Pi, although the the architecture of the device will make it very difficult for people to build the devices themselves. For the really curious view the Broadcom Raspberry Pi SOC data sheet

Raspberry Pi

Only a few weeks ago I was bemoaning the loss of the real computer. The modern PC takes it’s user too far from the metal, far from the ‘real’ world of computing. But be prepared to be amazed, here before us lies a path to real world computing again in the raspberry pi.

 

Raspberry Pi Model B

Raspberry Pi Model B

The Raspberry Pi is a small single board computer that plugs into your TV/Monitor and a keyboard. It can be used for many of the things that your desktop PC does, like spreadsheets, word-processing even games and playing high-definition video. But the real fun part is that you can program the device to do all sorts of stuff. For those with a technical bent there is a set of tools available but stay tuned to this site as we will begin to explore the real power of this system over the coming weeks and months.

The Raspberry Pi has been developed by the Raspberry Pi foundation based in Cambridge and it is hoped that the machine will encourage a new generation of engineers and programmers to embrace technology and start using computers as the basis for invention rather than just a game-playing or media device.

Inventing, we are told is a lost art. Maybe things are about to change.

Initially the Raspberry Pi Model B will be available for about £22 (35$). These are the more fully featured versions of the Raspberry Pi. The device includes an Ethernet port, and 2 USB ports as well as a monitor output.