Tuesday, 16 April 2013

Raspberry Pi 'Gotchas' and new buyer tips

Summary: 7 key things to know before you 'simply' get a Raspberry Pi:
  1. Power supply may not deliver enough power ("5 Volts" might only deliver 4.6 Volts, and cause problems)
  2. Old computer monitor cannot simply use HDMI-to-VGA cable (needs powered 'converter')
  3. Keyboard and mouse may not be 'verified' (most work, but worth checking, and using a USB hub
  4. SD Memory card size/speed, corruption, and copying 'disk image' issues (see esp 4.3 below for extra 'mini-gotchas', e.g. special software needed to copy files from laptop
  5. Configuration settings are hard (cryptic, and unexpected format)
  6. Think clearly about the 'total cost of ownership'
  7. Know where to get help - especially the many user forums

Details

The Raspberry Pi cheap-computer-on-a-board has taken the world by storm, finding enthusiastic uses among hobbyists, educators, pupils, geeks, developing nations, inventors, tinkerers, computer scientists, and numerous other communities.

"Wow, this is great for my child! I can just grab an old keyboard, mouse, monitor, memory card and mobile phone charger, and we're ready to go!" 

Whoa: not so fast.

Yes, the Raspberry Pi is an absolutely brilliant concept and fully-working product, and it is re-injecting a lot of energy and creativity into all the communities mentioned above. And the creators have never claimed anything like 'ready to go'.  But, people are treating it that way, and there are a number of hurdles that are not entirely obvious to the first-time buyer, i.e. so-called 'gotchas' (as in 'I've got you, I've gotcha'), so I thought it would be useful to enumerate them and provide a few pointers and links.  Remember, I am not trying to scare you off, or pour cold water on your enthusiasm.  I love this thing, but I hate to see people running around in circles when a bit of care at the beginning could pre-empt a lot of headache.  These remarks are especially aimed at those seeking to reuse common components already lying around the house (a great idea, and one of the attractions of the low-cost Pi). This first version has a number of Windows-specific remarks, but the general comments about hardware are relevant to all users.

In my opinion, if you do not address the following 'Gotcha List' right at the beginning your Raspberry Pi experience, you can spend a lot of time chasing false leads to fix problems that actually have a simpler root cause!


Gotcha ('got-you') List:


1. Power supply may not deliver enough power

Sub-standard power can cause numerous problems, including intermittent or erroneous keyboard and mouse responses.  The Pi uses a widely-available 'micro-USB' charge connector, which means that a spare mobile phone charger, or even an Amazon Kindle charger, will fit nicely.  It just needs the 'standard' 5 volts DC output.  But not all standards are standard!  Two of my chargers delivered only 4.65 volts, and that's not good enough (it is believed that 4.75volts or greater is sufficient, or more generally 5volts +/- 5%).  So you need a genuine decent-quality 5volt power supply.
[Technical followup]  [User forums]  


2. Computer monitor cannot just use 'adapter' cable

A simple HDMI-to-VGA cable is insufficient, and will cause intermittent problems and crashes. Many great monitors, including older ones around your house or office, use(d) the standard 'VGA' (Video Graphics Array) connector, which is an analog standard.  But the Pi outputs the modern HDMI (High-Definition Multimedia Interface), which is a digital standard. There are cables to connect the two, but they not only cause a degradation of quality, but also (worse) draw far too much power from the Pi for it to operate in a stable manner, and the result can be very erratic and inconsistent behaviour in any number of ways that appear to have nothing to do with the display itself. You must (a) use a separately-powered HDMI-to-VGA converter, and (b) change your configuration settings accordingly (see section 5 below).
[User forum discussion on 'HDMI to VGA converter' issues]

3. Keyboard and mouse may not be 'verified'

All USB keyboards are not equivalent, and the same goes for computer mice. They can draw too much power from the Pi and, as above, can result in erratic or inconsistent behaviour.  In many cases, you can indeed just plug in a keyboard and mouse and you will be fine.  But please check the list of verified peripheral devices, and bear this problem in mind if you have trouble.  I advise you to (a) use a powered USB hub through which you connect the keyboard and mouse, and (b) double-check the list of verified peripherals.


4. Memory card challenges

The type of card, its vulnerability to corruption, and the challenge of resetting it are all worth knowing about.  Many experts call this aspect of the setup 'easy', but they have forgotten what it's like to be a real beginner.  Potential headaches are enumerated in sections 4.1-4.3below.


4.1 Size and speed matter: 
The Pi uses a full-size 'SD' card - the kind found in many cameras.  But it requires a recommended 4GB (4 gigabytes), and older cards that operate at a slower speed may be insufficient (high-speed category '4' or higher is recommended, i.e. the kind used for storing movies on camcorders and cameras).
[Read about Raspberry Pi SD cards]

4.2 Frequent on/off or sudden removal may corrupt the card
If your Pi stops working, or has intermittent problems such as those caused by underlying issues mentioned in sections 1, 2, or 3 above, you may suddenly remove the card, or indeed take out the power adapter or just turn it off and on again to restart the Pi.  The problem is that the Pi may be in an 'in-between' state where it is in the middle of storing or updating information on the memory card, and you may end up with the card in a corrupted state which makes the Pi operate very erratically the next time, or not at all.  You therefore need to be careful, and in particular try to halt the Pi properly with the command
     sudo halt
before unplugging it or turning off the power.  Note that 'sudo' is shorthand for 'Super User Do the following command', and temporarily grants you the permission to execute that command; not all commands or users are eligible for this, but this command should work when you are logged in as the user called 'pi' as explained in the Raspberry Pi Quick Start guide.  You'll have to read more about Linux commands to understand more: a good place to start is to search the web for linux e-books or dummies' guides, and also look at the Raspberry Pi forums about this topic

4.3 Creating/restoring fresh memory card contents is harder than it looks
Even with Quick Start guides and other helpful manuals, there are some 'mini-gotchas' mentioned below that you ought to be aware of.

If you are just starting, or suspect that your card has been corrupted, you need to create what is called a fresh memory image (the 'image' is in effect a verbatim copy or snapshot of the ideal starting configuration for the entire operating system and associated files, all of which are the key ingredients that enable the Pi hardware to do things).  Assuming you are already a computer user of some sort, you will be familiar with the idea of copying files from place to place, including from a memory card to and from your computer's hard disk.  but with these image files, things are different. That is because the contents of these 'image' files cannot just be copied directly from one device to another as if they were Word documents or Notepad files: they need to be 'written' (saved onto the SD memory card' by a special tool.

There are three steps involved, two of which are explained in the Raspberry Pi Quick Start guide, but there are additional 'mini-gotchas' as described below:

a) Formatting the SD memory card - special format tool may be needed

(Gotcha 4.3a: Windows built-in formatting is insufficient if the card is already corrupted or has an 'image' file on it, since it may appear to Windows have only 56MB of memory in total, so you need a 3rd party utility such as SDFormatter, obtainable [here].

b) Obtaining the relevant 'image' file - 'unzip' tool needed

You can get hold of the entire 'card memory image' from


Look for the 'direct download' of Raspbian 'Wheezy', which is just the convenient name for one of the many different veriations of the Linux operating system... this one is deemed particularly suitable for beginners.

(Gotcha 4.3b: the file is compressed in the so-called 'Zip' format, so to uncompress it you need to have a way to perform an 'UnZip', so you need a 3rd party utlity such as WinZip or RAR which are easily found by searching on the web, or it may already be included on your computer)

c) Copying ('writing out to the SD card') the relevant file - special tool needed, not located where you think

Steps 3 and 4 of Rasperry Pi Quick Start manual explain how to do this using a tool called Win32DiskImager, but take note of the following:

(Gotcha 4.3c: if you go to the recommended site to obtain Win32DiskImager, you see the message 'No download files exist for this project')

You can get it here instead:



5. Configuration settings are hard

You will undoubtedly find, when you look around the web for help or discussions on the various Raspberry Pi forums, that at some point you need to edit one or more 'configuration' files, such as the one called 'config.txt' that is visible on your SD card if you put it back into your regular computer/laptop after going through all the setup steps described in the Raspberry Pi Quick Start guide.  In some cases you need to do this to make the screen layout more readable (or visible at all).  If you are happy that everything else described above is in healthy working order, then the main things to watch out for are these:

5.1 Proceed slowly and make small changes
Too many changes make it hard to do incremental 'controlled experiments' to figure out what has gone wrong.

5.2 If possible, make the changes directly on the SD card 

In other words, make these changes while working on the Raspberry Pi, using the simple supplied editor called nano.  To edit the file config.txt for example, you need to know that from the Linux point of view it sites in a directory (i.e. folder) called 'boot', and the command to start the editing is as follows:
     sudo nano -B /boot/config.txt
  • 'sudo' is 'Super User Do' as explained above.
  • 'nano' is the command to invoke the nano editor
  • -B is a special flag to ensure a backup is created, in the case called /boot/config.txt~
  • /boot/config.txt is the actual file you will be editing
The nano editor displays relevant commands at the bottom of the screen, with the symbol '^' used to signify the Control (CTRL) key on your keyboard, so ^X means CTRL-X, i.e. Control key and 'x' at the same time, which is how you exit nano.  [Read more about nano]

5.3 If editing via Windows, use a true plain text editor like 'Notepad++'
Powerful text processors such as Word, and even ordinary 'Notepad', may display and/or save files in the wrong format (e.g. the conventions for end of line are different in Windows and Linux), so it is often preferable to use a 3rd-party tool such as 'Notepad++' which does the right thing.

5.4 Try to understand what the settings actually do

This is not easy, and is beyond the scope of this article.  But here are three links to help you out:


6. Think clearly about the 'total cost of ownership'


This point is merely to remind you that there are going to be some worthy 'extras' involved, and you could do worse than reading the online article "The true cost of the Raspberry Pi - essential accessories for new users"

7. Know where to get help - especially the many user forums


Searching the web and especially the forums will be crucial for finding answers to common problems.  Here are my personal favourites:




That's it, folks! Now go and explore, and enjoy! 


Please feel free to re-use any/all of the above comments, but attribution by linking to
http://www.keyboardmaven.com/2013/04/raspberry-pi-gotchas-and-newbiebuyer.html
 
would be appreciated.  Comments and corrections are also appreciated.

-Marc E, 16th April 2013



2 comments:

Michael Bell said...

Best article about the good old raspberry pi I have read so far. I consider myself pretty good at all things tech, But this little creature has caused me some headaches. The usual ones that You mentioned mainly the ultimate cost of owning a raspberry. I have the -b so no ram problem, cables and cards which can be purchased at low cost are usually not great so I have used top of the line accessories. So The cost has grown!! Wifi additional dongle and card. Wow I wish I had read this article first. I would still have purchased the raspberry pi but I would not waste any time trying to go on the cheap. Just buy the best parts and you will have success on the first go.

M said...

Thanks, Michael - I hope you'll be able to point others to this article, mainly to save them all those headaches! All the best
-Marc