Raspberry Pi configuration
This page records the process of configuration of the Raspberry Pi computers (presently version 2 model B) used on the Measurement Science labs in 1st and 2nd year.
The goal is to setup an operating system image which will be made available via an NFS server, and all Pi computers will run this identical image.
The process starts by booting a Raspbian Buster Lite image from an SD card.
Most of the process is done on the command line and many of the commands require extended privileges to run and therefore need to be preceded by the command sudo.
Contents
Changing the network configuration
The default configuration allows for the Pi to connect to the College network out of the box. Nevertheless, the default configuration runs a DHCP daemon which is not needed, only a DHCP client is needed to obtain an IP address from the College DHCP servers.
Add the following 2 lines at the end of the /etc/network/interfaces file
auto eth0 iface eth0 inet dhcp
And uninstall the DHCP daemon
$ apt purge dhcpcd5
Change archive mirror
This is not strictly necessary, but a much greater bandwidth is accessible by downloading packages from the University of Oxford mirror. In /etc/apt/sources.list change the line starting with deb to read
deb http://mirror.ox.ac.uk/sites/archive.raspbian.org/archive/raspbian/ buster main contrib non-free rpi
To start with an updated system run the following commands
$ apt update $ apt upgrade
Trimming down the image
This is again not necessary, but while the Raspbian Lite image is rather small, still it contains bits of software which are not needed and can be trimmed further. For example, the Raspberry Pi 2 board does not have wireless or bluetooth capability, and these are not needed for the labs, therefore related packages can be removed
$ apt purge pi-bluetooth bluez wireless-tools wpa_supplicant iw crda
The different firmware packages installed can also be removed.
For our purposes all Python 2 (but not Python 3) packages can be removed.
There are several daemons that are running in the default installation and that are not needed. This includes the ssh server and the triggerhappy deamon.
$ apt purge openssh-server triggerhappy
Installing a graphical environment
For ease of use we want to install a graphical environment. This is easily done by installing the raspberrypi-ui-mod package and its dependencies
$ apt install --no-install-recommends raspberrypi-ui-mod
Let us add to that a web-browser and a pdf reader
$ apt install --no-install-recommends epiphany-browser xpdf
Also an office productivity suite:
$ apt install --no-install-recommends libreoffice-calc libreoffice-writer libreoffice-math libreoffice-draw
ImageJ
ImageJ is an imaging processing software that is used in some experiments. Installing will also install the necessary Java machinery.
$ apt install --no-install-recommends imagej
IPython and Jupyter notebooks
To get an ipython shell and a useful scientific python environment
$ apt install --no-install-recommends ipython3 python3-numpy python3-matplotlib python3-scipy python3-pandas python3-sympy
The last two packages are not critical, but can still be useful.
Additional, to get Jupyter notebooks running you need a Javascript able web-browser and to install the following packages
$ apt install --no-install-recommends jupyter-notebook jupyter-nbformat jupyter-nbconvert
Configure College time servers
In order to keep time accurate we can configure the system to synchronized the clock with the College time servers. Edit the file /etc/systemd/timesyncd.conf to include the lines
[time] NTP=time1.ic.ac.uk time2.ic.ac.uk time3.ic.ac.uk
Configuring printing
The server jbe-nfssever.ch.ic.ac.uk has a configured print server that the Pis can point to. To do this, install
$ apt install --no-install-recommends cups-client
Create the file /etc/cups/client.conf, with the following line in it
ServerName jbe-nfssever.ch.ic.ac.uk