Linux Format - UK (2020-03)

(Antfer) #1
38 LXF260 March 2020 http://www.linuxformat.com

Raspberry Pi projects


ou don’t have to use your Pi to learn Python,
Linux, electronics, or anything at all really
(although remember, knowledge is power –
Ed). It has also got the potential to be a cheap and
cheerful source of entertainment for you. So here are a
few top project ideas to keep you happy.

Media box
Unusually in the company, LibreELEC – which dubs
itself “just enough OS for Kodi”— has kept pace with the
Pi 4 and appears to be providing regular updates. That
makes setting up a Pi 4 as a Kodi box absolutely trivial.
Head to http://libreelec.tv, grab the Raspberry Pi 4
image from the downloads section, and write it to a card
with Etcher. There’s a whole seedy streaming subculture
of Kodi that we won’t go into (stay away from dodgy
plugin repos, please). Bear in mind the Pi 4’s hardware
decoding capabilities: if you want to watch 4K media
files on your TV, they need to be in H.264/H.265 format
for the best results, so convert them beforehand with a
tool such as Handbrake.
A Pi with a decent amount of storage is perfect for
Plex Media Server. It’s not necessarily the best at
transcoding that media, but it can. Hosting it and
streaming it around your network and beyond is fully
plausible, but you may find that your CPU is getting
hammered and the Pi is heating up hugely. Thankfully,
at least the most recent version is happy to work with
the Pi 4, which is better-equipped to cope with such
vicissitudes. Run
$ sudo apt install apt-transport-https -y
$ curl https://downloads.plex.tv/plex-keys/PlexSign.
key | sudo apt-key add -
to grab the Plex PGP key. Then run
$ echo ‘deb https://downloads.plex.tv/repo/deb public
main’ | sudo tee /etc/apt/sources.list.d/
plexmediaserver.list
$ sudo apt update
to tell your package manager where to get Plex’s files
and to update its cache. Finally, run
$ sudo apt install plexmediaserver
to install it. Once it’s done, you’ll be able to log in to its
web interface, and get it configured using

Pi-based entertainment


Let Pi entertain you! With movies, music and games galore.


localhost:32400 on the Pi, or substituting localhost for
your Pi’s IP address on a remote machine.

Retro gaming
It’s fair to say that the only reason many people own a
Pi at all is RetroPie (http://retropie.org.uk), the all-in-
one package that pulls together emulator support for
just about every classic system and adds a neat
frontend with which you can select (legally obtained)
ROMs. Right now, the system image for RetroPie
(version 4.5.1) is built on top of Raspbian Stretch, an
older version of the OS with no support for the Pi 4, and
RetroPie’s creator specifically notes that it will not work.
This is a shame, particularly as the Pi 4 has the
muscle to run Dreamcast, N64 and PSP games at
close to original speeds, but not all is lost. You can
run emulators such as RetroArch yourself, or you can
simply install the RetroPie package (which contains
the equivalent of what’s included in the system image)
on top of Raspbian itself. Execute
$ sudo apt-get install git lsb-release
$ git clone --branch fkms_rpi4 --depth=1 https://github.
com/RetroPie/RetroPie-Setup.git
to install some prerequisites and download the
installation script. Jump into the directory and make
that script executable with
$ cd RetroPie-Setup
$ chmod +x retropie_setup.sh
then run it with
$ sudo ./retropie_setup.sh
Alternatively, you can try Lakka, the official Libretro
distro – there’s a stable Raspberry Pi 4 version, or if
you’re feeling adventurous you can grab the latest
version from http://nightly.builds.lakka.tv. Drill down
to the RPi2.RPi4.arm directory, and grab the .img.gz
file, which you can burn as usual using Etcher. It’s
bleeding edge, so like running RetroPie on top of
Raspbian, expect with a litany of bugs.
One more option: DOSBox. While you’re hard
pressed to translate anything x86 on to the Arm
architecture of the Pi, DOSBox is an exception. If you’re
interested in running classic old games, just run
$ sudo apt-get install dosbox
to download and install it.

VolumeIO
The Pi’s onboard analogue audio capabilities are
nothing to write home about. This doesn’t really matter
if it’s just making the occasional beep bop. And it’s
totally irrelevant if you’re playing audio via the HDMI
port (so that your TV or digital receiver is doing the
digital-analogue conversion). But if you want to hook up
an old analogue amplifier to your Pi, you’d best get
yourself a dedicated DAC first, otherwise things will
sound hollow, lacking in range. The headphone jack will
also pick up noise and static from other components.

Y


Just enough for
Kodi. And if you
want a simple
media centre then
LibreELEC is just
enough for you.

38 LXF260March 2020 3332March 0Sens2i0e

Raspberry Pi projects


ou don’t have to use your Pi to learn Python,
Linux, electronics, or anything at all really
(although remember, knowledge is power –
Ed).Ithas also got the potential to be a cheap and
cheerfulsource of entertainment for you. So here are a
fewtopproject ideas to keep you happy.

Mediabox
Unusually in the company, LibreELEC – which dubs
itself“just enough OS for Kodi”— has kept pace with the
Pi 4 andappears to be providing regular updates. That
makessetting up a Pi 4 as a Kodi box absolutely trivial.
Headtohttp://libreelec.tv, grab the Raspberry Pi 4
imagefrom the downloads section, and write it to a card
withEtcher. There’s a whole seedy streaming subculture
ofKodithat we won’t go into (stay away from dodgy
pluginrepos, please). Bear in mind the Pi 4’s hardware
decoding capabilities: if you want to watch 4K media
filesonyour TV, they need to be in H.264/H.265 format
forthebest results, so convert them beforehand with a
toolsuch as Handbrake.
APiwith a decent amount of storage is perfect for
PlexMedia Server. It’s not necessarily the best at
transcoding that media, but it can. Hosting it and
streaming it around your network and beyond is fully
plausible, but you may find that your CPU is getting
hammered and the Pi is heating up hugely. Thankfully,
atleastthe most recent version is happy to work with
thePi4,which is better-equipped to cope with such
vicissitudes. Run
$ sudoapt install apt-transport-https -y
$ curlhttps://downloads.plex.tv/plex-keys/PlexSign.
key| sudo apt-key add -
tograb the Plex PGP key. Then run
$ echo‘deb https://downloads.plex.tv/repo/deb public
main’| sudo tee /etc/apt/sources.list.d/
plexmediaserver.list
$ sudoapt update
totellyour package manager where to get Plex’s files
andtoupdate its cache. Finally, run
$ sudoapt install plexmediaserver
toinstallit. Once it’s done, you’ll be able to log in to its
webinterface, and get it configured using

Pi-based entertainment


Let Pi entertain you! With movies, music and games galore.


localhost:32400 on the Pi, or substituting localhost for
your Pi’s IP address on a remote machine.

Retro gaming
It’s fair to say that the only reason many people own a
Pi at all is RetroPie (http://retropie.org.uk), the all-in-
one package that pulls together emulator support for
just about every classic system and adds a neat
frontend with which you can select (legally obtained)
ROMs. Right now, the system image for RetroPie
(version 4.5.1) is built on top of Raspbian Stretch, an
older version of the OS with no support for the Pi 4, and
RetroPie’s creator specifically notes that it will not work.
This is a shame, particularly as the Pi 4 has the
muscle to run Dreamcast, N64 and PSP games at
close to original speeds, but not all is lost. You can
run emulators such as RetroArch yourself, or you can
simply install the RetroPie package (which contains
the equivalent of what’s included in the system image)
on top of Raspbian itself. Execute
$ sudo apt-get install git lsb-release
$ git clone --branch fkms_rpi4 --depth=1 https://github.
com/RetroPie/RetroPie-Setup.git
to install some prerequisites and download the
installation script. Jump into the directory and make
that script executable with
$ cd RetroPie-Setup
$ chmod +x retropie_setup.sh
then run it with
$ sudo ./retropie_setup.sh
Alternatively, you can try Lakka, the official Libretro
distro – there’s a stable Raspberry Pi 4 version, or if
you’re feeling adventurous you can grab the latest
version from http://nightly.builds.lakka.tv. Drill down
to the RPi2.RPi4.arm directory, and grab the .img.gz
file, which you can burn as usual using Etcher. It’s
bleeding edge, so like running RetroPie on top of
Raspbian, expect with a litany of bugs.
One more option: DOSBox. While you’re hard
pressed to translate anything x86 on to the Arm
architecture of the Pi, DOSBox is an exception. If you’re
interested in running classic old games, just run
$ sudo apt-get install dosbox
to download and install it.

VolumeIO
The Pi’s onboard analogue audio capabilities are
nothing to write home about. This doesn’t really matter
if it’s just making the occasional beep bop. And it’s
totally irrelevant if you’re playing audio via the HDMI
port (so that your TV or digital receiver is doing the
digital-analogue conversion). But if you want to hook up
an old analogue amplifier to your Pi, you’d best get
yourself a dedicated DAC first, otherwise things will
sound hollow, lacking in range. The headphone jack will
also pick up noise and static from other components.

Y


Just enough for
Kodi. And if you
want a simple
media centre then
LibreELEC is just
enough for you.
Free download pdf