The great thing about the RasberryPi is that it encourages owners to cover the whole range of the computing experience, from hardware structure to interactive media. It exposes pins for plugging in low-level devices, and it’s also 1-2 orders of magnitude more powerful than the workstation I used for my PhD research. So, doing interesting things with a Pi involves a wide range of skills. Talking to people in the community, I’ve realised that this also requires a range of tacit knowledge about how to have fun without breaking anything. Some of these I’d forgotten about because they haven’t been relevant to me for a decade. Here are a few things we learned the hard way:

Power last

There was a time when you had to power off your PC or terminal before changing the keyboard (“what’s a mouse?”) to avoid blowing a circuit. Nowadays, it’s pretty hard to damage consumer electronics by plugging or unplugging a normal device. As a small low-cost computer, the Pi doesn’t have some of the protections of larger machines so, in general, turn it off before changing what it’s connected to. Then, as you’re connecting leads to your breadboarded version of Skynet, remember to leave the power connector until last. The exceptions to this are the USB and Ethernet ports, which are designed to be pluggable. The non-exception to this is the HDMI port which, unlike for every other console or computer you’ve owned recently, you should only connect or disconnect with the power off.

When you turn off your Pi, don’t just pull the plug as there are background processes that need time to clean up. First, from an administrator account, type sudo shutdown -h now and then wait a few seconds for the machine to stop, or (according to commenter Brian) type sudo poweroff

Stay grounded

The silent killer for components is static electricity. You can build up an electrical charge without realising it, especially when wearing artificial fabrics and insulated from the floor by rubber-soled trainers. That charge can then fry a component when you touch its contacts. That’s why components, including your Pi, ship in shiny antistatic bags. The answer is get into the habit of grounding yourself, by touching something large and metal, before touching the components or, for more sustained work, attaching yourself with an anti-static wristband.

Change the default password

If you use one of the standard disk images, everyone in the world will know the name and password of an administrator account on your machine. This won’t be a problem if you never plug it into a network (apart from when some joker changes all your settings when you’re out of the room), but that will make it a significantly less interesting machine. The default network settings on the Pi are secure (you have to make an effort to enable SSH), but there’s no point in helping the bad people in.

Securing systems is both a human and technical issue. It turns out that forcing excessive technical restrictions can actually make a system less secure in practice. And common password strength checking can make things worse.

Create a non-admin user for your normal activity

The default pi account has access to administrative (or “root”) rights. That means you can use it to make major changes to your system, some of them bad. In modern systems, those privileges are protected by having to use the sudo command. But the unix permissioning scheme is still fairly primitive, it’s too easy to get tired and type sudo rm -rf / (please, please, please don’t do this on your Pi, it’s an example of a Bad Thing that will wipe all your files).

A better alternative is to create a new user account for yourself that has fewer permissions. This will be the account that you normally log in to, saving the pi account for doing risky system things (having changed the password). The main benefit is that it stops you breaking your whole system by accident, the worst you can do is mess up your personal account. As a bonus, this also limits the damage a hacker (or annoying colleague) might do if they get hold of your account details.

There’s a description of the basics on the Ubuntu site. The minimal command-line version from your pi account is something like: sudo adduser <new user name>, where <new user name> is the name of the new account.

More than one copy

A depressingly high proportion of people who use computers don’t keep copies of the important data. Every part of your Pi is a physical device and can fail, including the SD card. In olden days, when we cut individual electrons with a chisel, hardware failed often enough that we would regularly be reminded of the possibility of failure, nowadays consumer kit is so reliable that it’s easy to take for granted—until after you’ve accidentally wiped your SD card with a fridge magnet and lost the code to drive your Skynet implementation (although it could be worse). There’s lot of advice out there on what to do, so I won’t suggest any particular solution as long as you do something.

For stuff you’re working on, like code and documents, it’s also essential to adopt some form of version control to track the history. That way, when you find you’ve gone down the wrong rabbit hole, or forgotten why you did something, you can always work your way back. I’ve taken to versioning my system files too, rather than keeping copies with file.bak, file.bak1, file.really-old-version. There are several free systems available, so I won’t recommend any particular one.

What else should we need know about?

Tell us by adding a comment…

2 Comments

  1. It is not waterproof (it is supposed to be). Be careful when working nearby water or liquids that conduct electricity. Especially from drinking.

    Reply

  2. I2C pins are already equipped with pull-up resistors. Connecting more pull-up resistors will parallel them and total resistance will be reduced.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>