Skip to content

PiAware Best Practices

lehenbauer edited this page Oct 6, 2014 · 1 revision

Table of Contents

Use a UPS

Run your Raspberry Pi on an uninterruptible power supply. Your Pi is a full-blown UNIX system of the Linux variety, and it trades off performance for a certain likelihood of losing data in the event of a crash. SD cards are pretty amazing but they are being asked to do a lot for us. If an SD card is writing when power is lost, the entire card can be corrupted and require reformatting with the SD card association formatter.

Make sure you are running current or near current operating system and packages

Run your Raspberry Pi on a fairly recent version of the operating system. The heartbleed bug for OpenSSL was serious, for instance. Also later versions of Raspbian are known to suffer fewer SD card corruption problems. Under Raspbian you can upgrade your installed packages, system kernel and boot files and such with

 sudo apt-get update
 sudo apt-get upgrade
 sudo rpi-update
 sudo reboot

This usually works pretty well but it is possible that it will slag your Raspberry Pi, i.e. render your SD card unbootable. That's the main risk so if you have anything important on there that you're developing or whatever, you really ought to be regularly backing up your work off-device, syncing to off-device source code control system, or whatever.

Keep your PiAware install up to date

Use a reasonably high-quality SD card

There is a lot of variation in quality from one SD card vendor to another. "No name" SD cards can be of inferior quality. We stick with major vendors such as Sandisk, Toshiba, and Sony. Lately we've been going 100% with Sandisk.

If you're doing work on your Pi, get a fast SD card

While the 700 MHz ARM processor is far slower than the process you might find in a desktop computer, the speed of the SD card makes a big difference in the performance of the machine, especially interactive performance.

The tradeoff, of course, is that the price of the card goes up with the performance. Nonetheless if you are using the box interactively, like developing software, cutting releases, anything like that, you will notice a big difference if you use something like the Sandisk Extreme Pro card.

Expand your filesystem to use the entire card

By default Raspbian only uses about 3 gigabytes of your SD card, no matter how large the card is. If you run 'sudo raspi-config' and choose option 1, you can expand the filesystem to fill the card. There are other approaches where you can have multiple operating systems on a card and stuff like that, but if you're not doing that, it's probably best to expand the filesystem to fill the card.

We're not 100% sure about this but we figure that with more blocks on the free list writes will be distributed more evenly across the blocks of card, causing it to wear more evenly and hopefully being more reliable.

Monitor your device for anomalies through FlightAware

Every few minutes PiAware forwards some very basic health information about your Pi to FlightAware. This is stuff like CPU temperature, SD card percentage of storage in use, version of PiAware currently running, and so forth. No more than once a week you should get an anomaly report email covering in one message all your PiAware hosts (which is probably one, but some people have many) and explaining things that are going on and stuff you can do to fix it.

If there are no anomalies on their device, will they still get the email? Would be nice maybe if it didn't just have the anomalies but also some statement of messages received and percent of time it was working or something like that.