Ultimate Linux Projects 4ed 2024 (Ultimate Linux Projects 4ed 2024)
Ultimate Linux Projects 4ed 2024 (Ultimate Linux Projects 4ed 2024)
INSIDE
PAGES OF EXPERT
ADVICE FROM
FORMAT
PROJECTS
» SUPERCHARGE YOUR MACHINE «
llh lllll.
tr.
xx
PROJECTS
Linux is the gateway to exciting open-source software,
stimulating coding projects and, of course, impressive
Raspberry Pi machinations. In Ultimate Linux Projects, we throw
those doors wide open and explore the opportunities that
Linus Torvalds' creation can offer us.
Inside, the minds behind Linux Format magazine provide their
expertise to bring you specialist tutorials, guides and advice to
help you get some extra joy from your machine. From coding
masterclasses that will tell you how to tap into weather satellites
and more, to plug-in-and-play Raspberry Pi guides, and
open-source alternatives to popular services like Google Photos
and Plex - we’re sure that if you’re a Linux fan, you’ll Find
something to obsess over here.
So, pop that kettle on, boot up your machine and get ready to
explore the possibilities that Linux has to offer.
ULTIMATE
LINUX
PROJECTS
Future PLC Quay House, The Ambury, Bath, BAI 1UA
Ultimate Linux Projects Editorial
Editor Drew Sleep
Art Editor Efrain Hernandez-Mendoza
Compiled by Charles Ginger & Adam Markiewicz
Head of Art & Design Greg Whitaker
Editorial Director Jon White
Managing Director Grainne McKenna
Linux Format Editorial
Editor-in-chief Neil Mohr
Art editor Fraser McDermott
Production editor Katharine Davies
Croup editor-in-chief Graham Barlow
Group art director Warren Brown
Cover images
magictorch.com
Raspberry Pi is a trademark of the Raspberry Pi Foundation.
Tux credit: Larry Ewing ([email protected]) and The GIMP.
Photography
All copyrights and trademarks are recognised and respected
Advertising
Media packs are available on request
Commercial Director Clare Dove
International
Head of Print Licensing Rachel Shaw
[email protected]
www.futurecontenthub.com
Circulation
Head of Newstrade Tim Mathers
Production
Head of Production Mark Constance
Production Project Manager Matthew Eglinton
Advertising Production Manager Joanne Crosby
Digital Editions Controller Jason Hudson
Production Managers Keely Miller, Nola Cokely,
Vivienne Calvert, Fran Twentyman
Printed in the UK
Distributed by Marketforce-www.marketforce.co.uk
For enquiries, please email: [email protected]
Ultimate Linux Projects Fourth Edition (TCB6498)
© 2024 Future Publishing Limited
We are committed to only using magazine paper which is derived from responsibly managed,
certified forestry and chlorine-free manufacture. The paper in this bookazine was sourced
and produced from sustainable managed forests, conforming to strict environmental and
socioeconomic standards.
All contents © 2024 Future Publishing Limited or published under licence. All rights reserved.
No part of this magazine may be used, stored, transmitted or reproduced in any way without
the prior written permission of the publisher. Future Publishing Limited (company number
2008885) is registered in England and Wales. Registered office: Quay House, The Ambury, Bath
BAI 1UA. All information contained in this publication is for information only and is, as far as we
are aware, correct at the time of going to press. Future cannot accept any responsibility for errors
or inaccuracies in such information. You are advised to contact manufacturers and retailers
directly with regard to the price of products/services referred to in this publication. Apps and
websites mentioned in this publication are not under our control. We are not responsible for
their contents or any other changes or updates to them. This magazine is fully independent and
not affiliated in any way with the companies mentioned herein.
FUTURE Connectors.
Creators.
Experience
Makers.
Part of the
LINUX
The #1 open source mag b FORMAT
bookazine series
Regulated
Widely
Recycled
Tenp fCl
199.6 ACpttZ,6 | Packageld6,6 CoreO.O Corel,e |Pch_wU
I I
|0.O
12000
10
1100
|O
Power rwl
package-6,0
Build a custom digital signage system.. .30 Build a smart home office.......................... 62
Create an electronic display using Xibo Be the envy of your co-workers with our expert guide
Build a dynamic app security pipeline... .78 Take better photos with your
How to better safeguard your project Raspberry Pi......................... 110
We put the HQ Camera through its paces
Programming a Turing Machine................ 82
Put the computing father’s concept through its paces Back up and clone your Raspberry Pi 114
Save yourself some heartache and back up
Classic pseudo-3D racing road effects.... 86
It’s not quite OutRun, but it’s pretty close Turn a Pi HAT into a Magic 8-ball project 116
Harness the HAT to see into the future... sort of
How to code diagrams,
graphs and pie charts................................. 90 Raspberry Pi streaming.......... 118
Use Mermaid to visualise data Become a livestream Pi legend
Build radio walkie-talkies with Python ... 94 Create, configure and use gamepads 126
Create some communicators with micro:bits Planning some gaming? You can’t go wrong with this...
CUSTOMISE
inux Mint continues to go also ideal (we say) for beginners to you how to make it work with the state-of-
from strength to strength, as tinker around with. the-art Wayland display protocol.
you’ll know if you’ve already The flagship Cinnamon desktop can be If you like things slimline, we'll show you
had a play with the latest transformed not just with swishy effects how to go minimal with the featherweight
20.2 release. If not, what are you waiting and colourful themes, but with all kinds of Sway desktop, again powered by
for? Head to linuxmint.com and witness extensions, applets and desklets Wayland. Sway is based on the i3 window
the, er, Mint-ness forthwith. See, now you (collectively known as ‘spices’ in Cinnamon manager, popular with power users and
want to install it, don’t you? And that is parlance). And MATE and Xfce, the those who cannot abide desktop bloat.
just the beginning of the adventure. One desktops featured in other editions of Mint, We’ll have you doing everything in the
of the things that makes Linux Mint so are equally seasonable. But we can do terminal and tiling like a pro in no time.
cool is its potential for configurability. better than that: why not mix it up and And just so no one gets hurt, we’ll start
It’s often said (by the brains behind install a whole new desktop environment? with a handy reminder about how you can
Linux Format) that Mint is an ideal We’ll show you how to install the use Timeshift to easily undo any
beginner’s distro, and it turns out it’s outstanding KDE Plasma, we’ll even show desktop-related mishaps.
Q
transparent and
magazine may be able to correct this, but as
pasting Sticky
far as our research can tell, the first mention Notes are but
of Linux Mint in the core magazine came in the one way of
Distrowatch column of LXF094, when Mint 2.2 was customising Mint.
released. Even back then, Mint was notable for its
out-of-the-box experience, bundling codecs, Java and
Flash plug-ins and wireless firmware, saving users
from having to shoehorn those on there using fragile
instructions from a random forum post.
That experience remains central to Mint, and though
wireless hardware is well-supported on most distros
(and no one needs Flash any more), it still shines. Right Sooner or later, though, you’re going to want to
from the Welcome screen in fact, which will invite you to change things up. It generally starts with changing your
set up backups using Timeshift, switch keyboard layouts, desktop background and Cinnamon theme. These are
or send and receive files from another machine using important, but also quite easy - easy enough that you
Warpinator. Oh, and there are minimise buttons on don't need us to tell you how to do them. What we’ll be
windows in Cinnamon - a trend that feels like it is doing is a little more earth-moving. Tectonic stuff like
quickly disappearing on other desktops, but one which installing whole new desktop environments, swish
makes many a user feel at home. display managers, maybe even switching to the Wayland
Other desktops are going full steam ahead with display protocol. And while these aren't without risk,
Client Side Decorations (CSD, which allows applications Mint's Timeshift program allows you to back up your
to draw their own titlebars). This might allow system files (much like Apple’s Time Machine or
programs to make best use of space and provide a Windows Restore Points), affording an easy way to undo
coherent interface. Or it might make them look any desktop mishaps.
inconsistent, clumsy or other pejorative terms - it Even if nothing goes wrong, it’s handy to be able to
depends your own personal preference. At any rate, roll back to a cleaner system rather than unpick
Mint’s X-apps are refreshing in their avoidance of the changes manually: see the walkthrough below. If you’ve
CSD wave, and Mint’s substantial fanbase suggests that already got Timeshift set up, take a manual snapshot
the distro’s creators are still doing all they can to keep now before pouring in all the packages over the page.
their users happy. Go on, you know it makes sense!
Tweaking Cinnamon
See how easy it is to make your mark on Linux Mint’s
flagship desktop environment and beyond!
f you haven’t had a nosey around your workspaces. For even more efficient workspace
This package installs the standard set of applications that are part of the official MATE release
the desktop. It’s reassuring (sometimes) to see where results. You’ll also find Flatpaks of Spotify
applications were called into being from, and where they and Steam so you can queue up your Rush
disappear to when they minimise. Be that as it may, you playlist and play Space Invaders like it’s the
might want to turn these off, and this you can easily do olde days.
by from the Effects option in the Preferences menu. If you do want Snaps, perhaps to get the
Besides eschewing the Gnome desktop, Mint has latest version of Blender or the PyCharm IDE,
made a couple of other choices that fly in the face of that's easy to sort out from the Terminal. We first
desktop Ubuntu. One is the absence of the Snap remove the file that prevents the Snap daemon from
daemon, which prevents installing packages from being installed, and then install it with apt:
Canonical’s Snapcraft store. Another is that there’s no $ sudo rm /etc/apt/prefs.d/nosnap.pref
Wayland support (at the time of writing) in either $ sudo apt install snapd
Cinnamon, Xfce or MATE, the three officially supported Snaps can now be searched and installed from the
Mint desktops. You might not care about next-gen, command line. You can also browse what’s on offer at
cross-distro packaging systems or banishing old X.org https://snapcraft.io, but for a complete GUI experience
from your machine. Indeed, plenty in the Linux Mint
community seem to share this sentiment. But there’s
good stuff in the Snap store, so let’s look now at how we USEFUL DESKTOP EFFECTS
might enable that now. Plus, Wayland is pretty
“These effects aren’t the sort of
I
impressive now, so we’ll look at that over the page, once
we have a desktop that supports it.
When Mint 20 was released sans Snap support, an in-your-face, windows catching fire,
immediate consequence was that there was no way to
install the Chromium web browser, since Ubuntu (20.04 stunts of the early aughts.”
and later) now only packages it as a Snap. We think
more people should use Firefox, and if our user agent you'll want to install the Snap Store too. Appropriately,
tracking on linuxformat.com is anything to go by, it it’s available as a Snap and it can be yours with:
seems they are. But it sets a potentially worrying $ sudo snapd install snap-store
precedent; if Chromium was to be abandoned by One easy and surefire way to turn heads (or
Ubuntu’s DEB packagers, then perhaps other popular whatever is the virtual equivalent) is to bling your
applications might go the same way. We don’t think you terminal with a little transparency. Not only does this
should worry, as so far there’s been no sign of that. look pleasant, but if you arrange your windows correctly,
Team Mint now packages its own Chromium DEB and get into the habit of arranging them as such, it can
package, so if you’re craving a hint of Google in your be pretty useful as well. Endowed with X-ray vision, one
browsing then fetch it from the Mint App Store or with a can make out both the terminal itself and the web
good ol’ fashioned apt incantation at the command line. browser or whatever substrata lay below this.
We've seen that software is also available as To enable the opulent opacity effect in the Terminal,
Flatpaks, and that this is enables a wealth of software to go to Edit > Preferences then select the current profile
be installed from outside the Ubuntu (and Mint) (it will be named Unnamed Profile if you haven’t given
repositories. Flatpak is actually enabled out of the box it), untick the setting about system theme transparency,
on Linux Mint, and if you look carefully you’ll find some then tick the box above it. Play with the slider to find the
Flatpak applications in the Software Manager. For optimum opacity. Or, if you’d rather more drastic
example, if you want the latest version of GIMP, the changes look over the page, in which we install the
Flatpak edition is probably the second one in the search high-fidelity KDE Plasma desktop environment.
We have fond
memories of
wobbly windows
confusing our
graphics drivers
so its good to see
this still lives on.
duplication of core utilities such as text editors, media Both display managers work with all major Linux
players and screenshot tools. These all start to crowd desktop environments (and lightweight window
your application menus, and if you use, say, KDE’s managers), so which you choose is a matter of personal
Dolphin file manager in Cinnamon, it looks a bit odd. preference - or whichever you can find the prettiest
Finally, it’s sometimes hard for apt to completely themes for. The default SDDM theme is probably not
uninstall a desktop. It's likewise hard to repair a broken most people’s idea of pretty, but once you’re logged in
desktop after you attempt to clear out packages it’s easy to change this from Administration > Login
manually. So don’t do that; instead, try things out within Screen (SDDM). For some reason, perhaps an attempt
a virtual machine first, or make use of Timeshift io at irony, we found ourselves using a Windows-like login
restore things to a known good state (as we theme. Never mind that, you’ve probably just found
demonstrated earlier). yourself immersed in the wonderful world of KDE
Having installed (at least) the Plasma desktop we can Plasma. Behold the cool Breeze theme, marvel at the
opt to change the display manager from the polish and feel at home with the knowledge that all your
Mint-themed LightDM to the Qt-powered SDDM favourite Mint tooling is just a click away.
(Simple Desktop Display Manager). If you KDE 4, now largely retired, received occasional
installed from the command line this will be criticism for being too configurable. In part, this was fair.
offered to you, and if you didn’t you can get Every widget (and there were a lot of widgets) could be
to the configuration by running; configured, a clumsy edit mode gave them a handle
$ sudo dpkg-reconfigure lightdm about which they could be rotated or stretched, and one
was sometimes left wondering what the point of all this
Q kde-plasma
was. Worse, successive iterations of KDE 4 got very good
Kde-plasma-desktop
at hiding all kinds of key options just when you thought
KDE Plasma Desktop and minimal set of applications
irfrtrtrti 1.0
T Rcvtews
instal
you’d got a handle on where they ought to be. That
version of KDE also faced criticism for being something
lxf(3>mintxxii: -
of a resource hog, and shipping with all kinds of
a
File Edit View Search Terminal
lxf(8>mintxxii: -
Tabs Help
X
graphical frippery enabled. Modest machines would
qml-module-qtquick-templates? probably have been fine with this, but as the graphics
qml-module-qtquick-virtualkeyboard
qml-module-qtquick-window? qml-module-qtquick? driver ecosystem of the era was far more fragile back
qml-module-ubuntu-onlineaccounts qtchooser
qtvirtualkeyboard-plugin qtwayland5 sddm
sddm-theme-debian-maui signon-plugin-oauth? socat
then, hardware acceleration was not something that
Details software-properties-common software-properties-qt
sonnet-plugins sshfs systemsettings
someone could count upon.
Package kde-plasma-desktop
S:104ubuntu4
212.4 MB to download, 867.7 MB of disk space required
unattended-upgrades user-manager vlc-data
vlc-plugin-base vlc-plugin-video-output xsettingsd
You’ll be pleased to hear, then, that KDE 5 (or KDE
to upgrade, 446 to newly install, 0 to remove and 0 not
Reviews
to upgrade. Plasma 5 as the desktop prefers to be called) is a much
Very pretty, but locked me out of updating and even uninstalling, Need to get 212 MB of archives.
Hartley
After this operation, 868 MB of additional disk space will sleeker animal. In our tests it did use up a tiny bit more
2015.09.27
be used.
[Do you want to continue? [Y/n] | memory than Cinnamon, and slightly more than Xfce
(l) ® □ A 17*4
and MATE, but what’s a hundred or so megabytes
The lightest suite of KDE applications weighs in at around 850MB, but it is quite outstanding. between friends? It makes not one iota of difference
Basic Settings
Graphics
Applicationv
v
Desktop
Global Keyboard Shortcuts
Running •
Running
v
Plasma experience on Wayland has come a long way this Internet
User
Notification Daemon
Panel
PolicyKit Handler
Running
Running
Running
Office Directories
year. We’re told it even works with the proprietary Sound & Video
■j Power Management
Start
Running -
Stop
Autostart
Nvidia driver now. System Tools
Preferences
Leave Session
Environment
One thing that might strike you as jarring about About LXOt (Advanced)
v
v Ask for confirmation to leave session
1 2 P ■ 4 11:14
C N S GB
■: Mint-Y [GTK3]
ITiba
libMP
lihx3»
and several beginning with the letter A, probably). Start
♦nWl.rTTTi .WI. . rTi. rTTTI.FWI. Iccns: Mint-Y [GTK3] lostHatid/
trwttw
•rm. rm.
ummtiin
*
-mHWi:
.rrr.rni
.fTTTI.refU
Ictwiiv,!: rxvt-unicode
LH1: Intel i7-7500U (4) 8 2.903GHz
U ': 00:01.0 Red Hat, Inc. QXL paravirttal graphic card
Media/
Mlt/
opt/
typing the first few characters of firefox and you’ll see
iiimiiiiiiiiti .ttttt-' 383MiB / 1987H1B p-oc/
•
*■ rTYTi
* ••♦• •••• ••
• IHIIIIIIIIIII ‘
'' a a a a a * *
nrm 9
a
loot/
nai/
sbinP
this list get rapidly smaller. Press Enter when firefox is
intxxii:
lxfft
*
S free -h
srv/
sys/ highlighted in blue to start it.
total used free shared buff/cache available 8/25 [0:] 2021-07-03 13:24 lrwxr-xr-x 0B
Hen:
Swap:
lxfft»intxxii:
*$
1.9Ci
l.lGi
0
357M1
7.0Mi
384M1
l.OGi
7.CMi 1.2Gi 1.4Gi
If you already had a couple of windows open, things
Ta Start Page - Linux Mint x +
by now will probably be getting a little cramped. You
C Q fl https.7/www.linuxmint.com/start/uma/ (?)
could close one of them (either with a Ctrl+D or
Latest news from the Linux Mint blog
Many thanks to all our donors, sponsors and partners and all the
people who are involved in helping our project and our community.
We received 380 donations in June and more than 500 in July Not
only do your donations help us they constantly remind us you enjoy two windows open, hit Super+R to enter resize mode.
our work. On top of your feedback [...]
» KERNEL UPDATES
Being a derivative of the Long Term Support release shouldn't install the HWE stack unless something is
of Ubuntu, Mint by default uses the same 5.4 series broken, but it’s a safer bet than being seduced by a
kernel featured there. Don’t be put off by the fact stock kernel with a bigger number.
that the current branch of the kernel is numbered Desktop Ubuntu now gets the HWE kernels by
5.13, since Canonical backports all manner of default, and so it would seem does Pop!_OS, but not
features and fixes to the Ubuntu kernel. Also the 5.4 Mint. That's okay, because it’s easy to install:
kernel is itself a longterm branch (as you’ll see from $ sudo apt install --install-recommends linux-
kernel.org). It has always been possible, but not generic-hwe-20.04
recommended, to use mainline kernels in Ubuntu, If you are using the Nvidia proprietary driver
but a better way is to activate the hardware this is not enough, since you’ll need corresponding
enablement HWE stack. proprietary modules too. These you can get with:
This will give you a newer kernel (which recently $ sudo apt install --install-recommends linux-
bumped from 5.8 to 5.11) which has undergone modules-nvidia-NNN-generic-hwe-20.04
some Canonical patching and testing, as well as a where NNN is the version of Nvidia drivers required
refreshed graphics stack (new versions ofX.org and by your card. You can find this out by running
libdrm and what have you). There is a low-visibility ubuntu-drivers list. Be aware that lots of users have
Edge edition of Mint (nothing to do with the web encountered problems with the 5.8 HWE stack
browser) but it’s definitely not worth reinstalling just (sound, graphics, virtualisation) and the same is
to get a newer kernel. Likewise, you probably likely to be true for this one.
JELLYFIN
Credit: https://jellyFin.org
r iant the best features of Plex and Emby without introduced features for watching the same server
w
L______ J
the cost (or closed-source components)? Then
take a look at Jellyfin (https:Z^jellyfin.org),
content in real-time with far-flung friends and family.
Jellyfin quickly followed suit with SyncPIay, available to
which has come on leaps and bounds from a simple anyone who’s logged into your server.
fork of the last open-source Emby release (3.5). While While it’s true that Jellyfin isn’t quite as slick in terms
*OUR
Jellyfin still has a similar feel to Emby, it’s carving out its of clients as its better-known siblings, it still covers most
EXPERT own unique niche in the media server marketplace. bases (see https:Z^jellyfin.org/clients for a full list).
Nick Peers It may be free, but that doesn’t mean you'll miss out What it lacks in polish is more than made up by its
is shifting his on features. On the contrary, Jellyfin includes features customisability, and unlike Plex and Emby it doesn’t
allegiance from found only behind Plex and Emby’s respective paywalls: require cloud-based authentication to unlock all its
Plex to Jellyfin, hardware GPU transcoding for one, full support for live features, making it perfect for those wanting a server
and not just TV (including DVR facilities) for another. exclusively for use over their own network. (You can still
because it’s free! It's even keeping up with some of the newer features open up Jellyfin for remote access though - see the box
added to its rivals. Early in lockdown, Plex and Emby for details, below right.)
O Movies
O TV • Comedy (Intf)
to make use of Jellyfin’s hardware-transcoding features.
O tv Comedy (uk) Click the Stable link to reveal the full commands, or save
O IV • Documentaries
time if you’re running Ubuntu LTS (16.04 or later) by
□ TV • OtdHM The Empire Strikes Back
O IV • Genre
4 1980 122 mins | GB-U | *8.7 #94 Endsat12;59
issuing the following commands:
O TV Khls Genres Adventure. Action. Science Fiction $ sudo apt install apt-transport-https
Director Irvin Kershner
Admin
Welters George Lucas, Leigh Brackett. Lawrence Kasdan
$ wget -O - https://repo.jellyfin.org/jellyfin_team.gpg.
key | sudo apt-key add -
!■ Dashboard Version: Blu-ray Version
User
--*
\ I • V 1 ( IV 1CW
■ off
$ sudo tee /etc/apt/sources.list.d/jellyfin.list
O settings
1 ne Aavei [ English - Default_____________________________________
The epic saga continues as Luke Skywalker, in hopes of defeating the evil Galactic Empire, learns the ways of the Jedi from aging master Yoda But
$ sudo apt update | sudo apt install jellyfin
Once installed, Jellyfin will set itself up a service, and
Darth Vader more determined (han ever Io capture lukr. Meanwhile, rebel tender Princess I ria. cocky Han Solo. Chrwl
*.icca. and droids C 3PO and
3 Sign Out
R2-D2 ore thrown Into various stages of capture, betrayal and despair.
library, it’s best to start with just one. After it’s been fully <- A =
but you can add it as an option later via the plugins 21 mins ★ 8.5 rndsatlVPfl
Jake and Rosa assimilate to their new lives behind bars, but both are
repository (see the final Quick Tip). coping in very different ways. joke bonds with his cellmate, Caleb, and is
forced to join a prison gang led by notorious inmate Romero, in order to
gain his protection. Meanwhile, in the women s prison, Rosa puts Holt and
A quick note about filenames: Jellyfin broadly follows lerry to the test by having them complete outrageous favors for her. Back
in the precinct. Amy and Charles arc doing all they can to exonerate theif
colleagues
extras - see the Server>Media section of the online When thr warden ata Jake to Investigate Romero's drug smuggling
operation, Jake and Caleb find themselves caught between the loyalty Jake
has sworn to both of them. Meanwhile, Amy Is offered a deal by a local
Jellyfin documentation (https:Z^jellyfin.org/docs/ mobster who claims he can prove that I lawkins Is guilty, but I lolt and the
Flick the ‘Show advanced settings' switch at the top confirms whether you want to open remote access to
to reveal even more options. These include pulling in your server (for streaming content over the internet) -
artwork and whether you want to ‘download images in enabled by default - and whether you’d like to attempt QUICK TIP
advance’, which basically means downloading them UPNP port mapping. If UPNP is disabled on your router,
when media is imported into your library instead you'll need to manually forward ports to your server’s IP Quick Connect
speeds up login
of when requested by a Jellyfin app. address. This form of streaming is insecure - for a
From selected
Once you’ve configured your library, click OK, then better solution, disable the option and follow the guide
devices. Log
repeat for any other media libraries you’d like to in the box (below).
into your
configure now (you can add these later if you’re Once configured, click Next followed by Finish and account and go
impatient to get going). Click Next when done. Note Jellyfin will start scanning your media folders for content to Dashboard>
that, depending on the size of your media folders, in the background. Quick Connect
setting up each library can take some time. You’ll see to enable it.
to generate the
view for working your way through series. Beneath this code you need.
you'll see the latest additions to each library.
JellyFin’s home screen puts all your media within easy reach. Its Next If you configure Jellyfin with live TV (see the box
I Up Feature tracks your progress through favourite TV series. overleaf), this will also appear as an option on the main
screen. All of this is customisable by clicking your profile When browsing a library you’ll see three buttons -
QUICK TIP icon in the top right-hand corner of the screen and use these to change the way content is displayed from a
choosing Home from the pop-up menu. choice of six, including banner, list and the default
One area that
JellyFin is still Browsing any of these views is self-explanatory, with poster view. The A-Z button enables you to sort your
lacking in is, plenty of on-screen navigation aids. At the top are a library differently - for example, by IMDb rating or
up-to-date range of library views, from ‘Suggestions’ to ‘Genres’. release date. The final button is for filtering the view,
documentation. Two views are customisable: Favourites will appear as with options including genres, parental ratings and
IF you run into an option on the home screen for any favourite items whether or not the show has been watched or not.
problems, you roll over and click the heart icon to highlight. Jellyfin Select a specific movie, television episode or other
use its reddit also supports Collections, which makes it possible to piece of media to go to its own page. The annotation
channel (www.
manually group related items together, whether it’s all (see the start of this article) reveals what controls you’ll
reddit.eom/r/
the James Bond or Star Trek movies, or films featuring a find on these pages.
jellyfin/J to
search For
favourite actor like Tom Hanks.
answers - or
Fix metadata
post your own
<- ft = TV • Drama It’s a good idea to browse your libraries after adding
question iF them, because Jellyfin is more prone than its rivals to
Latest Episodes
needed. Also incorrectly identifying shows and movies - particularly
check out those whose name is shared with other releases. When
https:?/Forum. you spot an error, roll your mouse over the incorrectly
Ann* KAf«ntn« (2000)
m High Fidelity The fates of Henry - a cynical American correspondent who has tost his soul - and Teresa, one of the Republic’s censors and
A
in charoe of overseeinq the news that loumallsts can send abroad, cross in Gemika
< Ghostbusters Logan Hlqh-Rtoe
‘.IL’ Leave No Trace
Food Unwrapped Trip Hazard: My Great Brltls... The Lion in winter 01/08/2016 O
< Channel 4 News Goqqlebox m The Lost City of L
Instant Cappuccino, Tinned Tc Whitby
Once set up, The Monuments Men
Year:
Mr Turner
.tfore GB-18
On Golden Pond
“L" The Underground House: Rev Phase Zwel
guide and can Possthenddele
Original aspect ratio: 30 format:
< Vlbrapower Slim 3 Blockbuste Nono Hair Removal Blockbuster H2O Steam Cleaning Launc
recordings to add
Jellyfin’s Metadata Manager is a prime example of how it enables you
I
to your library.
to fine-tune your media collection to your personal tastes.
QUICK TIP
The Server section enables you to change your x264/x265 - familiar to Handbrake users - which
server name and preferred language (General), plus enable you to fine-tune the quality of your transcodes. Select
Dashboard>
administer your own and add other users (Users) - see The Streaming tab is where you can set an
Advanced>
the walkthrough for a more detailed guide on setting up ‘Internet streaming bitrate (Mbps)’ limit. You can use
Plugins to
Jellyfin for sharing. The options revealed there can also www.speedtest.net to benchmark your home internet extend Jellyfin’s
be applied to your own user account, enabling you to connection, making a note of the upload speed. Unless Functionality
personalise Jellyfin's look and feel. you have cable or a gigabit broadband connection, you’ll using plugins.
Server also contains tools for adding libraries and need to set a reasonable limit here - 3Mbps or 4Mbps These cover
managing existing ones (Libraries) and configuring should enable users to watch 720p high-definition Authentication,
playback options (Playback). Playback has three tabs: content without forcing the server to transcode the Channels,
Transcoding is where you enable hardware-accelerated stream to reduce its bitrate. General, LiveTV,
Devices XL IJw Edit this user's profile, image and personal preferences.
Libraries
Cd Devices Name:
■l Ubraries
Collections
.0 Quick Connett Harriet
>/| Movies ► Playback
□ Activity
| | TV Comcdy(lntl) •V Allow remote connections to this server.
Devices
EJ DLNA If unchecked, all remote connections will he blocked
■Z| TV Comedy (UK)
Eb Devices
Channels Display
Server
!■ Dashboard Live TV
Display
Movies
G General
Osplay language
Music
XL Users
Trailers
M Libraries
Shows
► Playback
Devices
al Quick Connect
Access Schedule +
□ Activity 01 R»di«nc«
3 DLNA LtQht
Purpl* Hju*
Optionweekday • • •nx.
Live TV
18:00-21:00
itrcss liner
Contra! Options
« Reset >
Visual Options
>
pAckagr-0,0
4.0 rare,0 iincore ,0 dram. 0
Shashank distro, or the hardware that it runs on, is system [N/A] UIF 8
ReTresh[k]:2.0
for geeky Ul, you can simultaneously monitor CPU temperature, installing the tool is fairly straightforward, and the
memorabilia. frequency, power and utilisation. The utility presents all project’s GitHub page describes various installation
the information graphically and can even be used to techniques. If your Linux distribution is already
export the data into CSV files. Better still, you can configured to use pip , you can install S-TUI with the
configure S-TUI to automatically launch scripts when sudo pip install s-tui command.
the values of any of the components being monitored For other installation methodologies, such as
breaches the defined threshold values. When coupled installing it from Git, you’ll have to ensure all the
with stress, another command-line utility, S-TUI can also dependencies are installed. These include tools such as
be used to stress-test your system. urwid and psutil. Although it isn't a dependency, if you
decide to use S-TUI to also stress-test your CPU, you
Don’t stress over installation should also install stress or stress-ng. Thankfully, these
Although S-TUI isn’t available in the software are offered in the software repositories of almost all
repositories of most popular desktop distributions, desktop distributions.
Unlike many other command-line utilities, S-TUI quick introduction. For a complete list of all the
requires no configuration and you can begin using it supported command options, you must run the
QUICK TIP
immediately after installation. Run the s-tui command s-tui-help command. The stress
to launch the utility. The collected data is lost as soon as you exit S-TUI, utility performs
At the top of the sidebar on the left are the details because the tool doesn’t save it by default. If you want a loop that
calculates the
about your CPU. Our Lenovo test machine was correctly all the collected information to be automatically saved
square root
identified as running an Intel Core i3-5005U CPU @ to a CSV file when you exit S-TUI, you must invoke the
of a random
2.00GHz processor. This is because S-TUI utilises utility with the s-tui-c command. The collected data
number in order
various other native tools and utilities to gather the will be stored in the users' home directory. You can then to stress the
relevant information. For instance, the same information view the s-tui_log_<TIME>.csv file in your preferred text CPU. You can
and far more details can be ascertained from running editor. You can also provide a custom name for the CSV customise the
the cat/proc/cpuinfo command. log file with the s-tui -c <path_to_CSV_file> command. stress options
When you first launch S-TUI, it displays all four Another useful command option is -j, which can be by navigating
parameters - Frequency, Utilization, Temperature and used to print on the screen the current status of the to the Stress
Power - and refreshes the data for each every second. machine in JSON format. The output generated by the Options screen
From the S-TUI
You can change the refresh rate by changing the value s-tui -j command is a record of the current status of
sidebar. The
of Refresh[s]:1.0 on the sidebar. the machine, and not a running log:
graphical
Depending on your terminal application, and the $ s-tui -j
interface
colour scheme, you may not be able to clearly see the enables you to
different elements on the S-TUI interface. Should this "Frequency": { define all the
happen, exit S-TUI, then switch to a basic White-on- "Avg": "1282.1", major settings
Black colour scheme on your terminal emulator, and run "Core 0": "1630.6", such as the
S-TUI again. You should now be able to see all the "Core 1": "1295.6", worker count
different colours used by S-TUI to display all the "Core 2": "1175.6", for the sqrtO,
collected information, and you can edit your terminal "Core 3": "1026.4" syncO, mallocO
Functions, as
profile accordingly. }/
well as choose
You can use the up and down arrow keys to navigate "Temp": {
whether to dirty
the sidebar, but S-TUI also supports the use of H and J "Acpitz,0": "48.0",
the memory.
to scroll, much like you would in Vim. "PackageId0,0": "49.0",
"Core0,0": "47.0",
Add some stress "Corel,0": "47.0",
By default, S-TUI is configured to only monitor your "Pch Wildcat Point,0": "40.5"
system. This is evident from the (X) next to Monitor on }/
the sidebar. If you installed the stress utility as well, you
can enable the stress feature by navigating to the Stress S-TUI supports a number of different temperature
entry on the sidebar and pressing the spacebar. You’ll sensors and you can choose a different one by
notice the empty brackets would be replaced with (X) navigating to the Temp Sensors screen. This is only
now. You can similarly enable or disable monitoring of needed if the default configuration fails to accurately
the different components. When you disable a graph the CPU temperature on your machine.
component, the corresponding graph will automatically All the basic settings, such as the refresh rate (in
disappear from the interface. seconds) and which components to graph, by default
Unlike most other command-line utilities, S-TUI can are stored in ~/.config/s-tui/s-tui.conf. Unfortunately,
also be controlled with the mouse. You can left-click on you must set the Stress options and the temperature
an entry/option in the sidebar to select it. You must still sensors every time you run S-TUI as the tool doesn't
hit Escape to return to the main screen and use the permit saving these settings in the configuration file. E5
arrow keys to scroll through the sidebar as the
scroll-wheel on your mouse doesn’t work with S-TUI. To 1 /1 ▼ L* c? Tilix: linuxlala@playground: *
disable the mouse, you must invoke S-TUI with the 1: linuxlala(®playground: -
Temp [C]
s-tui-nm command. Stress Options PackageId0,0 Core0,0 Corel ,0 Pch Wildcat Point
from within S-TUI itself, if you believe the graph is Sync() worker count: 0 Core 0
Frequency [MHz]
Core 1 Core 2 Core 3
inaccurate. Navigate to the ‘Temp Sensors >’ entry on Malloc() / Free() worker count: 0
the sidebar, and press Enter. This opens the Available Bytes per malioc*: 256M
Util [%]
Temperature Sensors dialog, and you can then select Touch a byte after * bytes: 4096 Core 0 Core 1 Core 2 Core 3
in the list, press Spacebar to select it. Remember to instead of free / alloc
core,©
Power W]
uncore,0 dram,©
Write() / Unlink() worker count: 0
select Apply for the changes to take effect. Byte per Write(): 1G
You must hit Escape to return back to the main Default Save Cancel Fan [RPM]
thinkpad,©
screen of the application, such as from the About> Core0,0 46.0|
While the graphical interface for S-TUI also has a You must refer to the man page and documentation on the stress utility to understand the
Help section in the sidebar, it provides little more than a I different supported functions.
Credit: https://cozy.geigi.de
cozy!
Build the ultimate
audiobook collection
Nick Peers reveals how to put together your own audiobook
library using CDs, free downloads and Audible purchases.
e all love a good story - after all, telling stories ActtvitiM O rirefox Web Orowief A * O
w
UbrtVox • MoxAU Flrtfox n 9
<- -> C? 0
ah IV librtvox
© O Q, Search ± b\ gj £ ::oooeoai? nn o.
continue that tradition into the modern age, and thanks PontN to LIWWI
A Tate of Two Cities (in Fits! Chapter Collection 001)
In this guide, we’ll show you how to bring all of your WMM) LOpffliW>
per chapter, and this is something that OpenAudible can File Edit Controls Actions About
View In Audible Ctrl+L
OpenAudible 2.3.4
do with your Audible library by splitting books into Show AAX F2
.ibrary Status
Show MP3 F3
separate files - one for each chapter - during the Connected: No Show M4A
Region: UK
AAX-to-MP3 conversion process. Books: 13
Play Audio Book Heron Carvic
audiobooks; or arbitrary break - say splitting each CD The radio dramatisation of The Hobbit became a classic when it was first broadcast on BBC Radio 4 in 1968 and it continues to delight today. Tolkien's famous saga, the prelude to the Lord of the
Rings, has all the ingredients of fantasy and adventure: dwarves, elves, goblins and trolls, a fearsome dragon, a great wizard, a perilous quest and a dramatic climax.
Convert your Audible library Up Till Now William Shatner William Shatner 06:10 2020-09-29 2008-05-20
Let’s start with revealing what do with your Audible OpenAudible converts your Audible purchases into DRM-free audiobooks for your own
collection. You’re probably already listening to them
using an app - either on your phone or via the open-
I consumption on your choice of platform.
source Audible for Linux tool (https://github.com/cross- through FastSpring. Once you’ve received your licence
platform/audible-for-linux). This ties you into Audible’s code, choose ‘About > Activate’ to enter it, then press
DRM system, meaning you won't be able to combine Ctrl + T to convert the file to MP3 format.
QUICKTIP
your Audible titles with those sourced elsewhere. One final step: the file is converted into a single file When it comes
Until recently, there was a free solution to this in the by default, so once done you’ll need to choose ‘Actions to assigning
form of OpenAudible - it’s now shareware, but if you’re > Split Selected Books’ and wait while a progress bar genres to your
audiobooks,
desperate to produce non-DRM versions of your Audible reveals how many chapters or files will be created, plus
avoid the
books, then the £12 registration fee isn’t too prohibitive. keep you updated with how it’s getting on.
generic
By way of compensation, it supports up to three Once all this is complete, a folder window will open to
‘Audiobook’
separate Audible accounts and comes with a year’s reveal your converted audiobook inside a sub-folder to come up
worth of updates. with the title as its name. You can now copy or move this with specific
To get started, head over to https://openaudible.org into your Audiobooks library (you’ll need to create an book genres
to download a DEB package or Applmage - the latter is Author folder if you've not done so already to place the like Mystery or
the simplest to use: simply place it in your Home folder folder in). Sci-Fi. Search
and don’t forget to right-click it and choose For those with large Audible libraries, there’s some Goodreads.com to
Properties>Permissions to tick the all-important ‘Allow good news: once you've purchased a licence, any book see how other
readers have
executing file as program’ box before launching it. you subsequently download will be automatically
categorised
Once up and running, press Ctrl+K to open a converted to MP3 (see Edit>Preferences where you can
a book, if
browser window that will redirect to Audible.co.uk - also adjust the encoding quality of the resulting MP3 file
necessary.
look for the Sign In button in the top-right corner to log if you wish to change the balance of file size versus
into your Audible account. Once logged in, close the audio quality). Select multiple books at once and
browser window to return to the main OpenAudible choose Actions>Download to do so - you'll be
interface. Next, choose Controls>Quick Library Sync
and after a short pause you should see your Audible
purchases appear. » TRACK DOWN COVER ART
Next, select a title - you’ll see a summary and
artwork appear. Its State should read ‘Ready to To hunt down artwork, head to https://images.google.co.uk and
download’. Choose Actions>Download and wait for the search for the title of your book plus the word ‘audiobook’. You’ll
audiobook to download in its native AAX format. All of almost certainly get a match, but wait - is it suitably hi-res? Our
this can be done for free, but this is the point where preferred size is 600x600 pixels, although 500x500 is the size of
you’ll need that licence. If About>Purchase doesn’t artwork embedded into your Audible collection by OpenAudible.
work, head to https://openaudible.org/purchase to buy To locate higher res artwork more easily, click Tools under the
Google Search button and change Any size to Large, which will filter
frerac - free audio converter vl.1.2 X
File Database Options Processing Encode Canrei Name Q out smaller images. Hopefully at least one will remain: click it to view a
’ © a Ml ’ © O© O Gt Home © home me
* Auchobooks Alexander McCall Smith
preview. Roll your mouse over this to reveal its size - if large enough,
O Desktop Name Size Modified
joblic Toqj Logs
right-click it and choose ‘Save image as’ to save a copy to your hard
• oi - Alexander Mccall smith-corduroy MaiHiofts.mpl 12.7 MB 13:47
?3file(s)injobl.st: £, Documents 02 • Alexander McCall Smith • Corduroy Mansions.mp3 13.6MB 1350
K Artist Title OS Alexander McCall Smith - Corduroy Mansions mp) 13.3 MB 13.51
2 Downloads
drive. Use your image editor to reduce both its physical size to
Kunknown artist unknown title 04 • Alexander McCall smith • corduroy Mansicns.mp 3 13.3 MB 1358
X unknown artist unknown title Music OS Alexander McCall Smith - Corduroy Mansions.mp3 13.6 MB 14 04
X unknown iftiit unknown title
oo - Alexander McCall smith - corduroy Mansions.mpj 14.4 MB 14:10
£ Pictures
prompted about automatic conversion for the first error message stating that the freedb.org database has
QUICKTIP book, but thereafter it’ll all proceed in the background. no record of the CD. This will be true for most - if not all
Fancy turning And once that process completes, choose Actions>Split - audiobook CDs, so choose Database>Automatic
your audiobook Selected Books to complete the process. CDDB queries to remove the automatic check.
collection into At this point, you could tag your files using fre:ac's
a streaming Rip audiobook CDs Tags>Albums tab section where you can manually input
server When it comes to ripping audiobook CDs, you’ll need a the author (Artist) and book title (Album), plus add
accessible From ripping tool that can combine multiple tracks into a artwork, a year and genre. While this works perfectly, it’s
anywhere over single file - we recommend fre:ac, which you can install very fiddly - you need to add this information manually
the internet?
through the Software Centre. To enable this feature in each time you insert a new CD, and it’s much quicker to
Dig out your
the program, choose Options>General settings. Verify handle the process later on using Kid3, so for now leave
copy oF LXF259
the LAME MP3 encoder has been selected, then check everything set as ‘untitled’.
and turn to
page 64 For our ‘Encode to a single file’. Click Select under Output folder
two-page guide to select your Audiobooks folder and untick ‘Use input Select tracks to rip
to building and file folder if possible’. Ignore the ‘Filename pattern’ field Now, you need to select all the tracks you plan to rip as
maintaining for automatically naming your output files - it doesn’t your first file. If you’re ripping an entire disc, just make
the perfect work when ripping multiple tracks to a single file. sure everything’s selected; otherwise you need to locate
audiobook Spoken audio recordings take up less space than the first and last tracks that make up your selection -
server using regular music due to their relative simplicity, but you can either aim for 25 (or 35) minutes for an arbitrary break,
Booksonic.
squeeze them even smaller by switching from stereo to or use the playback controls above the track list to work
mono recordings: click Configure encoder next to the out where each chapter begins and ends.
LAME MP3 encoder to do so. Change the Use preset to Finally, click Select next to Output folder to open
Custom settings, then switch to the Misc tab and choose your Audiobooks folder, then manually create a new
Mono under Stereo mode before clicking OK. author folder (or select an existing one if applicable)
Next, insert the first disc of your first audiobook and followed by a folder named after the book title. With this
click the ‘Add audio CD contents to the joblist’ button. selected, you can now click the green ‘Start the
You’ll see all the CD’s tracks appear, accompanied by an encoding process’ button from the main toolbar.
You’ll be prompted to save the file - automatically
named Artist - Album (or Author - Book Title).mp3. Be
» ANDROID AUDIOBOOK HEAVEN sure to insert a track number at the beginning
corresponding to the chapter, part, or disc number - so
Want to listen to audiobooks on your Android phone? If you’ve ever Ol-Author-Book Title.mp3, for example. You might even
used Booksonic (covered in LXF259), then the obvious solution is to prefer to name the file Ol-Chapter One.mp3 or whatever
install the official Booksonic app (£2.49), which not only streams naming convention you like - just make sure the track
books from your server to save space on your phone, but enables number is at the beginning.
you to mark individual titles for listening to offline. This means that Once you click Save, the rip will begin. A progress
they’re temporarily downloaded to your phone’s storage, which indicator will reveal how your rip is progressing and
makes it possible for you to listen to them anywhere, then easily completed tracks will disappear from the queue. When
removed when you’re done. finished, a single MP3 file will have been created. Now
If all you want is to listen to audiobooks you've transferred to your repeat the process for the next chapter or part, and
phone’s storage - after all, you when you’ve finished with a disc, move on to the next.
can fit a heck of a lot of books on
to a 32GB microSD card - then = Smart AudioBook ID3 Tag your media
try Smart AudioBook Player Once you’ve ripped your audiobook CD, it's time to tag it
instead. When you first launch it,
stssE □ A using a tagging tool. We’ve opted for Kid3, which is
The Breakdown
simply point the app towards regularly updated and has evolved into just the tool for
Read 8:04 of 9:25:37 1% Left 9:17:33
your Audiobooks folder, then audiobook tagging. It’s best installed through the
01 - The Breakdown.mp3
refresh the library to view a Terminal to ensure you get access to the latest version:
complete list of books, sorted by $ sudo add-apt-repository ppa:ufleisch/kid3
author and then title. Tap one to $ sudo apt-get update && sudo apt install kid3-qt
access its own playback screen Once installed, launch Kid3 and choose
where you’ll find all the controls Settings>Configure Kid3. Up the ‘Track number digits’ to
you need - and then some, 2 (so 01, 02 rather than 1,2, etc), and tick Album Artist
including Characters (to help you and Composer under Quick Access Frames before
remember who's who) and dragging and dropping them in alphabetical order. Like
Bookmarks (for jumping to Artist, Album Artist will record the author’s name, while
favourite passages quickly).
After 30 days, the app reverts
to a basic cut-down version - it
has all the core functionality you
need, but the full version costs
just £1.89. Select Help> Features
to compare versions followed by Smart AudioBook Player has all the
playback controls you could ever need
Help>Version>Buy to purchase. You can create your own custom genres in Kid3, enabling you to add
(or want, Frankly).
I another layer oF organisation to your audiobooks.
r <-> o *
the Composer field is for recording the audiobook's Activities
® II
n Cozy *
■13:47 to & Q =
a
tf x
J A Man Uy Doad - Chapter 1
narrator. You’d expect things to be the other way round, Recent Author Reader
and Crime to Sci-Fi and generic Fiction. When you’re Margery Alli ogham
done, tick ‘Show only custom genres’ if you want to Michael Rond
Blackkerchief Dick: An
Albert Campion Mystery
Cargo of Ear Open in file browser
Mick Inkpen
satisfaction, click OK. You’re now ready to tag your files Ngaio Marsh
Paul Daneman
consistent tags across all your audiobook’s files, and Peter Marinker
Peter Straub
Hide My Eyes Mystery Mlle Police at the Funeral Sweet Danger
add album art. Richard Briers Philip franks Philip Franks Philip Franks Philip Franks
Roald Dahl
How to enjoy your audiobooks Dedicated audiobook player Cozy works beautifully with your audiobook library - no need to play
Once your audiobooks have been ripped, organised and
tagged, it’s time to enjoy the fruits of your labours. While
I them in a music utility.
you can listen to an audiobook through any music authors or narrators (depending on the view that you're
player in Linux, it’ll be a messy process trying to using), while the right-hand pane displays a list of titles, QUICK TIP
combine music and audiobooks in the same program, again in alphabetical order, complete with artwork. Use We’ve chosen
never mind library. Instead, use a dedicated audiobooks the left-hand pane to filter the view by author/narrator if MP3 as the
player called Cozy, installed via Flatpak: necessary, then roll your mouse over its image cover to file Format for
$ sudo apt install flatpak reveal a play button to click: alternatively, click our audiobook
$ flatpak install flathub com.github.geigi.cozy elsewhere on the artwork to view the title up close. library because
$ flatpak run com.github.geigi.cozy Cozy’s user interface is nice and straightforward to spoken word
recordings
The program will launch - going forward, it can be navigate - you’ll see a series of buttons across the top,
don’t require
opened through the Launcher. Step one is to import including a handy 30-second rewind button next to the
audiophile
your audiobooks - simply select your Audiobooks folder play/pause button, plus a progress bar to
levels of quality.
to proceed and Cozy will import them into its library. navigate quickly through the current track. You’ll When you
Once complete, choose your view: Author displays titles also find playback speed, sleep timer, and search factor in the
by Composer field (meaning the narrator), whole buttons to the right. length of most
Reader displays them by Album Artist (so the author). Click the menu button for more options - you can audiobooks -
Hang on - haven’t we just organised everything the manually refresh the library after ripping new many hours
other way around? Yes, because other audiobook audiobooks, tick the box to hide unavailable books per title - the
programs and services organise them that way, as do (such as those stored on currently disconnected smaller your
Files the better.
regular music players. Don’t worry, though, because external or network storage), plus revisit the
Cozy can be configured to swap them round to avoid Preferences section, where you can add additional
confusion: click its menu button and choose folders to Cozy's library if you wish via the Storage tab.
Preferences>Behaviour tab, then flick the ‘Swap author And what about consuming your audiobook
and reader’ switch to instantly correct the view. collection on other devices? The box (opposite) reveals
Now return to your chosen view, where you’ll be all you need to know about listening to your audiobook
greeted by a two-pane window. On the left is a list of collection on your Android phone. E3
VI
RISE OF
o rvaq « .
I Mtn I
o«r« rar* . i
ROBOT
Mats Tage Axelsson
basics of a roboticybperating
system and reyedls what
component an be used • •
r i .'N
rxjtcr.
ssembling your own robot This isn’t something you whip up in The ROS is better described as a
and getting it to walk around your coding cave on a rainy afternoon. robotics framework, but what do you want
will entertain kids of all ages Being free and open source enthusiasts, from the ROS and what do you need to do
for a good few minutes. we know better than to believe we have to to get a robot up and running? We’ve
However, for robotics to be long-term cover every detail ourselves. There have already mentioned that many subsystems
fun it needs to be a challenge. been many projects to make robotics an control different parts of the robot. Your
A common misconception about area you can thrive in and help expand, the robot will need to navigate, move and
robotics is that you need a degree to make most successful organisation to date is the interact with its environment. That may
anything of your own. Having said that, a Open Source Robotics Foundation include interacting with you and other
robot does require many subsystems to (www.openrobotics.org). Out of this has humans, but that’s for another time. The
operate. There are legs to move, arms to developed the Robotics Operating System simplest robot will run around the house
stretch, things to see and react to. (ROS). It’s not an operating system as exploring - a more advanced version will
Basically, everything we do as humans - such, but rather a collection of tools that go to the kitchen and bring you a new
except you must design the entire system help you create your version of what a beverage. For all this you need sensors,
that can handle all those tasks. robot should be and do. micro controllers and a lot of mechanics...
other tasks. You may also want to use many nodes, You also need nodes to handle things like the wheels,
possible across different types of hardware. For these moving arms and drivers for hardware.
reasons we would advise setting up a separate Advanced tasks that you’ll need to put into a node
environment for ROS whenever possible, rather than include: navigation, image processing and machine
use your main system. learning tasks. Some machine learning will already be
You might as well start running it in different on board, while other such tasks must run on separate
machines, even if they are virtual. The communication servers, or even in the cloud - it’s cheaper and more
will be between machines; this makes simulation more doable than you think! Your main tools for running a
accurate. You can find a Linux container solution on the ROS system are roslaunch , rosrun and roscore .
ROS website. The basic idea is that you install Ubuntu In reality, you’ll start the system with the roscore
and add ROS to the image when it’s running. command and then run a package at a time with
When you use a container you won’t experience rosrun. The roslaunch command will run all your
problems with dependencies on other parts of your nodes using an XML-based file with the launch
system. See the NixOS boxout (be/ow) for more on this. extension. The API for the files isn’t stable though, so be
careful with upgrades if you decide to use this tool.
Building blocks These are the tools you’ll run while exploring the ROS
The full install includes many planning tools and the system. They'll run many other tools that are specific
emulators/simulators for testing without hardware. As for your current task. Turtlesim is one, and you run that
we mentioned earlier, the main function of ROS is to with ros2 run turtlesim turtlesim_node . If you look
establish the communication protocols between nodes. for more things to run, just type the same thing but use
tab after ...run and you’ll see what exists.
File Plugins Running Perspectives Help Once the nodes are running, you need to control
Service Caller D C R ? -OX Service Type Browser elements of the robot and manage communications.
Service: action msgs
p
Service /ComponentManager/_container/load_node Call You saw a little bit about the communication system
Tree Type Path
p Request earlier - here it is in more detail. Each node will run one
Topic Type
o /ComponentManager/_container/load_node compositionJnterfaces/srv/LoadNode
or all of the following:
package_name string
plugin_name string
node name string > Services
nodenamespace string
logjevel uint8 A service sits ready to answer a request from another
remaprules sequence<string>
parameters sequence<rcl_interfaces/Parameter> node. The content of the messages cover values such as
s extra_arguments sequence<rcljnterfaces/Parameter>
a goal, diagnostic values and the state of movements.
You can also pick up information from different sensors,
Response
y
Field Type Value
both the function of the robot and position using GPS
and the other environment sensors that help your robot
The RQT displays the Format oF all the messages that you can create, along with all available complete its task.
I services states. If your node needs this information, you need to set
up a service client that asks for this information. The
node will then process it and send other messages.
» RUNNING WITH NIXOS When there’s data that other parts of the system need
to know about, you create a publisher in your node that
For fans of the NixOS and its package manager, there's also a way to updates a topic. Any node that needs the information
set the whole ROS system up using NIX. Most of the problems with subscribes to the topic. Those nodes then receive
revisions, particularly those involving libraries, are solved with NixOS notifications all at once when the publisher sends it.
so it enables you to keep a clean system while using ROS. There's a Most of these will serve streaming data. The ROS
solution available at https:Z<aira.life and http:Z^robonomics.network. implementation isn’t designed to know what data is
You can clone this repository and pick anything from the whole ROS sent - that’s for the implementation to take care of.
project. Even if you are using other distributions, you can use this
approach to create a development environment. Learn more at > Nodes
https:Z^bitly/lxf272aira. Each node has a specific task. In your average robot,
If you want to develop with Python, you can always add that in the you’ll need to control wheels, view the surroundings and
call to the shell that you’ll eventually run. It’s as simple as using the interpret the data to take appropriate action. Each part
add option to the nix-channel command. You can also make this & 51°C Q 14% Q4.7 GB
turtlesim node < 13.8 °C
work in a directory where the nix-shell command runs. In this case, matstageQmats-Ubuntu (192.168.1.6) - byobu
you can have different libraries in different directories. It’s equivalent atstageGmats-Ubuntu: $ Ixc ubuntu rosFoxy
huntu@rosfoxyros2 run turtlesim Turtl«Slm (on rosfoxy)
If you want to contribute your own code, you should fork the code [INFO] [1606051391.352713512] [draw_square]: Reached g
[INFO] [1606051391.352939656] [draw_square]: New goal
[INFO] [1606051395.288713655] [draw_square]: Reached g
and clone your own fork. If you want to contribute any changes, you [INFO] [1606051395.288813303] [dr8w_square]: New goal
[INFO] [1606051397.224753652] [draw_square]: Reached g
can raise a Pull Request to the project. Under NixOS, this works from [INFO] [1606051397.224838475] [draw_square]: New goal
[INFO] [1606051401.160857518] [draw_square]: Reached g
[INFO] [1606051401.160952710] [draw_square]: New goal
any git repository. You can find the current status and progress of the [INFO] [1606051403.096844888] [draw_square]: Reached g
[INFO] [1606051403.096963506] [draw_square]: New goal
ROBOT AGENT. Much of the technology revolves around block chain [INFO] [1606051412.905151410] [draw.square]: New goal
[INFO] [1606051414.841009756] [draw_square]: Reached g
[INFO] [1606051414.841099205] [draw_square]: New goal
and the Etherium block chain. This gives you the ability to have more □
secure communications. The turtlesim project stems from the Turtlebot company. It uses ROS
contains; there are no set rules. You must make a node rosdep
ubuntuGrosfoxy: S roslaunch
rosdistrojnigrate_torep!43 roslaunch-deps rosnode
The most expected examples are the ones previously Traceback (most recent call last):
File "/usr/bm/roslaunch", line 34, in <module>
import roslaunch
interpretation. All these things are already solved for from rosgraphjnsgs.msg import Log
InportError: cannot import name 'Log' from. 'rosgrapn_msgs.msg' (/opt/ros/foxy/lib/python3.8/site-[
ubunttM’rosroxy: S apt show ros-foxy-turtlesim
you, although you may have better solutions. All nodes Package: ros-foxy-turtleslm
Version: 1.2.5-IfocaI.20266911.221305
Priority: optional
Section: misc
communicate using topics and services, and to control Maintainer: Dirk Thomas <dthomas£osrfoundation,org>
Installed-Size: 9246 kB
Depends: Ubc6 (>= 2.14), Ubgcc-sl (>= 3.6). Hbpython3.8 (>= 3.8.2), Hbqt5core5a (>= 5.12.2), 1$ .0.2
the entire system you have the ROS Master, which ros-foxy-fastcdr, Iibqt5gul5, ros-foxy-ament-index-cpp, ros-foxy-geometry-msgs, ros-foxy-rclcpp,
os-foxy-ros-workspace_________________________
jigs,
Homepage
it. Using this method, you’ll write all the code to send ros2 pkg: error: argument Call ros2 pkg <command> -h for more detailed usage.: invalid choice: 'execuatables1 (choose from 'create', 'executables', 'list', 'prefix', 'xml'
O Displays
By display type By topic
get started with. It was built using extensions for new hardware and
~ $ Global Options
Fixed Frame map
’ IQ rvizcommon already supports an impressive list of hardware. These include boards,
Background Color ■ 48; 48; 48 IT~I Group
Frame Rate 30
- D rviz_default_plugins
/k Axes
OpenCV and even drones. The libraries are full of code samples, so for
* Q Global Status Warn
O Fixed Frame No tf data. Actual error: ...
Camera
jfl FluidPressure
a simple way to get started with any of the included platforms, this is
- Grid V
► Z Status: Ok
«S> Grid
F2 GridCells
an excellent option. Find out more at www.cylonjs.com.
Reference Frame <Fixed Frame>
Plane Cell Count
Normal Cell Count
10
0
A Illuminance
□ Image
If you’re more into the Go language, look no further than Gobot
A InteractiveMarkers
Cell Size
Une Style
1
Lines
(www.gobot.io). Installation is via the usual Go package system. Use it
Description:
Color
Alpha
□ 160; 160; 164
0.5
with the go get command. As all the others, the first example is a
Plane
► Offset
XY
0; 0; 0
flashing LED on an Arduino. The Gobot supports many other
platforms though, so you have plenty of options as with the others
You can use rviz to view environments and create obstacles For your micro-controllers mentioned here.
I robots to overcome.
XIBO
Okedit: https://xibo.org.
Xibo
in public places, displaying a range of
information. This is called digital signage. In this tutorial
we’ll be looking atX/bo, a flexible system that can be
used to show images, videos, RSS feeds, weather data,
OUR mapping data, tables of information, websites,
EXPERT embedded HTML and more. We’ll demonstrate how to Please provide your credentials
Matt Holder set up a server and client, before finally designing a
has worked in IT layout and scheduling this content.
support for over a The system comprises a server component, which is
decade and has open source, as well as a number of clients for different
always tried to display types. The Windows and Linux clients are both
utilise Linux free and open source, whereas the other platforms are
alongside the paid-for, licenced clients. The server can be self-hosted,
other installed or hosting can be provided by the team themselves.
systems. Before going any further, let’s talk about some of the Login
terminology utilised by the system. Displays is the name
of the device which runs the player software and I Enter your username and password at the login screen.
displays the content. This could be a Windows/Linux
PC, Android device or large-screen TV running Each Region can then display a number of pieces of
QUICK TIP embedded software. Display groups can be used to content within its timeline. These concepts will become
group multiple displays and content can be scheduled clearer as we work our way through this tutorial.
Using PHP
to multiple devices at once. Schedules are then used to
functions,
define when content should appear on Displays. Installing the server
more advanced
Layouts are designed by the end user to define what TheX/bo server utilises a LAMP stack (which refers to
projects can
be carried out.
content should be displayed on specific areas of the the Linux operating system, Apache web server, MySQL
For example, if display. Layouts are then split into Regions and each database server and PHP programming language) as
information is Region contains a playlist. See the diagram (top right), well as other tools to provide messaging between the
held in a dataset which explains the basic concepts of the Xibo digital clients and server. In recent years the entire setup has
about meetings signage system. been wrapped inside Docker containers to make
booked into a installation and updates as simple as possible. The
meeting room, options □ x
server we’ll use to install this on is Ubuntu 20.04, but
then the current Connect Advanced
container systems make the base OS fairly unimportant,
date and time
CMS Address http://localhost
so feel free to work with what you’re most familiar with.
can be used
The software will work equally as well on bare metal
by the CMS to
serve relevant Key 6wWLUqai or in a virtual machine (VM). When used in production,
content to however, a VM wouldn’t necessarily be the most suitable
the player. Local Library /home/matt/snap/xib' Browse choice, especially due to possible issues with video
See https:/' playback using the VM’s drivers.
community. Once the base machine has been installed, open a
Enter the CMS Address, Key, and Local Library Location and click save
xibo.org. terminal, run updates and then install Docker and
uk/t/getting- docker-compose. Commands should be run as root or
started-guide-
prefixed with sudo:
datasets/14149.
I This information is required to configure the client. apt update && apt upgrade
Canonical’s Snap packaging system, which makes the will then be displayed. reworking of
permissions
installation of the client straightforward and updates are
and support
applied automatically. Again, back in the terminal the Conference time For sending
client can be installed by entering: The example that we’ll be walking through are displays
commands
$ snap install xibo-player --channel=stable that could be set up around a conference venue. The viaRS232.
To enable the client to communicate with the server, layout (see diagram above) will contain a title in
there are a couple of steps that need to be followed. Region 1, text in Region 2 which will relate to videos and
been carried out, further options are set to shut down at a certain time of day. General Info:
Date-2021-May-05 19:52:01
from the CMS. To access these options, When the client is loaded, press the I key Version -1.8-R6
Code Version -108
Content Management System - h11p://localhost
navigate to the Display Settings and either and then the information screen will load. Storage Selected - 7home/matt/snap/xibo-player/108/Xibo"
Display Name - Display
Screen Size:-1692x919
change the relevant profile or create a new This provides access to diagnostic ScreenShot Request Interval - 0 minutes
CMS Info:
one, which can be assigned to a particular information such as media that’s being Registered - true
Checked at - 2021-May-05 19.51:55
Display. Within the Display Settings a range downloaded, if there are any invalid files and Required Files - 27
Schedule Info:
of features can be changed, such as the gives the option to exit the player without it Last Update - 2021-May-05 01:03:00
Current Layout -1
Scheduled Layouts •
interval between the client collecting being reloaded automatically. Because Valid Layouts • 1
Invalid Layouts -
information from the server, the size and clients are devices that need to run for large XMR Info:
Host • tcpy/cms.example.org:9505
position of the player window (the default is proportions of the day, should an error occur Last heartbeat • not-a-date-time
Last message - not-a-date-time
full screen) and whether shell commands then the default behaviour is for the player to
can be executed by the player. The latter reload itself automatically. Pressing I when in the client brings up a
■ status screen.
images in Region 3. Region 4 will contain a scrolling the changes that have been made to the layout, set a
ticker of an open-source RSS feed. light background colour or upload a background image
Before creating the example, we should investigate by using the options in the right-hand panel.
the GUI (see below). 1) Layouts are scheduled at a date Before carrying on with the setup of the digital
and time. 2) Layouts are created here. 3) Media is signage, it’s a good idea to take stock of what has been
managed here. 4) Displays are managed here. accomplished. So far, the server/CMS has been
Back in the web browser, login to theX/bo digital installed, the client has been installed and configured to
signage CMS, navigate to the Layouts section and communicate with the server, and the basic Layout has
create a new one. Once a name has been entered, the been set up with the correct number of Regions. In the
defaults should suffice. When created, the Layout editor next step, the Regions will be populated with
will open. The first step is to resize the default Region, information and finally the Layout can be scheduled and
which is created by default. Select the option to edit then viewed on the player.
Regions, which looks like an image of a pencil and
notebook, and use the drag handles to resize the orange Establish your Region
rectangle. Add further Regions to the layout, so that the To start with, the top Region will be populated with a
image in the diagram has been replicated and four title. Add the title into Region 1 by selecting the icon that
Regions exist within. shows four squares, click the plus on the Text widget
Regions can be set to loop, which is useful when they and then select Region 1 in the playlist editor. Select the
contain certain types of content. To do this, select the Edit icon on the text item and enter a name for the
Region and then read the guidance before deciding conference as well as formatting the text. When
whether to enable the loop option or not. Before saving completed, select Save (see screenshot, below right).
When editing Regions, options appear on the right-hand
There are Four
key areas in the
© D localhost/statusdashboard side of the preview. This is an example of the options
CMS' interface [see associated with the text widget.
Dashboard
below For detailsl The next step is to add an RSS feed of Linux news to
Schedule 1 the bottom Region. This is very similar to entering text,
0 but requires the usage of the Ticker widget. This widget
Dayparting
Display
is formatted from the configuration panel in the top
DESIGN
right of the Layout editor. The defaults should suffice on
Campaigns the General tab. On the Configuration tab select the
d Bandwidth Usage (B)
Layouts 2
Feed URL field and add the link to a suitable RSS feed.
1.0
On the Templates tab, select Title Only and finally, on
0.8
Templates
06 the appearance tab, select Marquee Left. When these
Resolutions 04
changes have been made, save the changes.
0.2
□ scheduled at a
date and time to DataSets
-08
-1.0
March
final part of this tutorial because we’re going to
populate the final two Regions with textual information
show on a display. on the left-hand side and a video and image on the
DISPLAYS
0 Display Activity right-hand side. The textual information will relate to
Layouts are Displays A
the video being shown. When the video changes to a
created here.
Display Groups Display Logged In second piece of content, the text should also change at
Display Settings No data available in tabl
the same time.
Media is
managed here. The content that we’ll be adding is a video of Big
Player Versions
Showing 0 to 0 of 0 entries Buck Bunny as well as some information about it. The
Displays are second piece of content will be a photograph of Linus
About Manual
managed here. Torvalds, as well as some information about him and the
the Options panel. Paste the content into this Region Once the layout has been completed, the final stage
and then format appropriately, before saving the Region is to use the Actions option at the top of the screen to
settings on the right-hand side. Add a marquee effect to publish the Layout. This means that the changes will be QUICK TIP
the Region if you want the text to scroll. saved and ready to be displayed. When making further
These previous steps can now essentially be changes to the layout, these can be saved part-way The default
credentials For
repeated. With the Layout design tool, select the same through and then published at a later time. Also,
the server are
Region that contains the video of Big Buck Bunny. From publishing changes can be made on a schedule, which
xibo.admin
the Widget selection tool at the bottom of the screen, can come in very handy.
and password.
select Image and use the grab handle to drag this to The final stage in the process is to schedule the The password
the selected Region. When asked, select Add Files to Layout to the display. To complete this, on the left-hand should be
select the photograph to be uploaded. When a side select Schedule and add a new entry. When the changed after
thumbnail appears in the Upload media window, click pop-up loads add the Layout, select the Display, Layout First login and
Start Upload. Now click Done and you’ll see that in the and select the date and time options for the Display. can be done
Region in question there are now two items: a video and Use the option to save the schedule addition and this so by selecting
an image (you may need to scroll to the right). Select can be seen on the calendar (make sure to select the the avatar in
the top right
the image, click ‘Set a duration’ and set this to 60 before Display in the option at the top of the screen if the
hand corner
saving the Region. calendar appears empty).
and selecting
Now select the adjacent Region and use the grab Now, moving back to the Desktop, open the Xibo Edit Profile.
handle on the Text widget to drag it to the Region. This player and within a couple of minutes the content will be
Region will then contain two text widgets. Make sure you downloaded and displayed on the player.
check that the text widgets appear in the correct order So far we’ve merely scratched the surface of what
and therefore match the order of the content in the this digital signage system is capable of. For some more
other Region. If necessary this can be changed by advanced things to try, look at using datasets to display
When editing
dragging the order. With the final text widget selected, table data (datasets can also be used in a ticker) and Regions, options
set a duration of 60 again and then use the pencil icon the use of PHP functions to display certain parts of the appear on the
on the Region preview to enable Edit mode, where you dataset data, based on the date and time. For further right side of the
Edit Text
General Templates» Effect
Name
atellite-based images of the Earth showing most are no longer operational, including NOAA-16 and
recognise a satellite signal from its shape on the you might like
to see photos
waterfall display and from its pulsing sound.
From the much
Now it’s time to acquire some data from a satellite,
more distant
so make sure you’re on the correct frequency before
geostationary
you expect the satellite to come into range. Although weather
the signal will be strongest at its closest approach, you’ll satellites.
be able to receive a reasonable signal for several Near real-time
minutes before and after that point. You’ll probably also images are
Using a satellite prediction utility means you’ll know when each of the prefer to record signals when it’s daylight at the receiver plentiFul. See,
I three NOAA polar orbiting satellites is due to Fly close to any Web SDR. location, although this isn’t essential because the
satellites are able to acquire images in spectral bands
For example,
www.star.
nesdis.noaa.
at www.websdr.org, which acts as a directory to these other than visible light.
gov/GOES,
online receivers. For each there’s information on the Once you can see and hear the signal, click Start next
which hosts
receiver’s location, a list of the frequency bands covered to Audio recording and, after the signal has been lost, images From
and a link that takes you to that receiver. The ones of click Stop. We got an error message telling us that our the NOAA’s
interest are those that cover the 137MHz satellite band, browser didn’t support downloading of recordings but geostationary
which is in the VHF part of the radio spectrum, but these this wasn't true. Having stopped the recording, click the weather
are the exception rather than the rule since most adjacent download link to grab a copy of the recording. ^satellites.______
concentrate on the amateur radio bands.
You’d probably prefer to use a receiver close to your Decoding signals
own location so you’ll be receiving images of your locale. We’re about to look at how to decode the signals you’ve
If you're based in the UK the closest we found is the one recorded from NOAA satellites, but first a bit more
at http:Z'erc-websdr.esa.int, which is based at the theory. It might seem surprising - but perhaps less so
European Space Research and Technology Centre at when we bear in mind that the current NOAA polar
Noordwijkin in the Netherlands. We only found one in orbiting satellites are the last of a series that first
the US - http:/7websdr2.K3FEF.com:8902 - which is in entered operation in 1979, well before broadcast TV
Milford, Pennsylvania. There are also Web SDRs in migrated to digital - but our satellites of interest
Germany and Russia that cover the 137MHz band. transmit analogue signals. To clarify what we mean by
Your first task is to become familiar with your Web that, like old analogue TV, the image is discrete
SDR of choice (although most share the same user vertically, but each horizontal line is represented by a
interface) and try receiving some satellite signals. The continuously varying signal. In the case of the NOAA
main part of the user interface is a waterfall display that polar orbiting satellites, the signal is encoded in a
shows signals graphically with the frequency plotted format referred to as APT, which stands for Automatic
horizontally and time vertically. The most recent signals Picture Transmission. In this format, the data for each
appear at the bottom of the display and, since the data
scrolls up continuously, you can always see the previous
few seconds of signals. You should also be able to hear » USE A LOCAL RECEIVER
any signals on the selected frequency audibly, although
with some Web SDRs you have to click a button to If using a remotely hosted Web SDR seems like cheating, it’s possible
enable audio. Note that if you’re using Chrome you to use your own hardware to receive satellite signals. You could put
might find you hear no sound, in which case you will together all the kit you need for as little as £10 plus the cost of some
have to enable sound for the website in Settings. bits and pieces to make the antenna. The secret is to use an SDR: a
To receive the NOAA satellites you should select FM software-defined radio, just like the ones that form the basis of the
as the mode and, because these signals have quite a Web SDR sites. Unlike conventional radio receivers, which need a lot
high bandwidth, you should increase the receiver of analogue hardware, an SDR is little more than an analogue-to-
bandwidth to around 40kHz. Do this by clicking “Wider” digital converter that relies on software to provide most of the
repeatedly, but it’s quicker to drag the sides of the functionality. The SDR of choice is a USB dongle called RTL-SDR, that
yellow “filter” icon just below the waterfall display. You’ll you can read about at www.rtl-sdr.com. The hardware design is open
need to know that NOAA-15, NOAA-18 and NOAA-19 so you’ll be able to find lots of sources but do shop around. The
transmit on 137.6200MHz, 137.9125MHz and software you’ll need is also open source.
137.1000MHz, respectively, and some of the Web SDRs, The other thing you’ll require is an antenna and you can build one
albeit not the one in the Netherlands, help by indicating yourself. The RTL-SDR website has a tutorial on receiving NOAA polar
the frequencies for the various satellites just below the orbiting satellites and included here are links to a few antenna
waterfall display. designs. Alternatively, lots of other antenna designs are available.
However, for best results you might need to fine-tune The designs can be as simple as a basic framework made from PVC
the frequency because the received frequencies will electrical conduit, which supports the active elements that are made
differ from the transmitted frequencies due to Doppler from coaxial cable.
»
shift. At any one time it’s likely that none of the three
scan line is an audio tone at 2.4kHz, which is amplitude together with the licence key. However, given its
modulated with an eight-bit (256-level) signal questionable legal status, we’re recommending a
representing the visible brightness. In other words, the different software package which is called noaa-apt. It’s
brighter the point along the scan line, the louder the free and open source, and you can download it from
audible tone. https:Z4ioaa-aptmbernardi.com.ar.
Two such lines are transmitted each second. There You’d work it out eventually for yourself, but since it
are also periodic synchronisation pulses and telemetry took us a while to manage to display an image, we’ll
data. Taken together, this explains why the signal is provide some brief instructions on how to use noaa-apt.
audible and can be recorded as a WAV file (2.4kHz is If you want to try it out before you’ve recorded any
approximately the fourth D above middle C on a piano satellite signals, you can download a sample recording
keyboard) and why it has a pulsing sound. This audible from https:Zz’projectmarkroland.com/weather-
ATTP data is superimposed onto the 137MHz radio satellite-imaging/N18_4827.zip. Use the larger of the
signal by frequency modulation. two WAV files and note that this zip file also has some
The purpose of the decoding software is to translate images that show what you ought to see when you’ve
the data in the APT signal into an image. One of the best decoded the file.
respected tools to do this job is called WXtolMG. It’s
Here, on the
Noordwijkin
referred to as abandonware, which means that its Start decoding
WebSDR, the signal author no longer supports it and apparently has no The software will start up on the Decoding tab and here
from NOAA-15 interest in it. However, it isn’t open source and, while you need to select the audio file you recorded (or
is clearly visible there was a free version, the full version was licenced downloaded) before clicking Decode. The bar at the
in the waterfall
commercially and requires a licence key. bottom will show progress (it won’t take long) and, on
display, on a
frequency close to Today, enthusiasts are attempting to keep the completion, it'll indicate “Decoded”. Note, though, that
137.1000MHz. software alive by making it available for download, this doesn’t necessarily mean that the file contained
This is a WebSDR receiver, located at the European Space Research and Technology Centre in Noordwijk (JO22FF), Netherlands.
valid data, and if it didn’t you’ll only find out in the next
It is operated by the ESTEC Radio Club PI9ESA More information about the WebSDR project can be found on https sites googk com/ site pi9esa/. step. This is because, even if a valid signal has been
Note: you need both Java and JavaScript enabled for this page to work properly. If you don't hear anything, probably Java is disabled or its version is too old (i.e
decoded, no picture is displayed at this point. So, select
Please log in by typing your name or callsign here (it will be savedfor later visits in a cookie): the Processing tab and click Process. The image should
View: O all bands ' J others slow one band <' blind Allow keyboard:
*
U Waterfall: appear almost immediately and, in the case of the
sample recording file, it should be fairly easy to
recognise the Great Lakes and the Florida peninsula.
• I
137350
We'll describe the characteristics of a displayed
image in more detail later, but first you might like to take
Bandwidth: Waterfall view: a look at the information shown in the panel to the left
40.03 kHz a -6dB; 40.49 kHz 2 -60dB | zoom out 11 zoom in
wider CW-wide LSB j USB AM FM
max out max in
of the image. It shows the name of the satellite and
narrower CW-narrow LSB-nrw
Or dnz the passband edges on the frequency scale.
USB-nrw AM-nrw
Or use scroll wheel and dngzmg on waterfail c either the start or end time and date of the recording.
Speed: | slow v<
Size: [medium v These are noaa-apt's best guesses, based on the file’s
View: waterfall v
time stamp and its filename. For example, the name of a
file we downloaded from the Dutch Web SDR was
websdr_recording_2020-10-31T16_31_24Z_137109.
» THE AVHRR SENSOR 0kHz.wav that shows how, at least in this case, the
necessary data can be deduced. This information is
The NOAA polar orbiting satellites carry an on-board instrument used to calculate the orbit and so add coastlines and
called the Advanced Very High Resolution Radiometer (AVHRR). You national borders to the image, this being an option you
can think of this as a camera, although it’s substantially different from can select a bit lower down in the panel.
regular cameras. In particular, the sensor isn’t a two-dimensional We found that noaa-apt will often guess wrongly. If
array that captures a 2D scene in a single instant. Instead, because this happens you can alter the information manually. If
the satellite is continually moving, it’s necessary only to capture a row you change anything anywhere in this panel, though, the
of pixels at right angles to the flight path. These rows are acquired image won’t change until you click Process again. You’ll
continually and, because the satellite will have moved between any probably notice that the map overlay won’t correspond
two adjacent rows, they'll represent different strips of the Earth’s to the recorded data with the sample audio file, but it
surface. Stacking these strips, therefore, creates a two-dimensional should work correctly with data you record yourself
image. The 2D image is infinite in length, even though the image that subject, perhaps, to altering the identity of the satellite.
can be captured from a receiver at any particular location represents
a limited area due to the range of the radio signal.
Despite it only being necessary to capture a strip of pixels, the
AVHR doesn’t have a sensor containing a row of 2,600 elements, this
being the effective horizontal resolution. More recent sensors do
operate this way, and are referred to as push broom sensors, but the
AVHR, being an older design, utilises a whisk broom sensor. In a
reference to the way a whisk broom or “witch’s broom” is used, the
device scans mechanically back and forth at right angles to the
direction of movement. Using a mirror, it directs the light from
successive points along the horizontal strip to a single sensor for
each spectral band. noaa-apt output of data from the Noordwijkin Web SDR with coastlines
blue. Although the end result is most definitely not satellites also
transmit a so-
realistic, is does have the potential to produce all
called HRPT
possible colours. With just two spectral bands, though,
(High Resolution
things are different.
Picture
You could choose two primary colours so, for Transmission]
By combining images in two different spectral bands a false colour example, using red and blue would give you those signal at
I image can be generated, making some features more recognisable. colours plus purples, using red and green would give
you those colours plus yellows and oranges, and using
a higher
Frequency oF
Finally, assuming the end result is something you’re green and blue will give you those colours plus shades around 1.7GHz.
satisfied with, don’t forget to save the image to file of turquoise or cyan. None of these options enables The signal
which you can do in the Save tab. white to be represented so you might prefer to go for has a higher
resolution and
one primary colour together with the complementary
dynamic range,
Image processing secondary colour. Those possible combinations are red
and all Five
Although noaa-apt offers a degree of contrast and cyan, green and magenta, or blue and yellow.
spectral bands
enhancement, depending on the lighting at the time the We’re not going to give specific instructions on how are transmitted
satellite acquired its image, and on the strength of the to combine the images in Gimp, or any other package, at all times.
signal when you received it, the image might not be but here’s the gist of it. First, you need to cut out the This signal is
perfect. In that case you could try improving it in photo two side-by-side images from the composite photo much harder to
editing software. Improving the brightness and contrast generated by noaa-apt and save them as separate files. receive, though.
is easy, and can make a significant difference. However, Now, convert those files from monochrome to RGB
the Curves feature that’s available in many image images and colourise them in your selected colours (in
editing packages can make an even more dramatic Gimp you’d do that by adding a separate layer filled with
difference very easily. If you’ve never used this feature your selected colour as the top layer and use Darken
before it would be worthwhile reading up on it. only as the mode). Finally, load the two colourised Each of NOAA’s
One thing you’ll notice the first time you decode an images as different layers and adjust the transparency geostationary
NOAA polar orbiting satellite image is that you don’t end of the top layer. satellites produce
a true colour
up with one map but two, which are displayed side by Initially you should try a transparency of 50 per cent,
image of almost
side. Both are monochrome, but they’re not identical, but if one of the two colours appears to dominate then half the planet, but
even though they both represent the same area of the you should increase or decrease the transparency of the they’re much more
Earth’s surface. This is because the satellites are able to top layer accordingly. E3 difficult to receive.
acquire images in five spectral bands covering the red/
green portion of the visible spectral, near infrared,
mid-infrared, and two wavelengths of thermal infrared.
However, the bandwidth available at 137MHz is
insufficient to transmit them all, so only two channels
are transmitted at any one time, the selection being
made by ground controllers. Normally, during daylight
hours, one of the photos will be the visible light image.
Because only one visible light band is captured - and
you probably won’t get this at night - it isn’t possible to
generate a true full colour image. However, noaa-apt
does offer a false colour option on the Processing tab
that you can fine-tune using the three threshold sliders.
In reality, it’s not false colour but artificially added colour
that aims to approximate actual colours: blue for water,
white for clouds and green for vegetation.
It’s not clear how this works and, since it’s a fairly
recent addition, information isn’t currently provided. All
we can say is that it uses a form of image analysis to
attempt to identify clouds or the type of ground cover.
Apparently it’s not as good as the false colouring feature
that was provided by WXtolMG so there might be an
opportunity to contribute to this open source project by
helping to enhance this feature.
Another possible way to create a false colour effect -
and here we genuinely do mean false since the colours
will generally bear no resemblance to actual colours - is 15 Nov 2020 15:30Z NOAA/NESDIS/STAR GOES-East GEOCOLOR
SCRIBUS
Credit: www.scribus.net
ord processors like LibreOffice Writer can do a development version (1.5.7) is on the cusp of replacing
Script
* [/hocne/nkk/Documents/2021/Linux Formit/LXF280.tut_scribu$/familyhhtofynews-2021.sla
Endows fjelp
]
* U
ala *
0 First steps
o e x ■ n
kivninllifii
QStimMAdZB NwnU 5 ♦ 0 NixmjlVHion
IT 40.00 pt
Farpily Hist News New Document, New from Template, Open Existing
;T Fixed Linccj). th. photo*, intocviow*. nwwi AoBuit2021 • Imuo
Texin
Colour A Fffrct-.
LVldth:
1179-300 mm Vertical Alignment
Columns:
drtaib gleaned bom J
image
Locking
Template’ tab where you’ll see a selection of templates,
117,745 mm wammaVw of Arrey *
Edit texts
ltem Properties Navigation and view controls
for a guide to
Use the Story Editor to edit and style your text without having to worry characteristics unique to that specific style. You could,
I about the layout, too. for example, define a default paragraph style, then use it
using it.
to generate additional paragraph styles such as the first File> Preferences>External Tools, which is set to GIMP
QUICK TIP article in a paragraph, or a crosshead - a sub-heading by default), and Embed Image. Selecting this will
Save time within the text itself. Anything specifically defined within convert the image from a link to an actual object within
recreating the new style overrides the style it’s based on. the file. You’d do this if you wanted to share the
frequently document with someone else and not have to worry
used elements: Working with images about including all the images as separate files.
group, then
Our newsletter template has space for a single image.
choose
To fill this with a new image, right-click it and choose Understanding Frames
Windows>
Content>Get image (or press Ctrl+I). The image will be So far we’ve respected the newsletter’s layout and
Scrapbook
to open the
placed full-size within the picture frame, so will require focused on populating it with content. You’ll notice that
Scrapbook adjusting. Right-click the image and expand the Image text and images reside in frames, and that these can be
window. Drag sub-menu where you’ll be able to adjust the frame to moved, resized, rotated and more - press F2 to open
your element on the image or - more likely - resize the image to fit the the Frame Properties window to access these options.
to here to store frame (choose Adjust Image to Frame). This will resize With images, we’ve already seen how we can resize
it securely. Drag the image to fit the frame, while respecting its aspect them to fit inside their frames, leaving some white space
the element out ratio, so there will likely be space below or to the side of beneath or to the side. Complete the job by right
of the window
the image depending on its aspect ratio. clicking the image again, but this time choosing Imago
to create a
Other options you’ll see include Image Effects (add Adjust Frame to Image. You’ll see the frame now fit
copy to reuse.
up to ten different effects, then tweak each one using around the image, leaving white space beneath it.
the preview to see the effect they’ll have), Edit Image The next step is to move the caption frame so it sits
(opens the image in the image editor you specify under underneath the image again. By default, the template
- I Arial
Reguloi
MB
pr from the refresh my memory when I talk crowds, and in ail ooctc of
mm jamveo laic over my travois with Mina attire some or mom wore just
Toq- 0 000 mm inaar me 3 May bitfne --ten Munich at hke the peasants at home or
Soiwc 8:36 HM.. on let Moy. arriving those 1 caw comng tnrougn
Bottom- 0.000 mm
^htonony at Vienna cany next morning: bronco and Germany wim
left: 0.000 mm -? the exact snouw nave arrwec at 6:46, short pcKGis. ano round hats,
jc Dracuo. but train was on hour late and homo made trouoers: but
0.000 mm •pe or tw Buaa-Pesm seems a otncrc were very pKturesguo
TabuUtors Jxnparewth wonaemx place from me l read that every known
“ourvey gnmpso wfMcn I got of It from superstition m the wore is
jhat btemtz. me tram and me iiwe i coma ga re rod nto tne norsosnoe 01
Sedoy Count walk through me streets l the carpar ens. as r it were
*re«. known
J feared id 90 very far tom the the centre of some son of
!hece come statin, as we nao arrived tate imaginative wmrpod so my
Jymay and would start as near the stay may be very interesting
y wtwn I talk cur reel dm
* mi pvswblv (Muni, I must *mk ilw Count ell
Cx ■♦■H ■ ji Mina r was on mo dark side of about them>
import...
Delete. read ttiui every krr—,
Ji A
jperstlion nmo
rt heading here
Copy-
Tsert he Move
altered into tho t
mo Carpathians, a N<W1M'
X. Y.Z
«i< K- 4- 3
*■1 -H L"
4 -4| ■&jr«ground «n. h- 4-
has locked all its frames so they can’t be accidentally Scrlbus 1.5.7 - [Newsletter 1«) - □
file fdit Item Insert Page Table Extras yiew Script vyindows tjelp ;Q|C
the arrow keys to nudge it around the screen. when opening these, the first
image in the list is displayed,
T orem ips urn dolor sit amt
J—iconsectetuer adipiscing
Now’s the perfect time to discover how you can and you can cycle through elit. Ut a sapien. Aliquam ali-
quet purus molest ie dolor. In
them using the arrow keys.
group frames together, so they act as a single object. tis can quickly become teger quis eros ut erat posue
dictum. Curabitur dignissim.
esome, so it's time to stall
Doing so would enable you to move the image and its iloring the nomacs user Integer orci. Fusee vulputate
lacus at ipsum. Quisque in
nterface using its customisable
caption as one: just hold the Shift key as you click each Image Effects... Ctrl+E
libero nec mi laoreet volutpai
.Aliquam eros pede, scelerisq1
Locking Edit Image...
frame you’d like to group and you’ll see the selection Send to Embed Image
quis, tristique cursus, placer,
convallis, velit. Nam condi-
You can customise nomacs' panels to suit Level Update Image
box encompasses all selected frames. You could drag all on the left, with two in tabs
Edit
undue pane — i •It
dictum aliquam, arcu risus
dapibus diam, nec sollicitudii
right-click any of the images
to convert them into a single object (you can undo this Software-Centre)-,-but-you'F© —
tied to an older version - for
Yr
J I
jal
Properties
Content Properties
F2
F3
quam erat quis ligula. Aeneai
massa nulla, volutpat eu, ac-
from the same sub-menu, choosing Ungroup instead). example, Ubuntu 20.04 users Microsoft Office document
ksuch as embedded graphics in j You can view
cumsan et, fringilla eget, odi<
would be stuck with version
Next, drag both the headline and the body text 3.12. A better bet is to install it : jWord or PowerPoint) too. a single image
or load in a
throuah flathub - assumino vou ' To select vour first imaae or '
frames beneath so they sit underneath your image Image Frame selected: Size = 117.889 mm x 70.002 mm 125.00% C *=< 14- 4- 2 ♦ of4«>->| ■TemplateLaye ♦ X: 79240 Y: 56.649 100%
(select both, then unlock them and finally move them Scribus makes it easy to fit imported images into an image frame. It’s also possible to embed the
into position). You now have space left over beneath the
text, so select the body text frame to click and drag the
I image directly into the document.
bottom of the frame down to fill the space. You’ll end up Once you’ve started to master page design, you’ll
with room with more text to fill too. want to incorporate those layouts in your own custom QUICKTIP
templates. The box (below) reveals how to build a Want to add
Add more pages template using a series of master pages, which are used page numbers
Once you’ve filled your first page, move on to the next. to pre-populate pages with non-editable content. to your
Each template can support multiple page layouts, and document?
Create a text
our newsletter is no exception. Choose Page>lnsert. You Share your creation
Frame in the
can insert one or more pages after the current page and Your work is complete, and you're ready to print a
usual way, then
choose different master pages for both left and right physical copy or export it as a PDF to share digitally. The
choose lnsert>
facing pages. For the purposes of producing a four-page best way to do this is via File>Print Preview or Character>Page
newsletter, insert three pages, choosing InnerPageLeft File>Output Preview (for PDFs). A Preflight Verifier Number or
and InnerPageRight as your page templates. Click OK. window will pop up listing all known errors - including press Ctrl+Shift
Three new pages will be created using the layouts those frames where there’s too much text to fit. Click an +AI t+P. The
you specified, ready for you to populate them with item to jump to it in the document, check over the inserted
content. This is all very straightforward, but only if problem and correct it with some editing if necessary, page number
you’re happy to work within the confines of the then click Check again. will update
automatically
newsletter template itself. In reality, you’ll want to make Alternatively, click Ignore Errors to see how the
if the page is
changes to this layout following the frame tweaks we’ve document will look - you’ll see various additional
moved around.
discussed, or look to make bigger changes by designing options depending on whether you’re printing or
pages yourself - the walkthrough (opposite) reveals exporting to PDF - and finally click Print or Export...
how to create text and image frames from scratch. to complete the job. E9
» BUILD A TEMPLATE
Armed with what you’ve learned in this page) to discover how to populate this Once you’ve got your pages and
tutorial, you can now create your own first cover page with your own design master pages in place, choose File>Save
templates. Before you begin, choose using a combination of image and text as Template, give it a suitable name and
File>Preferences>Paths to specify frames. You can then repeat the process optionally tick More Details to provide
where you’d like to store your templates. for the inside pages - remember to more information about the template.
Once done, click OK and create a new tweak the design for left and right pages.
LXF2a • lArtOmw HMtef M
select Facing Pages, choose your basic name, verify the right type (left or right) 5^’^ © not d
A b*> <*<><• *
attributes (size and orientation) and use is selected and click OK. Master pages 2-
from running to the edge of the page pages with previously created content
pwMtht tW
ir
tewvq tot ©93*
bfjwtod
Hr
(use one of the Preset Layouts such as when inserting new pages. Just select the Ox*
manc t
Gutenberg or Magazine if you’re not chosen master page from the Insert Page content n
HwcirSyefwoten#
moitoe pogeiceatC)*
sure). Choose 3 or 4 for your pages, dialog and Scribus will do the rest. Note Ton*r4Vo
leaving first page set to Right Page to that content added to master pages can’t
accommodate a cover. Click OK. be edited or removed, so use them for
You’ll be presented with a blank consistent elements, such as a magazine You can record details about your new template -
canvas. Follow the walkthrough (facing title or page numbering. I perfect if you plan to share it with others.
GOOGLE /
Google's free photo storage is a thing of
the past. Jonni Bidwell has some free
software to get your albums in order.
hen invitations to Google’s Later, Google would add free, unlimited There are all manner of other free
four
y J
lit
r L
Ik ■■■
^3 >
LV
J
1
El E
•j ••
We’re all for self-hosted solutions here and it’ll come as app, it's easy to ensure new images from your phone are
no surprise that we’ll be looking at Nextcloud over the automatically added into the mix.
page. It’s easy to set up on your desktop or home server, Virtual private servers (VPSes) with 20GB of storage
and it has superb photo management facilities. If you can be rented for around £5/month. You can even rent a
like, and are prepared to do battle with your router's Raspberry Pi from Mythic Beasts at this price. This
port forwarding configuration, you can make this offers excellent value, since besides hosting your
remotely accessible and enjoy all the utility of Google photos, these offerings give you root access, enabling
Photos without worrying about quotas. Or at least if you you to burden the machine with whatever duties your Scan For Free Magazines
run out of space you can always add more. imagination allows (subject to resource constraints).
Self-hosting comes with a pretty strong caveat We’ve looked at setting up VPSes before, and we’ll cover
though: you're responsible for your data. So you should it again soon. But for now let's get on with the show.
» KEEPING IT SIMPLE
Some people, preferring to avoid looking for a bloat-free back-up solution stored regularly. So you might also
unnecessary thumbnailing, cataloguing, to SSH your photos somewhere safe, consider SyncThing, which will happily
configuring and hosting complications then Duplicity is worth a closer look. It mirror your photo, video and whatever
(and PHP applications), choose to works incrementally, so once the first else files wherever you like. Or you could
manage their photos as regular files. backup is done, only new data is stored, be Puritan hacker about it and have your
Some people feel the same way about meaning subsequent runs are much Devuan box run a Cron job that rsyncs
their music collections, and keep their quicker. It can optionally encrypt data as your local photo store to a secure server
OGGs and FLACs in directory hierarchies well for added privacy (and we’ll look at at an undisclosed location.
according to tempo, chronology, genre this with Nextcloud too). These things can be brought down by
or whatever else suits their purpose. If Duplicity stores backups as archives a stray 7' though, so always check your
this sounds like you and already have though, so you don’t have the immediate backups are doing what they’re meant to
your photos as you like them, but are access to files as you would if they were be through manual inspection.
»
Install Nextcloud
Discover how you can tap into the power of Docker Compose to
get Nextcloud up and running in a jiffy just like the professionals.
r i henever our perennial “Escape Google (et doing it on the Pi in LXF272’s smart home office feature).
0 Recent
geodata that have been added via Google photos, as | Photos from 1970 247
well as EXIF data from the original images stripped Il Photos from 2003 28
Extract the archive, taking care to ensure you have ■ Drifted files
| Photos from 200r> 97
8 V GU of 20 GU med
sufficient space. Note that if it’s a huge file and you’re Pliotos from 2006 133
O Swings
delete these once they’re uploaded. password, and click the tick. You’ll be prompted to
Alternatively, you can download images in batches (of confirm with the admin password. Then log out of the
up to 500) or by album from Google Photos without admin account and log back in under your newly created
using the Takeout service. This method seems to retain persona, or repeat this process if you’re planning to
the original images’ metadata. If you click the More Info allow other users onto your instance.
button at step two below, you’ll find the option to transfer
photos to Flickr or Onedrive. There are some other Time-saving tips
commercial alternatives listed in the box overleaf. But Nextcloud’s Photos tool is included in a default
why trade one proprietary service for another when our installation and doesn’t require any further configuration.
Nextcloud container is eager to contain some photos? Any images you upload to your Nextcloud instance will
Before we do that though, it’s good practice to avoid automatically be catalogued by date. A Photos folder
using the administrator account for your data. Instead, containing some sample images is included in every
create a user account by logging in and finding the Users Nextcloud user’s account, but you may as well create a
option from the menu in the top-right. Click the New new folder to rehouse the images you liberated from
user in the top-left, fill in at least a username and Google (or wherever else you’re uploading from). Go to
Show more products Next step Q Export every 2 months for 1 year
Create new export
6 exports
ychee is a much simpler program than again. Not only that, but we’ll adapt the Docker
© A https://lycheeorg.github.io
- LETSENCRYPT_EMAIL=contact@mymagazine. Settings
- DB_CONNECTION=mysql 2. Users
- DB_HOST=db S U2F
Enable maps for public albums (provided by OpenStreetMap): •
< Sharing
As before, if the hostname does really resolve to your
Show Logs
Docker host, then certificates will be automatically > Diagnostics Provider of OpenStreetMap tiles. Wikimedia —
QGIS
Credit: https://qgis.org
ack in 1962, archaeologists in the Czech Activities Q QGisDesktop” ?•) Jui 00:% • en, - A <
O
•Yorkshire Dales-QGIS
8 .?
actings
i K
glugant
0 ❖ Z
vector
.- ,
fiaster
Z /a
fiatabase ^eb
I
tjeih
• Z
Projes$«ng flelp
Layers
Mike Bedford Mundi. Created around 1300, it’s the largest surviving * a
•
•. t
V y OpenTopoMap
is a big fan of medieval map of the world. The UK’s Ordnance Survey • v OpenStreetMap
QGIS. However, was set up in 1791 to help address the perceived risk
he admits to still arising from the Jacobite rising, and of invasion by
loving good old- France, and it went on to become one of the world’s
fashioned paper foremost national mapping agencies. And 1999 saw From street maps through topographic maps to aerial imagery, any
OS maps while
he's walking on
California-based ESRI release its ArcGIS graphical
information system, which would become the world’s
number of options are available as base maps.
I
the hills. most used GIS (geographic information system). ESRI’s well-respected ArcGIS isn't cheap at £1,192
These few notable dates in the history of cartography per year, including VAT, for professional use. This
illustrate 27,000 years of change and it’s clear that the reduces to £139 for non-commercial use, but that’s still
rate of change has accelerated significantly in recent a lot unless you have a fairly serious application. Our
years. This isn’t surprising since digital technology has subject here, therefore, is the free open source QGIS
had the same effect on so many other areas, but it’s which is widely used professionally and is considered to
QUICK TIP been suggested that a GIS is so different to its be on par with many professional GIS offerings.
predecessors that it’s a totally new entity. Professionals We're going to provide a hands-on introduction to
When you work point to support of multiple layers and an ability to carry using QGIS but we’re certainly not going to be looking at
on a project,
out analyses of geographically based data as just some all its features, in fact we won’t come close. After all, if
you’ll end up
of the things you can do with a GIS but not with an you can think of something you believe you ought to be
with several
files including,
ordinary map. And if you’re wondering where Google able to do with mapping data, it’s a fair bet that QGIS
For example,
Maps fits in, while we’re not going to get embroiled in can do it, either natively or via one of its many plug-ins.
Files associated the debate over whether or not it’s a GIS, we would However, we trust that our tentative first steps will be
with the layers. agree with the sentiment that a fully blown GIS is like enough to excite you about the possibilities of QGIS and
For this reason, Google Maps on steroids. start you off on your own voyage of discovery.
it’s good
practice to use Project £dit yiew py»r Jettings Plugins Vector Raster fieubese
YoriuhWl D*l«l-QGIS
by zooming, type choose Singleband pseudocolor instead of it can process elevation data in so many ways. But this
panning, Singleband gray, and select one of the options for Color is far from the limit of its data-handling capabilities.
rotating, tilting ramp. You might not find that any of the Color ramps are QGIS can work with any type off data so long as it’s
and so on.
to your liking, and none correspond to the common georeferenced. So, for example, this could enable you to
colouring of altitudes on topographic maps, but you’ll see the variation in rainfall or hours of sunshine across a
notice that you can edit each of the colours. region, or it could provide a means of visualising the
Moving away from just changing colours, Hillshade is correspondence between the geological classification of
another interesting option for Render type. It'll revert rocks and surface features.
the colours to greyscales in the process, but there's a A recent project involved showing how QGIS can
solution to that. As before, use the Layer properties to operate with other types of data, and via a brief return
select your preferred colour scheme. Next, with the to elevation data, how it can carry out calculations on
elevation layer selected, select Analysis>Hillshade... that data. The exercise involved using rainfall and
from the Raster menu, before accepting all the defaults elevation data to simulate areas at risk from flooding.
in the dialog and clicking Run. Unlike last time, the latter The simulation software could input raw elevation data,
won’t be converted to a hill-shaded version, but a new so no need for QGIS there, except for the fact that
hill-shaded layer will be created. elevation data for the area of interest was incomplete. In
As always, the new layer will be at the top of the list, particular, there were holes in the preferred Im
so drag the coloured elevation layer to the top in the resolution data, but 2m data was available for the area.
Layers panel and, of course, it will obscure the QGIS was used, therefore, to compile a file of
hill-shaded layer. However, adjusting the transparency of elevation data using lm resolution where present, and
the pseudo colour layer will give the best of both worlds. filling the gaps with 2m data where it wasn’t. This was
This option is available in Layer Properties. achieved by loading both sets of elevation data as
And as a final way of processing elevation data, a few separate layers and then using QGIS’ raster calculator
words on contours. Depending on your choice of base (Raster>Raster Calculator) to combine them. This was
map, you might already be able to see contours. done using the statement ("lm_dtm@l" = 0) * "2m_
However, if you're using a base map without contours, dtm@l" + ("lm_dtm@l" != 0) * "2m_dtm@l" having
you can generate these from elevation data at first ensured that the no data value in the lm elevation
As this example of Raster>Extraction>Contours.... data file is 0. It generates a new raster layer with values
water depth during
defined by the expression, and it’s fairly clear how it
a flood illustrates,
how geo-tagged
Beyond conventional maps achieves the desired effect.
data can be used So we’ve seen how QGIS handles data that’s basically This is only presented as an aside, but the ability to
in QGIS. an image, or in other words a map, and we’ve seen that carry out any arithmetic operation on raster data is a
powerful tool. QGIS then came into play again when the
simulation software had crunched the input data and
created a geo-referenced output file of water depths. By
importing this to QGIS, and viewing it, partially
transparent, over a base map, at-risk areas could be
clearly identified.
or Polygon. Now start adding fields, and there can be as although if you took them on a camera they might not
many as you want. In our example, we’re creating a layer be. Bizarrely, given that QGIS doesn’t seem to be short QUICK TIP
that shows places at which particular minerals were on features, we could find no way to import With some
found. Our first field, therefore, is the type of mineral, so non-geotagged photos. That’s not a show-stopper, actions
we give it the name “type”, and specify that the field is though - it just means you’ve got to add the geotags that create
defined as text. Having filled in the first field, click Add to separately. There are plenty of standalone applications new layers,
Fields List and you’ll see it appear in the list below. We and web-based utilities to do that (for example, those layers will
be temporary
also added a second field, namely the date on which the www.tool.geoimgr.com), although many limit how many
scratch layers.
mineral was found, in just the same way. When you’ve photos you can process a day without paying a fee.
The method we
defined all the necessary fields, just click OK and you’ll So, with a folder full of geotagged photos at the
described For
see that the layer appears in the Layers panel, although ready, here’s how to import them into a QGIS project. In creating a layer
nothing will appear on the map, because there are no the Processing menu, select Toolbox>Vector with photos
points defined yet. creation>lmport geotagged photos. Against Input folder is one such
To add points, make sure the new layer is selected select the folder containing the photos you want to add case. These
and click the Toggle Editing icon (yellow pencil) in the and click Run. A new layer will appear in the Layers layers will be
Data Source Manager toolbar. Once you’re in editing panel and you’ll notice some small markers appear on lost when you
mode, click the Add Point Feature icon (three green the map, at their correct locations, just like the ones we close a project
(although QGIS
dots and a crosshair), and the cursor will change to a added previously.
will warn you),
crosshair. Click it on the map at the place of interest and However much you zoom in, though, they won't
but you can
the Feature Attribute dialog will appear. You might not appear as photos unless you make some changes. Bring
prevent this by
want to bother with the “id”, but fill in the various other up the Layer Styling dialog and ensure the Symbology right-clicking
fields and click OK. A coloured dot will appear on the tab is selected. Single Symbol will be shown and below the layer and
map. Now click the Toggle Editing toolbar again to turn that the marker type will be shown (expand it if not selecting Make
off editing and see how a user can interrogate that already expanded to show Simple Marker). Click Simple Permanent.
point. Click the Identify Features icon (the “i” on a blue marker and then, against Symbol Layer Type, choose
circle with an arrow cursor) in the Project toolbar. Click Raster Image Marker instead of Simple Marker. Lower
a coloured dot and a window will appear providing data down there’s an unnamed box where you can define a
on all the fields defined for the layer. particular raster image, but instead we want it to pick up
You might find it surprising that some of that data the image at that point. So, click the icon at the right,
doesn't appear alongside the point without interrogating which looks like a filing cabinet and a couple of arrows,
it, but since there’s no limit to how many fields you can to allow the Data Defined Override option to be selected,
assign, it’s fairly obvious why that doesn’t happen by and against "Field type: string”, choose “Photo (string)”.
default. However, you can choose to add labels for all Photos will replace the blobs, but they will be very small
points on a layer, which you'll do by clicking the Layer so specify a new size against Width.
Labelling Options icon (“abc” on a yellow arrow) on the QGIS is a very powerful tool and what we’ve
Data Source Manager toolbar. In the Layer Styling presented here is only a taster to what it can achieve.
dialog, ensure the Labels tab is selected (the “abc” on a Experimentation is one of the best ways of learning, so
yellow arrow again), choose Single labels in the top box what are you waiting for? E3
and choose the field you want the point to be labelled
with against Value. You’ll see the point labelled on the
map. You might want to fine-tune the options under » ANALYSIS OPPORTUNITIES
“Placement”. Also, if the size, shape and colour of the
point aren’t to your liking, this is something else you can Although the ability to analyse geographical data is considered a key
adjust in the Layer Styling dialog, this time on the feature of a GIS, we've largely ignored this feature. As you grow in
Symbology tab (the paintbrush). your confidence with QGIS, though, depending on your application
QGIS also enables you to show photos at the you might want to delve into analysis, and here the sky’s the limit.
locationqthey were taken, but only if they’re geolocated. For a start, there’s lots that can be done with elevation data. Mobile
So, if they were taken on a phone you’ll be okay, phone companies use GIS software to visualise the coverage that
would be achievable from base stations at given positions. This sort of
exercise can be used to decide where to locate base stations and
forms the basis of published coverage maps. But it goes much
beyond that, a fact that should be obvious when we think about the
Shapefile layers that we created and populated with points. There can
be any number of such layers, and the points in each of those layers
are defined by their geographical location plus data in several fields.
We can, therefore, start to think about a QGIS project as a
geotagged database and the potential starts to become clear. A
common approach is to carry out some sort of analysis and create a
new layer from the results that can be viewed on the base map. The
QGIS documentation shows an example of an exercise that involved
analysing the cause of a cholera outbreak in London in 1854. And
while that exercised used fairly simple analytical tools, QGIS can also
As an alternative to points, places of interest can be shown on a map be interrogated using SQL queries.
I using geo-tagged photos.
torn
DOSBOX
How to easily emulate
486 PCs and run DOS
Relive the halcyon 32-bit years of PC computing, play your favourite games
and look back at OSes of yore with the ever-dependable Les Pounder!
his author first got their first PC back in 1994: a want to run real hardware with a subtle 21st century
Writing code
The retro PC era spans decades, and with that we’ve a
fantastic choice of languages and applications with
which to write code. In this instance, we’re going to
focus on BASIC, in particular Quick BASIC (QBasic') that
was bundled with MS-DOS. QBasic is a cutdown IDE
and it can be found easily online. We’re lucky enough to
own MS-DOS 6.22 floppy disks and a hard drive with
QBasic installed.
Download a copy of QBasic and extract the contents
of the archive to a directory in your home directory.
Remember the location of the extracted files as we’ll
need that exact location for DOSBox. Launch DOSBox
from the terminal. In the DOS prompt we shall use a
command to mount the location of our QBasic
variable, “counter” and that it’ll store an integer PRINT "The circumference is"; C
(numeric) value. Then we clear the screen of any END QUICK TIP
existing data. Save the code as CIRCUMF.BAS (ALT, F, A) to your C: MS-DOS is not
DIM counter AS INTEGER drive. Then press F5 to run the code. Type in a radius case sensitive,
CLS (we chose 10) and the code will print the answer. We can unlike Linux.
We start the for loop, updating the value stored in the also make an EXE executable file from the Run menu. So QBASIC and
counter variable each time the loop iterates. It starts at This will launch our code outside of QBasic. qbasic are one
to build their own games and programs using this powerful tool. For a short introduction for new users type: INTRO
For supported shell commands type: HELP
The QB64 user interface looks just like QBasic and it even works in
To adjust the emulated CPU speed, use and
the same manner. We tested our circumference project in QB64 and To activate the keymapper
were amazed that every line we typed was checked for errors as we For more information read the README file in the DOSBox directory.
typed! This is great for learning and really helps the user to see where HAUE FUN?
The DOSBox Team http://www.dosbox.com
their code went wrong, before they run it.
Z:\>SET BLASTER=AZZ0 I? DI H5 T6
QB64 is a free download from www.qb64.org/portal and it’s well
Z:\>MOUNT C /home/les/Downloads/QB45
worth investing an afternoon with this editor and the great wiki at Drive C is mounted as local directory /home/les/Downloads/QB45/
www.qb64.org/wiki/Main_Page. This covers all aspects of the Z:\>
application and explains the BASIC language syntax and structure
using a series of examples. In DOSBox we can mount a directory or drive to a specific drive letter.
I It can link out Linux host machine to DOS - handy for sharing files.
CREDIT: LucasArts
Day of the Tentacle
was a point-and-
click adventure. It
was released on
Floppy disk and a
‘talkie’ CD-ROM
with specially
recorded speech.
QUICK TIP
Windows 3.1 just
a little too retro
For you? You can
take Windows
95 For a spin in
your browser.
See www.pcjs.
org/blog/2015/
09/21.
Windows 95
had a massive
marketing
campaign,
and saw
users queuing
overnight to get
their hands on
an OS. Wowsers!
powerful hardware to its limits are being produced by The retro PC community is a strong and passionate
artists who favour the keyboard and the mouse as their place. We just have to look at Reddit’s retrobattlestations
tools of expression. subreddit to see that the 386/486 and early Pentium-era
We would think that with newer, more powerful machines are cherished by their owners. With new
hardware that the retro PC scene would be dead and community-designed and produced hardware being
buried. Oh how wrong we were. The price of 486-era created to enhance the experience for all, the future of
machines online can vary from bargains which require a retro PCs is bright and it lives on in the continued
little work to new old stock machines that are perfect success of the demoscene and the many YouTubers
specimens. The sweet spot of the 486 era was a 486 such as 8bit Guy, LGR, RMC and NostalgiaNerd who
DX2 66Mhz with 8MB of RAM and prices for those have created vast amount of content devoted to showing
machines vary wildly. Research and patience will yield off the best of this era.
the best price. Don’t just jump into the first machine Whether you just want to dabble with some retro
that you find. games, or you have a need for real antique hardware,
this era of PCs is an exciting and challenging time where
standards were created and legacies created. E3
So you have a retro machine - what do you do now?
The first thing to do is check that it’s safe for use. Are Program Manager
there any leaking capacitors, dodgy wires? Check File Options Window Help
everything before applying the power. If the machine
boots up to a DOS prompt or Windows desktop then we
can consider the machine good.
There's one thing to address and that’s hard drives. A
period perfect drive is now around 20 to 30 years old
and it will fail at some point. Fear not as the community Windows.
has your back, in the form of an IDE to Compact Flash This product is licensed to:
adapter that can be purchased for around £5. We use @biglesp
6r3665
one of these inside an Amiga 600 along with a 2GB card
which holds Workbench and our games. Your serial number label is on the inside back
cover of Getting Started with Microsoft Windows.
Using adapters and drive enclosures you can clone
your original hard drive to a CF card and replace the 386 Enhanced Mode
drive with a smaller, quieter and more reliable option. Memory: 113,352 KB Free
Versions exist both for internal and external use, along System Resources: 86% Free
QEMU
Credit: www.qemu.org
their PC magazines by
what was on the cover disc,
something that had started
OUR back in their Amiga days.
EXPERT One month, they chose a
2
Choose how you would like to install the operating system Virtual Machine or click the icon of a monitor with a star.
Local install media (ISO image or CDROM)
In the first screen Create a New Virtual Machine, select
Network Install (HTTP, HTTPS, or FTP)
Import Existing Hard Disk Image and click Forward. In
O Import existing disk image the next screen navigate to the location of the extracted
Manual install qcow2 file by clicking Browse, and then Browse Local.
Once you’ve selected the volume select Choose Volume
and then type in “Generic OS” under Choose the
operating system. Click Forward. Set the RAM to 64MB
and the number of CPUs to one. This is more than
enough for Debian 2.0. Click Forward and in the next
When creating a new VM we can insert an ISO image or CD/DVD ROM. screen name the machine “Debian2” and click Finish to
I We can also use a qcow2 or img disk image For a ready-made system. set the configuration and start the machine.
» OLD PC HARDWARE
Emulating old PC hardware with QEMU collector, it often needs lots of work to Capacitors may need replacing, and
is cheap - it only costs us a little hard make them ready for use. there may be leakage damage to the
disk space. But what if we want to use But say you do buy an old PC - what motherboard, so read up on how to fix
real hardware? This is where things do you need to do? First, make sure you this and test on a non-visible area before
become expensive. know your stuff before starting the job. moving on. The old beige cases may need
Looking online, we can see incomplete Take care with electrics and chemicals some Retrobright which requires UV light
486-era machines trading hands for for restoring a machine. If in doubt, seek and hydrogen peroxide in order to bleach
hundreds of pounds. So that 486 DX2 the knowledge of an expert. Older the plastic to the desired colour. Older
66MHz you fancy is now just out of machines used AT power supplies: it’s hard drives are also prone to dying, so
reach. Old PC hardware is expensive to possible they're broken, so make sure perhaps consider an IDE to SATA or IDE
ship and unless it’s in the hands of a you have a known working supply to test. to compact flash/SD card solution.
On first boot we go through a typical Debian our user has no access to the sudo group; rather, we
configuration process. And yes it does say LILO: this need to switch user to root in order to make any
author remembers having to learn how to configure that system-wide changes.
to get their system to boot. Debian was a refreshing distro at this time. It was
The Debian configuration process starts by setting a easy to install and a joy to use. But our virtual time
root password, then we create a new user account for machine is ready to make a leap forward, to a time when
general access. When prompted to set up shadow the GUI installer was a big deal to sell the distro.
passwords, you can select yes or no - it makes no
difference. Do remove PCMCIA drivers if prompted. The 2000s - Ubuntu 6.06 Dapper Drake
Next we’re asked if we’d like to set up PPP, used for The first LTS (Long Term Support) release of Ubuntu
connecting to the internet via a modem. Answer N. was a big deal in 2006. It saw Canonical take a stance
The next screen asks if we’d like to run the dselect as a serious player in Linux, and saw many adopting the
program, used to automate installation. Select No and Debian-based distro as their main OS. In 2006 this
press Enter. If the dselect screen appears anyway, press author had just been playing with 5.10 for a few months
Q and Enter to drop into a Debian login. Enter your and was ready to make the switch from SUSE. Dapper
username and password and start using a few Drake came along, and despite being a shade of brown
commands to mess around with the system. Note that they adopted it for their daily workflow. Let's take a look
at it all over again. The Ubuntu installation process in
6.06 is barebones and really effective. Fifteen years
after it was released it still feels fresh and new.
Download the 32-bit ISO from httpiZ^old-releases.
ubuntu.com/releases/6.06.0 before opening Virtual
Machine Manager and creating a new machine.
In the first screen Create a New Virtual Machine,
select Local Install Media and click Forward. In the next
screen navigate to the location of the downloaded ISO
image by clicking Browse, and then Browse Local. Once
you’ve selected the volume the operating system name
should auto-populate to Ubuntu 6.06. Click Forward. Set
the RAM to 1024MB and the number of CPUs to two.
This is more than enough for Ubuntu 6.06. Click
Forward and in the next screen click Finish to set the
configuration and start the machine from the Live CD.
Now we follow a typical Ubuntu install.
Ubuntu 6.06 should run fine on the default settings,
but should we need to tweak them we can break out of
the virtual machine by pressing Ctrl+Alt+G and click the
blue information icon in the viewer window to open a
Ubuntu 6.06 “Dapper Drake” was the First LTS From Canonical. It changed how Ubuntu was configuration menu. We can change the RAM, CPU type
I perceived and it set the standard for many future releases. and insert virtual/real devices into the virtual machine.
Note that every change must be applied before moving
to the next item in the configuration. Changes to the
» VIRTUALBOX configuration take effect the next time the virtual
machine is power cycled.
QEMU isn’t the only way to create virtual machines. VirtualBox from Installing software and getting online is tricky. Most
Oracle is a tried and trusted means to create virtual machines, but it of the software repositories are now unavailable, so we
can’t emulate older hardware as effectively as QEMU. Installing need to install programs by compiling the code. Getting
VirtualBox is a simple task of downloading the latest version from online is possible, but this version of Firefox is no longer
www.virtualbox.org/wiki/Downloads and then following the supported and so we can’t access any HTTPS sites. But
installation guidance. We’ve successfully virtualised many Linux we can still relive the glory years of Ubuntu’s rise to
distros, including Linux Mint and Fedora with VirtualBox, and we have dominance, and that lovely shade of brown.
also virtualised Windows installs for projects.
VirtualBox has a straightforward process in which we create new The 2010s - the rise of Linux Mint
machines. During the process we can create virtual hard disks that Ubuntu had been the darling of the Linux distros for
are either a fixed size, for example an 8GB image file, or we can some time, but in the 2010s some grew upset with the
dynamically create a file hard disk file that will grow to the maximum introduction of Unity and an aubergine-based colour
that the host OS expects. Once a virtual machine has been created, scheme. Linux Mint was seen as an alternative. It had a
we’re free to tweak the RAM, number of CPU cores, VT-X or AMD-V similar back-end to Ubuntu, but a more traditional user
acceleration and add ISO images for boot. We can also create shared interface. Linux Mint also offered pre-installed codecs
folders with the host system, enabling easier file transfer. Networking for popular music and video formats. So via the super
is also handled for us, with no configuration necessary. simple installer, we can quickly get up and running. We
VirtualBox is proprietary software and as such it may not be for you. downloaded a suitable ISO from https:/7mirrors.
If not, then as we have shown in this feature, QEMU is more than up to evowise.com/linuxmint/stable/17.3.
your virtualisation needs. Setting up QEMU for Linux Mint is the easiest of
them all. In the first screen choose Create a New Virtual
Debian2 on QEMU/KVM
New VM File Virtual Machine View Send Key
Via the hardware
details menu we
Machine, select Local Install Media and click Forward. In Pressing Enter will run this command and start the
QUICK TIP
the next screen navigate to the location of the boot. For a first boot we recommend running a live
downloaded ISO image by clicking Browse, and then session to test that everything works. After that you can By default,
Browse Local. Once you've selected the volume, set the reboot the virtual machine and install to the virtual hard Virtual Machine
Manager will
operating system name to Generic Linux 2016 and click disk.
store all of
Forward. The RAM and CPU will be set to 2GB and two
the hard disk
cores - this is based on our choice of “Generic Linux Linux today: The Undiscovered Country images in /
2016” in the previous screen. This configuration is more Today, we're truly spoilt for choice. New Linux distros var/lib/libvirt/
than enough for Linux Mint 17. Click Forward and in the are coming out at an accelerated pace, including images, but
next screen click Finish to set the configuration and specialist distros for media production, networking and we can also
start the machine from the Live CD. scientific projects. Older hardware is supported by specify our own
Now we follow a typical Linux Mint install, but there is lightweight distros such as MXLinux, which prolongs the destination
a possibility that you might hit a snag. During our install life of older equipment. Power users aren’t forgotten: we when creating
process the live CD refused to start the X server. This have bespoke gaming distros that use Wine, Proton or an image. Using
the terminal
required us to click the blue information icon in the DOSBox to run Windows games with the latest RTX and
it’ll default to
viewer window, navigate to Video/QXL and change the RX GPUs. By looking to the Linux distros of the past we
the current
video option to VGA. Apply and then power cycle the can see how our much-loved distros have grown. From
directory from
virtual machine. Everything went smoothly after this the humble text-based installer of Debian to the slick which command
and we were even able to install software and browse guided installation process of modern distros, our Linux is invoked.
the web via Firefox. experience is very different now - but we can still see
the rock-solid foundation under the hood. E9
Running QEMU From the terminal
Linux rorrndi • Muzina rirerox — ▼
So far we’ve created hard drive images and installed
Linux Format x ♦
distros using the Virtual Machine Manager. We can do the
;ttps linuxformat.com »
same thing using the terminal and Crunchbang++
(https:Z^crunchbangplusplus.org), a modern version of Most Visited ▼ Linux Mint 3 Community ’£ Forums £ Blog
Crunchbang Linux.
First, we need to create a virtual hard drive. In this Linux Format
case it’ll be a 10GB .img image called cbpp.img and it’ll
Archives About Linux Format Buy Linux Fori
be stored in the current directory: I
img -m 2048 -netdev user,id=mynetO,hostfwd=t Linux Mint 17 is a great balance oF Form and Function. It looks great, and it came with everything
cp::8O8O-:8O -device el000,netdev=mynet0 I we needed to enjoy our computer.
he open Home Automation Bus (openHAB) go to the SSH keys section. Paste the contents into the
INSTALL OPENHAB)
(Q OpenHAB R^pbetry Pi J & 4 mtd HUC
U9UHTU AFFUANCC
■ Audio Multiroom • o z
Buster rhyme
It’s based on the official Raspberry Pi Linux Buster The HomeBuilder Ul allows you to build your own virtual LXF Towers,
image, and you can download it ay https://github.com/
MycroftAI/enclosure-picroft. Use the Raspberry Pi
I complete with mysterious library.
out of the box, but some devices will need manual install. If you want to get back into the CLI, run
intervention. We used a Seeed Respeaker 4-microphone $ mycroft-cli-client
array HAT, which was easy to set up. Other devices will There’s a custom audio setup script called
follow a similar pattern. Just run audio_setup.sh and don’t forget to check the excellent
$ git clone https://github.com/respeaker/seeed- documentation at https:Z4riycroft-ai.gitbook.io/docs.
voicecard.git Mycroft can be installed on a regular Linux PC either as
$ cd seeed-voicecard a Snap Package, through Docker, or straight from their
$ sudo ./install.sh GitHub. The wake word engine, known as Precise, uses
If your network works (try rebooting if it doesn’t!) TensorFlow for cutting edge accuracy, which
you could also SSH into your Pi to do this (the default requires the host to have AVX extensions; most
username is ‘mycroft’ with password ‘pi’, which you machines from the last decade will.
should change soon).
Then, if you’re using the 3.5mm jack for audio, you
may need to run sudo raspi-config , select 7. Advanced » POWER AND PRIVACY
Options’, ‘A4 Audio’, and finally ‘1. Force 3.5mm jack’.
Now reboot to enact the changes. If you run into There’s still a couple of first generation Raspberry Pis keeping things
difficulties with the Respeaker (or other Seeed models), ticking over here at Linux Format. These older models are great - such
the driver documentation is at https://github.com/ as our Pi 2 running Volumio - but lots of projects (such as Mycroft)
respeaker/seeed-voicecard. will require more CPU power, so for a lot of projects you’ll see at least
Reboot and you can pair your device to the Mycroft a Pi 3 is recommended. If you have a Pi 4, you can even run a Jitsi
Home service. You need to set up an account here to instance that can handle a few callers with no problems. The trouble
use the software, but hey, at least it’s not Facebook. is, these later models require much more power, so it’s important to
Only your queries are collected, and these are used to use a power supply (ideally the official model) that can provide a
better train speech recognition. Just follow the prompts steady 5.1V supply at up to 2.5A. Cheap USB power supplies can
to set this up at https://home.mycroft.ai from another cause all kinds of hard-to-diagnose problems, so if something's
device; if your audio is working, you should hear some behaving oddly, the power is a good thing to check.
actual verbiage at this point. If not, you can rerun the Also we’re doing a lot of setting up of web services here, which has
setup wizard at any time with mycroft-setup-wizard . the potential to invite the whole world into your machine. So beware
Once everything’s working, the Mycroft CLI client will of leaving things running with default credentials, and do look at
start, and you can talk and type at it to your heart’s firewalling things that only need to run on the local network. You may
content. Shout the magic wakeword ,“Hey Mycroft,” to want to run things in a virtual machine, or on a ‘disposable’ virtual
prick up it’s digital ears, then try, “Tell me a joke”, “What private server to get a feel for them first.
is my IP address?” or “How much wood would a It’s your responsibility to maintain these services and keep things
woodchuck chuck if a woodchuck could chuck wood?” up to date, too. The journey is far from over once things are up and
He likes it when you say “Thank you”, too. Responses are running. Many companies offer, for example, hosted Nextcloud
again both verbal and on screen/terminal. You can quit storage, and this may be a better option for small businesses that
the CLI at any point with :quit and then you can run don’t want the burden of administering a server.
anything you’d run on a normal Raspberry Pi Linux
Jitsi Meet
Set up, secure and self-host your way to video conferencing
nirvana, and you’ll never again have to use Zoom.
itsi Meet is a completely free, open-source just use IP addresses directly. But it’s probably easier in
Go ahead, video chat with the whole team. In fact, invite everyone you know. Jitsi Meet is a
fully encrypted, 100% open source video conferencing solution that you can use all day,
every day, for free — with no account needed.
Connect your calendar to view all your meetings in Jitsi Meet. Plus, add Jitsi meetings to your
calendar and start them with one click.
get things up and running, but just make sure you stop skip this for now (just this once) and you will be greeted
the services when they're no longer needed. by the Jitsi welcome screen, from where you can start a
And now we can get on with installation. We’re more new meeting. Your web browser will ask for permission
or less following the Self-Hosting Guide in the Handbook, to use the camera and microphone, and you should see
so do check there if you run into difficulty. First add the a message saying that you are the rightful moderator of
Jitsi repo with: this room.
$ https://download.jitsi.org/jitsi-key.gpg.key | sudo sh Being alone in a room is no fun, so on another device
-c 'gpg --dearmor > /usr/share/keyrings/jitsi-keyring. (or get a friend to do this, if you have such a thing) visit
gpg' the meeting by appending a slash followed by the room
$ echo 'deb [signed-by=/usr/share/keyrings/jitsi- name to the server’s URL.
keyring.gpg] https://download.jitsi.org stable/' | sudo With that working, we can now address our server’s
tee /etc/apt/sources.list.d/jitsi-stable.list slightly too Open for Business attitude and add some
$ sudo apt update authentication. Edit the prosody configuration at
Then let the fireworks begin with: /etc/prosody/conf.d/meet.yourdomain.com.cfg.lua
$ sudo apt install jitsi-meet (replacing the domain name as appropriate). In the
During package configuration, you’ll be asked for your section beginning VirtualHost "meet.yourdomain.com"
Pi’s hostname, and whether you want to generate a new, change the authentication line, currently set to
self-signed certificate or use an existing one. Choose the anonymous, so that it reads:
first option if you don’t already have a valid one for this authentication = "internal_hashed"
domain. We’ll replace it with a Let’s Encrypt certificate Then add (and adjust the domain in) the following at
later. At this point, you should be able to log in to your the end of the file to set up a guest domain:
server using your web browser. Just point it to VirtualHost "guest.meet.yourdomain.com"
https://meet.yourdomain.com and you’ll see the scary authentication = "anonymous"
certificate warning we warned you about earlier. You can c2s_require_encryption = false
Don’t worry, the extra subdomains configured here
(’) Logout Language English
are only used internally so they don’t need a bona fide
DNS record. Now we’ll go from Lua to JavaScript and
Port forwarding add the guest domain to the frontend. Edit /etc/jitsi/
meet/meet.yourdomain.com-config.js and add the
This function allows for incoming requests on specific port numbers to reach web servers, FTP
servers, mail servers etc following lines to the hosts section:
anonymousdomain: 'guest.meet.yourdomain.com',
Create a new rule Finally we should make focus requests only available
to registered users, which is done by editing /etc/jitsi/
Local External
jicofo/sip-communicator.properties and adding:
IPaddress Port range Port range Protocol Enabled Delete
org.jitsi.jicofo.auth.URL=XMPP:meet.yourdomain.com
10000-10000 UDP / Now restart the services and add a user with the
192.168.0.9 443-443 443-443 TCP (?J
prosodyctl register command. You can now generate a
Let’s Encrypt certificate with:
192.168.0.9 4443-4443 4443-4443 TCP
$ sudo /usr/share/jitsi-meet/scripts/install-
I IF you don’t get your ports right, Jitsi will not play nice. letsencrypt-cert.sh
Nextcloud
We’ve been relying on Nextcloud to keep our files in sync for
ages, and we think you should too.
egular Linux Format readers will be familiar ephemeral, fungible thing), so migrating the service just
with our ranting and raving about how great involves copying those volumes and connecting them to
Nextcloud is. And it keeps getting better - a new instance of the container.
the latest edition of the self-hosted storage and First on the agenda is to install the Docker engine
sharing platform, Nextcloud 19, sees it transformed which requires adding their GPG key to the apt keyring:
into a complete Collaboration Hub. $ curl -fsSL https://download.docker.com/linux/
If you already have a LAMP (Linux, Apache, MySQL, ubuntu/gpg | sudo apt-key add -
PHP) or equivalent stack set up on a home server or $ sudo apt-key fingerprint 0EBFCD88
VPS, you can easily add a Nextcloud instance to it, You should check the fingerprint of that key matches
either by extracting an archive to your web server’s root the one beginning 9DC8 and given in full in the
directory, or by copying the Web Installer PHP file there documentation at https://docs.docker.com/engine/
install/ubuntu (where you can also copy and paste
these lengthy commands). Next add the Docker repos
CONTAINERS ARE GREAT (change focal to bionic if you’re using 18.04), update
caches and install Docker with:
“Multiple instantiations of the same $ sudo add-apt-repository "deb [arch=amd64] https://
download.docker.com/linux/ubuntu focal stable"
container aren’t really a space issue, $ sudo apt update
$ sudo apt install docker-ce docker-ce-cli containerd.io
since the layers of the union filesystem Check that it’s working by running the Hello World
image, then fire up the Nextcloud image:
are shared between them.” $ sudo docker run hello-world
$ sudo docker run -d -p 8080:80 nextcloud
and running it directly. Setting up a LAMP stack (or The first switch tells Docker to run the container
indeed a LEMP stack with Nginx and MariaDB) is easy detached (in the background), and the second tells it to
enough (although it’s a bit of a faff having to create expose the container’s port 80 (where the webserver is
databases by hand) in Ubuntu or Debian - we’ve running) to port 8080 on our server. So now - once a
covered it before and there are countless guides a mere few hundred megs are downloaded and the container
DuckDuckGo search away. This time around, we’re springs in to life - if you browse your way to
IF you’re already going to install Nextcloud differently, via Docker. In http://yourserver: 8080 (with your address or
running an theory, this will mean our instance will be portable, so hostname) you should find the Nextcloud welcome
older edition of you could go from running on your VPS to running on a screen. You'll see a warning about the container using
Nextcloud you can
upgrade from
home server, or vice versa, with relative ease. Data and SQLite; this lightweight database will be fine for a few
the comfort of the configuration are stored in volumes outside the Docker users, but more popular setups will need a proper
web interface. container (which you should consider a fairly MySQL or MariaDB instance. Go back to the terminal,
find your container’s name (from the last column of
□ Hub 3.0 x © https://zembla.duckdr x +
the first command) and stop it with:
-> C A zembla.duckdns.org/nextcloud/updater/
$ sudo docker ps -a
Updater $ sudo docker stop yourcontainername
At this point, we could connect Nextcloud to a
v' Initializing MariaDB container and have both store their data in
Current version is 18.0.6. named volumes, which will provide portability. The
Update to Nextcloud 19.0.1 available, (channel: "stable")
Following file will be downloaded automatically:
resulting volumes will be available in the /var/lib/
https: //download. nextcloud. com/server/releases/nextdoud -19.6.1. zip docker/volumes/ directory. We can also add boring
names to our containers.
v' Check for expected files $ sudo docker run -d -p 8080:80 -name nextcloud -v
•y Check for write permissions nextclou d:/var/www/html nextcloud
'' Create backup
$ sudo docker run -d -v db:/var/lib/mysql -name mydb
-e MYSQL_ROOT_PASSWORD=secretl mariadb
Downloading
Getting these two containers to talk to each other is
Verifying integrity tricky, so we'll refer you to the Docker Compose section
Extracting in the documentation here, but we'll return to this idea
Enable maintenance mode
soon. Containers still continue to exist after they have
been stopped. Multiple instantiations of the same one
Jazz up your
Nextcloud install
with a dizzying
X Your apps
array of add-ons.
Were big fans of
v' Active apps
the News app,
O Collabora Online
X Disabled apps which is making
RSS great again.
+ Updates
M Files
by Collabora Productivity based on work of
Frank Karlitschek, Victor Dubmiuk
i Games
AGPL-licensed_________________________
aren’t really a space issue, since the layers of the union One way or another, you’ll find your way back to the
filesystem are shared between them. But it’s nice to tidy Nextcloud setup screen, and then all further
up after yourself, so check your containers occasionally configuration will be free of terminal commands. You
with docker ps and clear unwanted ones, such as our just need to choose an admin password, use db for
database above, with: the database name (it uses Docker’s internal
$ sudo docker rm mydb networking so doesn't need a domain name) and wait a
If you want to get rid of everything (danger, beware), few moments for everything to be initialised. Your first
you can do so with: step should be to create a new user, which you can do
$ sudo docker rm $(sudo docker ps -aq) from the Users section in the drop-down menu in the
You could at this point go back to the web installer top-right of the display. It’s better to keep the admin
and enter some administrative credentials, doggedly account for, well, admin. While you’re here, you can use
proceeding with the SQLite database, and reusing the your useful administrative privileges to see how apps
first volume. But we’re going to borrow from the are added to Nextcloud. Select Apps from the user
community and use the example Docker Compose menu in the top right, and you’ll find a categorised
setup, skimming over a few details which you should list of them.
check in the documentation. Running Docker this way It’s good practice to keep your containers updated
uses four containers, one of which is a reverse proxy with the command:
running Nginx, which can provide SSL encryption $ docker-compose pull
(which is essential if you make this installation available from the directory with the docker-compose.yml file.
to the internet at large). Also existing here is a Let’s
Encrypt host to auto-update certificates. So if you’ve got
a domain name setup, the whole thing will be seamless. » COLLABORA ONLINE
Grab the Compose recipe and environment from the
Tutorials download, or fetch it from the nextcloud/ At the time of writing Collabora has released the latest version of its
docker repo on GitHub. Edit the docker-compose file, enterprise edition of LibreOffice: Collabora Office 6.4 (see
setting in particular the MySQL password, the virtual www.collaboraoffice.com). Alongside that offering is another
host (your domain name) and Let's Encrypt variables. enterprise release, Collabora Online, which provides an online version
Then follow the official documentation to install of the office suite that can be plugged into a file sync and share host
Docker Compose at https://docs.docker.com/ via the Web Application Open Platform Interface (WOPI).
compose/install, as this process may change. If A free version of Collabora Online - the Development Edition,
something doesn’t work, you can peer into the logs of aimed at home users - is available, and it can be connected to
each container, for example: your Nextcloud instance to provide functionality not entirely dissimilar
$ sudo docker logs compose_proxy_l to Google Docs.
<- c ft Secure http /nextdoud.\ipps;file^7dir-/Docurr.ent$&fi eid= 16
The easiest way to set it up is to use the Docker image and follow
the instructions at https://nextcloud.com/collaboraonline. The
•Zew
*= |
Instr: Format
liberation Sans * |
Sneet
10 ’]|
Data
B I
Took
U
Help
I hen you’re running a home server or VPS, containers together. We'll start by creating a volume for
IP address on your LAN. And if you use Mythic Beasts' offering, be 4k Local
Remote J Agent 81 Azure
Manage a remote Docker Connect to a Portainer agent Connect to Microtoft Azure
aware that its Pi servers are connected by IPv6 only. A gateway is Manage the local Docker
environment
environment ACI
available so that IPv4-only users (that is, a large chunk of the UK’s Information
population) can still connect to it, but you’ll need a real DNS record Manage tne Docker environment where Portainer is running.
G Ensure that you have started the Portainer container with the following Docker flag
(DuckDNS doesn’t count here) to use it for anything other than as a v "ZvArZr uh/docber. nvcfc :/var/ri>n/4<K;ker %ocbM (Linux).
or
standard web host. We were a bit embarrassed that it took us a while •v \\.\pipe\4ocker engine:\\.\»XpeXdocker engine (Windows).
If you’re keen you can find a recipe to get everything working on the
Jitsi GitHub at http://bit.ly/LXF268jitsi. Besides running locally, Portainer can be used to manage remote
Mailcow:
portainer.io
= Containers CD Columns $ Settings dockerized
involves about 20
Home
+ Add container containers, but you
▼ LOCAL can disable a
Dashboard ft
Few oF them.
Q. Search...
App Templates
Stacks
State IS Quick
Q Name Stack Image
Filter T actions
Containers
Networks
Q mailcowdockerized_acme-mailcow_l running E O >_ mailcowdockerized mailcow/ac
Volumes
Events
Q mailcowdockerized_netfilter-m... running 6 l*s. >_ mailcowdockerized mailcow/n<
Endpoints
EJ mailcowdockerized_dovecot-mailcow_l running mailcowdockerized mailcow/d'
Registries
Settings
Q] mailcowdockerized_postfix-mailcow_l running Ei O 1* >_ mailcowdockerized mailcow/p'
check the documentation at https:Z^nextcloud.com/ should. The script generates mailcow.conf which you
collaboraonline. All going well, you should be able to may wish to tweak. We’ll just plough right ahead. First, in
specify it from Nextcloud, specifically from the case they get in the way, stop Nextcloud and any other
Collabora Online section in Settings. You may need to containers now. In Portainer do this by choosing
tweak the reverse proxy container to direct traffic to the Containers from the menu on the left, selecting all of
new container, if you used the Docker Compose them except Portainer (because that would be silly),
example on the previous page. and pushing the stop button. There’s a Kill button next
In that case you’ll find that example in the Stacks to it in case they don’t shut down gracefully, and you
section with a warning about it being created outside of can also remove them entirely if you don’t like them.
Portainer. In Portainer parlance, groups of containers Now return to the terminal (still using the root
are called Stacks, and it can only do limited things with account) and let’s fetch and unleash the Mailcow:
externally created Stacks. However, it’s easy to create a # docker-compose pull
new Stack; just paste, upload or point Portainer to the # docker-compose up -d
URL of a docker-compose.yml file. At this point, you technically have a working mail
Nextcloud’s own groupware, its Calendar, Talk and server. You should now be able to log in from the web
Mail applications, can be used for collaboration among interface, using the credentials admimmoohoo. But
users. The Mail app is just a client, so you set it up with a there’s still a lot of configuration to do. Not least of this
provider just as you would in a desktop email client. It’s involves changing that password, which can be done by
often been said (including by us at Linux Format) that clicking Edit next to the admin user to do this. If you
setting up an email server is hard. This is true, but we want to receive mail you’ll need to properly set up MX
can set up a rough-and-ready container running Postfix, records for your domain(s) with your DNS provider,
Dovecot and Roundcube and have a working (but not otherwise mail won’t be routed correctly.
necessarily well-configured) email set up in just a few Once you’ve done that, you can configure them from
keystrokes thanks to the Mailcow:Dockerized image. Mailcow’s Domains section, then you can configure the
Setting this up might offend the sensitivities of those actual addresses in the Mailboxes section. In a world of
adverse to running things as root, but the image uses endless spam, it’s important to do your bit by enabling
extended attributes and requires it. So let’s be a DKIM (Domain Keys Identified Mail), which signs
superuser and check our umask is set correctly (it messages originating from your server. DKIM-enabled
should print 0022). servers will verify this key when they receive mail from
$ sudo -i your domain, preventing malfeasance. E3
# umask
FRIDAY
alhazred
# cd/opt J (tan ft Q, inbox C
* uttd co 3077 M3
0
• 2 messages =" Order Received
"Personal Address Book" has been created
Friday. August 28. 2020 1109 UTC
airwnrd n 09
dockerized □ inbox
alhazred aitattfjjgjtaujiaxaikMffl abwa
alhazred 1107
Drafts
# ./generate_config.sh g Trash
You'll be asked for your domain name; this is the host Junk
Bi Archive
PYTHON
Coding a Space
Invaders clone
Calvin Robinson will always extend the hand of friendship - unless
menacing aliens are descending from the skies, in which case... blast 'em!
pace Invaders is probably the most famous around, but it’s a module worth exploring further. To
Player one has entered the game pyxel.rect(self.x, self.y, self.w, self.h, BULLET the rocket ship
at the bottom
Next, we need to introduce our player character: COLOR) of the screen,
class Player: We’ll need a class for our enemies, too. The beauty of shooting the aliens.
def init(self, x, y): using classes, in an Object Oriented
self.x = x Programming methodology is that SCORE Llr-
self.y = y we can spawn multiple instances
self.w = PLAYER_WIDTH (objects) of the same thing, without
self.h = PLAYER_HEIGHT duplicating any code.
self.alive = True class Enemy:
def init(self, x, y):
def update(self): self.x = x
if pyxel.btn(pyxel.KEY_LEFT): self.y = y
self.x -= PLAYER_SPEED self.w = ENEMY_WIDTH
self.h = ENEMY_HEIGHT
ifpyxel.btn(pyxel.KEY_RIGHT): self.dir = 1
self.x += PLAYER_SPEED self.alive = True
self.offset = int(random() * 60)
if pyxel.btn(pyxel.KEY_UP):
self.y -= PLAYER_SPEED enemyjist.append(self)
self.scene = SCENE.PLAY
self.player.x = pyxel.width / 2
self.player.y = pyxel.height - 20
■5 HUE 01.1 E R •
self.score = 0
enemy_list.clear()
bullet_list.clear()
blast_list.clear()
Here we’re just doing some housekeeping, restoring
the lists, deleting unused sprites, and waiting for the They think it’s all
enter key to be pressed so we can restart the game. over... it is now!
DAST
O
Create New App Initial Scan Environment
hackers is one that developers have been Configure initial scan environment. You can add more later.
mentality and company priorities. Hackers, like burglars, The environment your app is running in
only need to find a single open window or unlocked door •<£ Environment Host
OUR to get in. You wouldn’t check that you’ve locked your http://localhost:8000|
YAML
door only once every few months, yet this is the exact
EXPERT approach many companies take to security.
The uri ofyour running application to scan
Tim Dynamic Analysis Security Testing (DAST) is perhaps Adding an app in StackHawk is pretty straightforward, with a clean
Armstrong
is a former
the most overlooked stage of any security pipeline,
frequently relegated to a check-up every six months by
I
workflow and Ul.
Lead Engineer an outside consultancy that does an automated scan you just want to dive in at this point, then you can pick
turned with Burp Suite or Zed Attack Proxy (ZAP) and provides up a copy of the progress so far at https://gitlab.com/
Developer you with a (hopefully short) report and an invoice in the plaintextnerds/web-app-security-tutorial2-lxf280.
Advocate range of £3,000-30,000, mostly depending on the
specialising in scope. In most cases, the consultants don’t go further Too many acronyms
networking, than the automated scan because at that point they When it comes to DAST there are a growing number of
software already have enough to write a multi-page report. solutions in the market. Most of them use hosted
development, But here’s the thing: when malicious actors (aka scanners that run on a periodic schedule, so either you
and security. hackers) attack your web app, site or API, they aren’t need to expose a test environment to the internet and
You can find checking if your code is neatly formatted, they’re have the app scan that, or you need to set it up to scan
him on essentially doing dynamic analysis. They’re looking for a production - which is a bit late (and could lead to
Twitter as place where you’ve not validated the input, an endpoint instability of the production environment).
@omatachyru that you’ve forgotten to protect, cookie slack, a The goal here is, as it was when you added static
or via his vulnerable login system, leaked credentials and analysis and software composition analysis to the
website at hundreds of other things that are very difficult to detect pipeline, that you know about any vulnerabilities
www.plain statically. If you’re relying on a spot test every six before the code goes live so that you can fix them
textnerds.com. months then odds are you’ve got security holes that before it gets deployed.
you’re not aware of. What you need, then, is something that can run
Building DAST into your CI/CD only takes a few inside the pipeline to test the service on commit. So
minutes and gives you effectively that same information what are your options? Well, you could build your own
that you’d get from a pen-test where all they did was run solution around an open-source tool like ZAP, or you
an automated scanner. The main difference is that could pick up an off-the-shelf solution. Unfortunately,
instead of it only occurring every six months, the scan there aren’t many DAST solutions that you can build
happens every time someone merges a PR to the main directly into your Cl pipeline, with the leaders in this
branch - meaning you find out about the vulnerability space being StackHawk and GitLab. Both based their
when it gets merged. Ultimately this means that when scanners on ZAP, meaning that they can run in a Docker
you do bring in the external consultants for the six- container in your pipeline (or even locally).
month check-up, you actually get your money’s worth! StackHawk’s scanner, HawkScan, is a little more
In this tutorial, you’ll be adding DAST to a GitLab 01/ advanced than GitLab’s version and has support for
CD pipeline. We have covered this before in Linux multiple authentication methods and makes it easy to
Format magazine (LXF279 & 280, if you have them to customise the scanner. While StackHawk holds the lead
hand), and it’s a good idea to check those out first, but if in scanning capabilities, GitLab is ahead in pricing (for
considering that they are both built on ZAP (which itself Run the following Docker command to start your scan.
is an open-source solution), should perhaps not be a // load your StackHawk API key in the shell environment (9
S’ oii! -/. hawk/hawk. rc
surprise. Unfortunately, however, it is not that common, // execute Docker command to kick off scan
as even though a number of their competitors are also Sdocke run -e API KEY=${HAWK API KEY} --rm -v :(pw :/hawk
» Development httpJ/djongoapp^OOO
services:
- docker:20-dind
script:
- cd src
- docker login --username $CI_REGISTRY_USER
-password $CI_REGISTRY_PASSWORD $CI_
From the scan results view, you can see how many of the issues are
-tag $CI_REGISTRYJMAGE:$CI_COMMIT
SHORT.SHA
I new and how many still remain since you last triaged the results.
Cheatsheet
Headers (»)
If you're struggling to advocate for fixing a particular vulnerability, one
POST http^://djangoapp:443/l/votc/ HTTP/1.1 £)
of the best tools is learning how to demonstrate the risk. If you can
https:<7g<thut>.com.’OWASP/Ch«.«Sheet$ene$>t>''XVmattefr<neattheett/Transport
tayvi Protection Cheat Sneet.md User Agent: NttiUa/M (windows hi le.t: win
*
4: xM; rv:W.e> Gecko/2eie
Pidyma. ituiachf
Cathv Contfol: oucac-hv
• Arttoi ■ • Display AH ’ 1 -1 of 1
Content-Type: application/
*
-www-tor»-ur
Content-Length: 10J
I encoded
show the vulnerability in action and the damage that can be done, you
Hr 1 rrer•. h1fp: f/6)nngaapp • RON/1 /
Path Method Host: djnngnappTROftft
Cookie: csrftokcn-GK7CkSlr€XES8vwenMgx05VclDdCM3uwyEnoo€PRSww)IaSJ3AA4I will find the conversation shifts very quickly to how quickly you can fix
httpsy/dHngoopp.443/1/vote/ POST •
TURING MACHINES
Programming a
Turing Machine
It was the computer that started it all, albeit in theory. Mike Bedford
shows you how to program a Turing Machine and put it through its paces.
(Credit: www.turingarchive.org/viewer/?id=521&title=4 )
Ian Turing is probably best known for his
pioneering work on code breaking at the
Government Code and Cypher School at
Bletchley Park. In playing a key role in developing the
electro-mechanical Bombe device that was used to
OUR crack the Enigma cipher, Turing had a major impact on
shortening World War II by an estimated two years and
EXPERT saving as many as 14 million lives.
Mike Bedford Despite having been dubbed the “Father of Modern
is fascinated by Computing”, however, his contributions to
how simple general-purpose computing are less well-appreciated.
computer And here it’s interesting to note that his design for the
architectures - ACE computer, a cut-down version of which was
such as a Turning eventually built by the National Physics Laboratory in
Machine - can do 1950, predated the Manchester Baby, the world’s first Alan Turing’s Famous Turing Machine was never intended as a physical
anything the
most powerful
stored program computer, by three years. Arguably,
though, his biggest contribution to computing was his
I computer, although today’s simulations have brought it to life.
supercomputers vision for a machine that was never actually built, and instructions in the normal meaning of the word. So,
can do. would have been totally impractical had it ever become possibly for the first time ever, you’d be writing
a physical reality. This was the so-called Turning programs that aren’t sequences of instructions. Instead,
Machine and here we look at this model of computing a Turning Machine is a special type of Finite State
and see how to program it using a couple of simulators. Machine, as we’re about to see.
QUICK TIP A Turning Machine (TM) operates on an infinite tape,
Alan Turning Turning Machines divided into squares that we can think of as memory
might not have Alan Turing's concept of the computing architecture locations, each of which can contain a symbol from the
built a physical that now carries his name dates back to 1936, which machine’s alphabet of symbols. We can think of this as
realisation of was almost a decade before anyone figured out how to the equivalent of the memory in a PC, because the TM
his theoretical build a universal computing device. But since this was a can read and write symbols on the tape, albeit only at
computer, but so-called thought experiment, a theoretical concept the position occupied by the TM's read/write head.
Mike Davey
that he used to develop his theory of computability, it At any time, the TM is in one of a finite number of
has. See www.
didn't matter that it only ever existed on paper. What states. These can be as numbered, although it makes
aturingmachine.
com. It works
makes it so interesting to today’s programmers, though, more sense to give them names. Although TM’s don’t
on a real tape, is how simple it is compared to modern day computers, execute instructions, they do operate sequentially. Each
erasing old despite being capable of computing any function that operation involves reading the symbol at the current
symbols and the PC on your desk could compute. position of the read/write head on the tape and then,
writing new If you’ve ever delved into historic computers you’ll no depending on the combination of that symbol and the
ones as it doubt have encountered some extremely minimalistic TM’s current state, it writes a specified symbol to the
goes. Behind instruction sets. The Manchester Baby, for example, tape (which can be the same as the symbol it had read),
the scenes despite being a universal computing device, had just it adopts a new state (which can be the same as the
it’s controlled
seven instructions, compared to many hundreds or current state), and it then moves its read/write head
by a Parallax
thousands in today’s processors. Turning Machines are one position left or right along the tape.
Propeller
microcontroller.
even simpler, not in having even fewer instructions, but So, a particular TM is defined by its alphabet of
in using an architecture that doesn’t really have symbols, its number of states, and a transition table that
keep things as simple as possible, we’re going to use can’t do any arithmetic on an infinite string of asterisks
unary instead of binary arithmetic. so ensure that the Head Position is 0, type 01110111110
You might not have come across the unary in the Tape box, and press the Enter key.
numbering system before so here’s a quick introduction. You’ll notice that your data - which represents the
Otherwise known as base 1, it follows the same rules unary numbers for 3 and 5, each delimited by zeros -
we've learned for interpreting decimal (base 10), binary appears on the tape, starting at position 0, with the
(base 2) or hexadecimal (base 16) numbers. So, starting head on the left-hand zero. Now try executing the TM
from the right-most digit and moving left we have one step at a time using the “find and execute next rule”
positions for one to powers of zero, one, two, three, etc. button which is the third button above Current State,
Uniquely among number systems, these all equate to and is the one that looks like a footstep with a forward
the same number, specifically one, which means that
the equivalent in unary of a decimal number is that
number of ones. So, for example, decimal 3 equates to » 2D TURING MACHINES
unary 111, and decimal 6 equates to 111111.
Although Tursi’s interface allows the operation of a Although 2D Turing Machines are no more powerful than the original
TM to be controlled, including writing the initial pattern ones, they're an interesting diversion. That’s because the grid of cells
to the tape and specifying the initial position, the enable graphical patterns to be calculated and displayed, especially
remainder of the definition is done externally. So, here’s if colours are written to those cells instead of letters or numbers.
the definition for unary addition, which you should enter Most of what we’ve learned about ordinary TMs applies to 2D
using a text editor: TMs, the only difference being that, instead of moving only left or
# ! start 0 right, the read/write head is able to move left, right, up or down. In
# ! end 4 some implementations the movement is defined absolutely, so we
# ! fill * can think of it as N, S, E and W, while in others it’s relative to the
000R1 current direction of the head so the angle of a turn is defined as 0,
101R2 90,180 or 270 degrees, after which the head moves forward. If you're
111 R1 looking for simulations of 2D TMs they're often called Turmites and,
L3
*
2O while there are plenty online, there don’t seem to be too many native
211R2 Linux applications so that could be an opportunity for you.
300L3 To get a feel for Turmites, go to https:Z/mdciotti.github.io/
310L4 turmites and try out the Turmite defined by {{{lz8,l}z{lz2z0}}z{{lz4zl}z{lz4z2}
The first two lines define the start state and any }/{{},{0,4,0}}}. This is intended as a curiosity as opposed to for serious
states that cause the TM to halt, and the third line coding, and it seems to be used mostly to try out random definitions
specifies a symbol to be written to all positions on the to appreciate the range of behaviours that can result from just
tape as an initialisation. The remaining lines, of which repeating a simple set of rules.
there should be one for each combination of the state
and read tape symbol (but only those that are expected
to be encountered), dictate the symbol that should be
written to the tape, the direction to move along the tape
(L or R), and the new state. So, for example, the line 2 0
* L 3 means that whenever the TM is in state 2 and
reads a 0 from the tape, it should write an asterisk to
the tape, move one space to the left, and enter state 3.
Now start up Turi and load your unary addition
program, and you’ll then see the transition table shown
as the various rules at the left of the screen. At the top
you’ll see that every position on the tape contains an
asterisk,and a couple of lines below, the Current State is
shown as 0, both of which we defined. However, we
"How Fast is a you’ll see the steps listed as they’re executed. For each
Turing Machine?” step, you’re shown the initial state, the symbol read
is surely a daft from the tape, the symbol written to the tape, the
question since direction moved and the new state. Hopefully you’ll find
it's a theoretical that it halts on step 12, having changed the zero
computer. For between the two numbers to a one, the final zero to an
a mechanical asterisk, and the final one to a zero. The result is,
implementation,
therefore, 0111111110 , which is the unary representation
though, Mike
for eight, again delimited by zeros.
Davey (see
page 92) came
up with some Vizualisation machine
estimates about Our second TM simulator is an online utility that you can The Tursi simulator offers an excellent way of creating a Turing
his creation
- From 3.1
find at https:Z<tu ringmachine, io and which calls itself
Turing Machine Visualization. This simulator has the
I Machine and putting it through its paces.
operations per benefit of a built-in editing facility so you don’t have to the binary arithmetic examples, namely the one for
second to use a separate text editor, it shows the TM as a state addition? Even with the two four-bit binary numbers
6.2 seconds diagram, and it has lots of example TMs that you can try defined in that example, it takes no fewer than 92 steps
^per operation.
out. The state diagram is interesting, and represents a to carry out the addition!
graphical alternate to the transition table as the Before moving on, we'll suggest an example for you
definition of a TM, as well as enabling you to follow to try yourself from scratch with little in the way of
progress graphically. Arguably, though, Turin provides guidance. The only bit of advice we’ll provide is that,
more information that could be useful in debugging, so below the state diagram and the editable code panel,
there might be some benefit in using both. That would the syntax for defining the TM is described. The exercise
involve maintaining two versions of the source code, we're suggesting is a traffic light controller. The one we
though, and keeping them in step with each other, implemented followed the sequence used in the UK
because the syntax used to define their TMs is different. (red>red+amber>green>amber>red ...) but you could
To get a feel for the operation of the Turing Machine implement the sequence used in other countries.
Vizualization, we suggest you start with a simple Although your Turing Machine might venture into a
example and, although it uses binary arithmetic instead blank cell, depending on how you implement it, your
of unary, it's still trivially simple. This is a TM to machine should write to just four positions on the
increment a binary number which is the second tape - the left-hand one which defines the phase of the
example from the menu in the title bar. Since we’re now lights, IE which combination of lights should be lit on
into the realm of binary numbers, and therefore we need the next change, and three others that can contain
both zeros and ones, the number to be incremented is either a zero or a one to represent whether the red
delimited by spaces. (top), amber (middle) and green (bottom) lights are
If you step through this example you’ll notice that the illuminated. This TM shouldn't halt, but should execute
current state is always highlighted on the state diagram forever, as do real traffic lights.
and the arrows representing the transitions are The traffic light problem makes a nice change from
highlighted as they occur. You can easily change the arithmetic operations, but it isn’t a particularly difficult
start pattern on the tape - that is, the binary number to exercise. After all, despite rarely having delved into TM
be incremented - by editing the code in the panel at the programming previously, we soon got it up and running.
This might be a right and clicking Load Machine. It should be fairly However, at the expense of being accused of coming up
somewhat Fanciful
obvious how this TM works. with something we didn’t have the time or confidence to
representation of
a Turing Machine,
To understand how laborious it can be to carry out try out ourselves, we're suggesting a more taxing
but it illustrates on a TM what would be trivially simple on any problem: adding together two decimal numbers. We’ll
the key principles. conventional processor, how about trying out another of give a bit of advice though. The normal solution involves
decrementing one number until it reaches zero and, for
each such decrement, increment the other number.
There’s an example for incrementing a binary number in
the Turing Machine Vizualization, and that could provide a
starting point for incrementing a decimal number and,
although there's no binary decrement, they’re not in
short supply so you’d easily be able to find one.
Universal machines
So far we’ve seen several examples of TMs that were
designed to do a particular job. But although you can
define a TM to execute any logical or arithmetic
function, this isn’t the same as the general purpose
computers we’re all familiar with. However, Alan Turing
did envisage exactly such a device, long before such a
machine ever materialised. The machine that did that -
']:
: L
{write: I, R: backl}
31 1 : (write: 0, L: carry}
however, it’s all too common for that code to run forever, 45’
46
rewrite:
0: {write: 0, 1}
never halting, at least for some combination of input The Turing Machine Visualization provides a different representation to Tursi by showing the
data. So it might be quite handy for debugging, I TM’s state diagram.
PYGAME
Classic pseudo-3D
racing road effects
With a bag of silver coins in hand, Andrew Smith whisks us back to
the classic arcade days to recreate pseudo-3D racing games.
other Python/PyGame script, at the top of the source A andrew@dell-ubuntu-01: ~/PythonProjects/pseudo_3droad The Final Folder
andrew@dell-ubuntu-01:~/PythonProjects/pseudo_3droad$ Is structure once the
code the libraries needed to run the script are declared. floorcasted_road projected_road readme.txt simple_road z_map_ project has been
Also notice that continuing on from this, global variables andrew@dell-ubuntu-01:~/PythonProjects/pseudo_3droad$ Is -I
downloaded.
total 20
for the script are declared to define the colours for the drwxrwxr-x 2 andrew andrew 4096 Aug 30 2020 orcasted_road
drwxrwxr-x 2 andrew andrew 4096 Aug 30 2020 projected road
other parts of the road. See the following below: -rw-rw-r-- 1 andrew andrew 147 Aug 30 2020 readme.txt
import pygame,sys drwxrwxr-x 2 andrew andrew 4096 May 15 10:17 impleroad
drwxrwxr-x 2 andrew andrew 4096 Aug 30 2020 zjap^road
from pygame.locals import * andrew@dell-ubuntu-01:-/PythonProjects/pseudo_3droad$ []
BLACK=pygame.color.THECOLORS["black"]
WHITE=pygame.color.THECOLORS["white"]
RED=pygame.color.THECOLORS["red"] def main():
GREEN=pygame.color.THECOLORS["green"] pygame.init()
BLUE=pygame.color.THECOLORS["blue"] #Open Pygame window
YELLOW=pygame.color.THECOLORS["yellow"] screen = pygame.display.set_mode((640,480),) #add
SCREEN_WIDTH=640 RESIZABLE or FULLSCREEN
SCREEN_HEIGHT=480 #Title
HALF_SCREEN_HEIGHT=int(SCREEN_HEIGHT/2) pygame.display.set_caption("simple road")
The screen resolution settings SCREEN-WIDTH #font
and SCREEN-HEIGHT are set to relatively low values font=pygame.font.SysFont('Arial',30)
in regards to today’s device screen capabilities. Please #images
feel free to change these for a higher resolution screen light_road=pygame.image.load('light_road.png').
setting if you’re not happy with them. In addition to convert()
changing this, you will need to add two lines of code to dark_road=pygame.image.load('dark_road.png').
ensure that the images loaded will always meet the convert()
screen resolution specified. light_strip=pygame.Surface((SCREEN_WIDTH,l)).
Add the following lines just after the images convert()
light.road.png and dark_road.png have been loaded, dark_strip=pygame.Surface((SCREEN_WIDTH,l)).
as shown below. convert()
light_road=pygame.image.load(Tight_road.png'). Iight_strip.fill(light_road.get_at((0,0)))
convert() dark_strip.fill(dark_road.get_at((0,0)))
light_road = pygame.transform.scale(light_road, #variables
(SCREEN-WIDTH, SCREEN-HEIGHT)) texture_position=0 #this is used to draw the road
dark_road=pygame.image.load('dark_road.png'). As with all PyGame scripts, PyGame is initialised with
convert() a pygame.init() function call as can be seen from the
dark_road = pygame.transform.scale(dark_road, above code. Also notice that when the screen display is
(SCREEN-WIDTH, SCREEN-HEIGHT)) set up, where there is the line:
You will also need to alter the following line of code in screen = pygame.display.set_mode((640,480),) #add
the script. Change RESIZABLE or FULLSCREEN
bottom_segrnent={'position':240,'dx':0} it misses out using the variables SCREEN-WIDTH and
to SCREEN-HEIGHT declared above. Replace the value of
bottom_segment={'position':SCREEN_ 640 with SCREEN-WIDTH and the value of 480 with
HEIGHT/2,'dx':0} SCREEN-HEIGHT so that the screen resolution can be
If the SCREEN-WIDTH and SCREEN-HEIGHT adjusted to suit your device.
are changed and the above changes are not done, the Notice that there are just two images loaded to
display will look odd when running the program. create the intended effect and the rest of the effect is
The main operation of the script is carried out in a created by use of internal colour schemes to create
defined main() function which is shown in part here: alternating strips.
'andrew@dell-ubuntu-01:~/PythonProjects/pseudo_3droad$ Is
threshold/2) #define drawing light or dark road
simple road
readme.txt simpleroad z_map_road
andrew@dell-ubuntu-01:~/PythonProjects/pseudo_3droad$ cd simpleroad
To save time scrolling through the code in getting to
andrew@dell-ubuntu-Gl:'/PythonProjects/pseudo_3droad/simple_road$ Is
bush.png simple roadback.py simpleroadcurvesegmentdei
what you want, use the IDE search facility usually
simple road sprite.py
darkroad.png simple road curve demo.py simple roadhill demo.py
brought up by pressing Ctrl+F and then type the name
o.py
light road.png simple road curve formula.py simple road hill.py
of the variable or function you are looking for.
pal in _ t ree . png simple road curve. py simple roadhill segment dem<
ment demo.py
The two variables that might first be of interest to
andrew^dell-ubuntu-01:~/PythonProjects/pseudo_3droad/simple_road$ python3 simpleroad curve demo.py
pygame 1.9.6
play around with values first could be road_acceleration
Hello from the pygame community, https://www.pygame.org/contribute.html
simple road curvedemo.py:113: DeprecationWarning: an integer is required (got type float). Implicit co
and texture_position_acceleration .
nversion to integers using int is deprecated, and may be removed in a future version of Python.
screen.blit(dark_road,(curve_value,i+HALF SCREENHEIGHT),(0,i,SCREEN WIDTH,1))
Change the values of each variable and then run the
simple road curve demo.py:110: DeprecationWarning: an integer is required (got type float). Implicit co
nversion to integers using int _ is deprecated, and may be removed in a future version of Python.
program as shown before to see the effect this has on
screen.blitdight road,(curve value,i+HALF SCREEN HEIGHT),(0,i,SCREEN WIDTH,!))
the running of the program. You may want to do this a
» GENERATING HILLS
An example of how to create a hill effect is given in the Python
script file simple_hill_road.py. From viewing the code, you will see
that new variables have been added to create the hill effect, hill
position , hill_velocity , hill_acceleration and hill_sharpness are the
main ones which have been added. The code that deals with the Up
arrow key event is the same but the rendering process is slightly
different even though similar in some ways to how the left-bend was
created in simple_road_curve_segment_demo.py.
Again, you will see that a for loop is used for rendering the graphics
to the bottom half of the screen. The hill effect for the road is created
with the following code.
*
hill_position+=hill_velocity
hill_sharpness
To increase how steep the hill is, increase the value of hill_sharpness
which is currently set to the value of 4. To make the road appear flat
Our retro road running the basic straight road effect. again, set the value to 0. The position of the hill is continually tracked
as well to determine whether to regenerate a light part of the road or
number of times to get used to the effect of using a dark part of the road.
different values. There is currently recorded a current position of the hill and old
In every PyGame program there has to be a part that position which the difference between the current hill position and the
is written to render all the graphics so after user input old hill position is continually worked out.
they can be updated. This is done with a for loop
situated in the second half of the while loop as seen in
part below: As can be seen in the script, the acceleration value is
for i in range(HALF_SCREEN_HEIGHT-l,-l,-l): set to a constant 80 per Up cursor key press. Those of
if top_segment['position'] < i: you who from a physics background may want to create
dx = bottom_segment['dx'] a more realistic acceleration algorithm where the rate of
else: acceleration may gradually increase and decrease.
dx = top_segment['dx'] Even though it may involve some planning and some
ddx += dx re-construction of the existing code, since components
current_x += ddx of a race track have been demonstrated - straight
curve_map[i] = current_x roads, bends and hills - it maybe a good exercise to
curve_value = curve_map[i] build a small race track.
if texture_position<half_texture_position_threshold: In other source code examples, images of vehicles
screen.blit(light_stripz(O,i+HALF_SCREEN_ have been added. It maybe a good idea to take the
HEIGHT)) existing image(s) and modify them in an image editor to
screen.blit(light_road,(curve_vahiezi+HALF_ create an image of a vehicle turning left or turning right
SCREEN_HEIGHT)z(OzizSCREEN_WIDTHzl)) and implementing into the script, writing code that will
else: handle the left and right cursor keys. Instead of scrolling
screen.blit(dark_strip,(Ozi+HALF_SCREEN_ through the code line by line looking for what you want, With a bit of maths
HEIGHT)) instead press Ctrl+F which will usually bring up a search the basic road can
screen.blit(dark_roadz(curve_value,i+HALF_ facility and type in a variable or function name. E3 be made to bend.
SCREEN_HEIGHT)z(OzizSCREEN_WIDTHzl))
Going Further
The rendering of the graphics is by default set to take
place in the bottom half of the screen and not the top
half, hence the use of HALFMMSCREEN- HEIGHT. The
above code renders both the dark and light sections of
the road onto the bottom half of the screen. The top half
of the screen is kept clear for the blue sky effect.
After you have gained more confidence with the code
shown, you may want to add further functionality to the
existing code. As you’re currently forced to close the
program by closing the window with a mouse, it may be
a good idea to end the program when the Escape key is
pressed instead.
The colour of the sky is currently a plain blue. A
possible addition here would be to create an image of a
white cloud in an image editor such as Gimp and then
create an animation of clouds moving across the top
half of the screen.
MERMAID
How to code diagrams,
graphs and pie charts
Mihalis Tsoukalos explains how to use Mermaid to create beautiful
technical graphs and diagrams you can reuse and update anywhere.
with a third book way of telling that the embedded code has a given
in the works! property, which in this case is Mermaid. However,
Mermaid code can also be saved on its own in files graph that’s going to be rendered from the top to the
that use the mmd file extension (filename.mmd). bottom (TD: Top-Down) of the page. Next, we add nodes
You can find the code used in this tutorial at and we connect them with other nodes. The -->
https:Z<www.linuxformat.com/includes/download. notation shows that the node on the left is connected to
php?PDF=LXF274.code.tgz. the node on the right. The graph contains four nodes,
QUICK TIP named Al, S2, A3 and A4. If you want to include more
IF Mermaid isn’t Installing Mermaid... or not! nodes and connections between them, just declare
to your liking, You don’t need to install Mermaid. All you need is an what you want - Mermaid takes care of the output.
try Vega and editor that supports Mermaid to see the output from a This example illustrates one of the simplest uses of
Vega Lite, which Mermaid block. The following is a Markdown file, saved Mermaid; it can do many more tasks. However, it also
enable you to as mermaid.md, with a block in Mermaid format: illustrates the simplicity of the Mermaid dialect.
create graphs
## This is a Mermaid example The output of the previous code can be seen in the
and plots. Both
diagram above with the help of Microsoft Visual
grammars are
"'mermaid Code - more on this next.
based on D3.js
and JavaScript. graph TD;
Learn more Al—>A2; Microsoft Visual Code
about Vega and A2—>A4; Microsoft Visual Code has a extension for rendering
Vega Lite at A1->A3; Mermaid files and previewing Mermaid output inside
https:#vega, A2—>A3; Visual Code. Go to the Extensions tab, search for the
github.io/ and A3—>A4; “Markdown Preview Mermaid Support” extension and
at https:#
install it. It would also be helpful to install the “Mermaid
github.com/
The first line is plain Markdown and generates a title Markdown Syntax Highlighting” extension so that you
vega/vega.
in the output. Then, we declare that we’re creating a can see your Mermaid code beautifully coloured.
Next, we render the Markdown file vscode.md inside mpRoview tex • pie_ch.art.md ? Mennaid.txt • vscodr md x es Preview vscode.md X
you can simply write A--><nl> & <n2> & <n3> or code is previewed
in a separate
A--xnl>--xn2>--xn3> in order to make multiple node When rendered, the code generates a flow chart that window from the
connections. Using — > instead of just --> creates can help you choose an Operating System. The diagram Markdown file.
longer edges between nodes, as in C—>C1. on the next page shows the flowchart generated by this
The screenshot opposite shows the preview of code with the help of Microsoft Visual Code.
vscode.md using the Mermaid extension for Visual Code.
Sequence diagrams
Creating a pie chart A sequence diagram describes interactions and how
Mermaid can easily plot pie charts and can even do the things are carried out. They’re helpful when you want to
calculations for you so that the percentages of the pie describe situations that depend on many factors.
chart are correct. To create a pie chart, you need to A sequence diagram begins with the
begin the Mermaid block with pie . The next line should sequenceDiagram keyword followed by the list of
begin with title followed by the title text. After that, you participants, which are defined using the participant
need to write the dataset that’s used for generating the keyword (each participant is defined in a separate line).
pie chart. Each line of the dataset is a different entry After that, you need to define the connections and
and contains a label, followed by a colon, which is interactions between participants, which in Mermaid
followed by a positive numeric value. Note that the label terminology are called Messages.
text should be included in double quotes, which isn’t the This Mermaid code produces a sequence diagram -
case with the pie chart title text. it’s part of the seq_diagram.md Markdown file:
The following block shows the definition of a pie sequenceDiagram
chart in the Mermaid dialect: participant User
## This is a Pie Chart in Mermaid participant CTC
participant CSV
"'mermaid participant Auth as Authorization
pie loop Every minute
title Linux Distributions CTC-->CSV: Keep updating!
"Debian": 42.96 end
"Ubuntu": 50.05 User->>Auth: Send Authorization details
"Arch": 10.01 Auth-->>User: Get back authorization token
"CentOS": 5
There are four participants: User, CTC, CSV and Use Cases in Mermaid
The official web as Auth inside the Mermaid code but is displayed as
[ _par [Get Data]
site for Mermaid Authorization for clarity - this is implemented with the
A Database that keeps Usage data
is at https:# Auth as Authorization statement. The loop block 30 __________
mermaid-js. represents actions that happen continuously. Return Usage data
github.io/ - 0
You should be able to see the output of
mermaid. Logs in
seq_diagram.md either in Microsoft Visual Code, typora F
—
https://mermaid-js.github.io/mermaid-live-editor.
(
F
the Microsoft (
Asks for system \isualisations
>----------------------------- --------------------------
at https:# project. Use cases are implemented using sequence User CTC csv CTC/Auth
more about
This is shown in the following Mermaid code: embed Mermaid code into a Hugo blog post that we
the Markdown
language
sequenceDiagram publish. In order to support Mermaid rendering in Hugo,
at https:# participant U as User you need to add a small shortcode inside the layouts/
en.wikipedia. participant CTC shortcodes directory - Hugo uses shortcodes to add
org/wiki/ participant CSV extra functionality that can’t be implemented in
Markdown. participant CTC_Auth as CTC/Auth Markdown. The name of the shortcode file should be
autonumber mermaid.html and must have the following content:
rect rgb(0,100,0) $ cat layouts/shortcodes/mermaid.html
par Get Data <script async src="https://unpkg.com/[email protected]/
CSV-»CTC_Auth: A Database that keeps Usage dist/mermaid.min.js"></script>
data <div class="mermaid">
Note right of CSV: REST API {{.Inner}}
CTC_Auth-»CSV: Return Usage data </div>
end The previous file defines a shortcode named
end mermaid - in order to use that shortcode you should
embed Mermaid commands in {{<mermaid>}} and {{</
U-»CTC: Logs in mermaid>}} blocks. A part of the Markdown code for the
CTC—»U: Returns Security Token Hugo blog post is as follows:
CTC-»CSV: Opens CSV Window Using [Mermaid](https://mermaid-js.github.io/
U-»CSV: Asks for system visualisations mermaid/) in Hugo.
CSV-»CSV: Query Internal Database
Here’s a flowchart CSV->>U: Displays Visualisations {{<mermaid>}}
generated in The autonumber keyword that’s shown here graph TD;
Mermaid, which
can be drawn from
attaches a sequence number to each arrow in the A—>B;
left to right or top sequence diagram. The rect rgb(0,100,0) command A->C;
to bottom. puts colour in the output using RGB values and colours B—>D;
a rectangle. Inside that rectangle, C->D;
Flow chart
you can write the Mermaid {{</mermaid>}}
Choose OS
commands you want. The par block The first line is Markdown code. After that you need
shows actions that happen in to put all Mermaid-related code in a block that begins
parallel. Both with {{<mermaid>}} and ends with {{</mermaid>}}.
Do you want? rect and par blocks end with the The diagram on the next page shows the code inside
end keyword. the Hugo blog post - the entire Markdown file for that
The diagram above displays the blog post is called useMermaid.md. You can see the
output of the previous Mermaid blog post live at www.mtsoukalos.eu/2021/01/using-
code - the Markdown source file mermaid. Bear in mind that the Mermaid code is
with the Mermaid code is called rendered with the help of the JavaScript library used in
use_cases.md. The use of the shortcode file (https:Z<unpkg.com/mermaid@
autonumber enables you to specify 8.2.3/dist/mermaid.min.js) and not by Hugo itself.
the part of the sequence diagram
you want by using a number. Go scripts
This section presents a Go utility that generates
Mermaid and Hugo Mermaid code, but you can use any programming
The Hugo (https:Z<gohugo.io) language you want to produce Mermaid code. The utility
framework offers support for reads a CSV file with two columns and creates a
Mermaid code. This section Markdown file with a title and a pie chart in Mermaid
presents such as example where we format. The first column in the CSV file is the label and
MICR0:BIT
he BBC micro:bit is an open-source micro adaptable, and a fraction of the size, ideally to be used
for one free unit for each Year 7 pupil. The idea was that
every child could keep their micro:bit for free and
The micro:bit features 25 LEDs, two programmable
buttons, as well as a non-programmable button, an
accelerometer, magnetometer, Bluetooth Smart
OUR .7 develop a taste for coding. Technology and five Input/Output rings that are ideal for
Certain UK readers might remember the original attaching things like motors and buzzers with crocodile
EXPERT BBC Micro from our school days (1981-1994), an Acorn clips. The unit is specifically designed for Blocks (a
Calvin Robinson computer used for programming in BASIC. The JavaScript editor) and Python, although it is also
is a former micro:bit is its spiritual successor, designed to be cheap, possible to program it with Free Pascal, Simulink, C_ ,
assistant Forth, Lisp, Rust, Ada and Swift. You can even run
principal and Zephyr OS on it.
Computer For this tutorial, we're going to be coding in Python.
Science teacher There are a number of editors available for the micro:bit,
with and a degree including some simulators that will emulate the
in Computer micro:bit hardware, so owning a unit isn’t a barrier to
Games Design entry. Visit https:Zfmicrobit.org/code/ and click Let’s
and Code’ at the top of the page for access to the Python
Programming Editor. The editor Mu is a great native GUI interface
BSc (Hons). (https:Zfcodewith.mu/), whereas uFlash and
microrepl are command line options. There’s also a
mobile app for iOS/Android from the official micro:bit
website. For this tutorial we’ll be using the platform at
https:Zfcreate.withcode.uk/ as it provides a fancy
simulated micro:bit tool to check if our code is
functioning before exporting it onto the physical device.
We're going to program some basic walkie-talkie
devices that send messages from one to the other. We
can send pre-coded images and lines of scrolling text
between micro:bits at the press of a button.
QUICK TIP The micro:bit supports Bluetooth (BLE) and radio
IF you make
transmission, but BLE isn’t supported by MicroPython
a mistake in (the version of Python running on the micro:bit), so for
your code, keep that reason we'll be using radio implementation to make
an eye on the our micro:bits communicate with each other. There’s no
LEDs. Micro:bits limit to the number of micro:bits that can send/receive
have their over radio transmission, other than the usual 2.4GHz
own debugger signal traffic congestion. We would therefore
built in, so the
recommend experimenting with no more than a handful
error will scroll
of micro:bits to begin with (two is fine), and perhaps
across the LEDs,
keep them in the same room until the code is fully
starting with the
line number.
functioning, so you can rule out the possibility of walls
or objects interfering with the signal.
QUICK TIP
Using crocodile
clips on 0 and
GND, you can
attach a pair
of headphones
or speakers
and introduce
sound to your
micro:bit.
Import the
music module
and play music.
xmastree = Image("00500:00500:05550:55555:00500:")
while True:
if button_a.was_pressed():
display.show('A')
radio.send(xmastree)
As basic as pixel
if button_b.was_pressed():
art goes - a 2-bit display.show('B')
pine tree. radio.send(xmastree)
» SIGNAL STRENGTH
Micro:bits transmit some specific information every time we send or
receive data over the radio. If we use radio.receive_full() instead of
radio.receive(), we’ll get the message as a tuple, including the
message content, signal strength and a time-stamp. The signal
strength (RSSI) will be displayed as a value between OdBm and
-255dBm, with 0 being the strongest and -255 the weakest signal.
Now we can create all kinds of treasure-hunt games by triangulating
the radio signal. By setting one or multiple micro:bits up so that they
constantly send a radio message on low power, we can create a
receiver that can parse the incoming message and then display
the signal strength:
Simulation of two-way communication over the micro:bit radio. while True:
message=radio.receive_full()
incoming = radio.receive() if message:
if incoming: strength = message[l]+100
display.scroll(incoming) displaystrength = (int((strength/10)+l))
sleep(lOO) display.show(str(displaystrength))
Our ‘while’ look is constantly looking out for an A or B sleep(200)
button press but also for any incoming messages. We’ve else:
set these messages to automatically scroll across our display.show(Image.NO)
LEDs. It might be beneficial to clear the screen first with Now, the closer we get to the transceiver the higher our signal
display.clear(). You may also decide to display.show() strength will be. We could make this into a game by designing an
the message instead of scrolling it, depending on image for hot and another one for cold, then displaying these images
whether you plan to show images or text. We’ve found as we move around. Every time the number rises we could display the
that text scrolls nicely but images are usually better to hot image, signalling that we’re getting closer, then displaying the
just pop up straight away with a display.show(). Again, cold image when we’re moving away. The build-in commands
add a sleep timer to the end of our loop to save Image.YES and Image.NO would display a tick and a cross, to help
processing power. make things even easier.
To take things to the next level, we could introduce a Display.show(Image.NO)
transition - a message to let the user know an incoming
message has been received, before showing it. That way,
the user has less chance of missing the message, which extremely limited storage capacity and only room for
could easily happen if the text starts scrolling over the one single HEX file.
LEDs without prior warning. As soon as the copying process is complete, the
if incoming: micro:bit will be running your Python code. Either keep
display.show(alertlmage) the micro:bit plugged in via USB or provide power with
sleep(lO) a portable battery pack. Then press either the A or B
display.scroll(alertText) button to begin. E9
sleep(lO)
This would require a little setting up, before the
‘while’ loop:
alertimage = Image("00500:00500:00500:000000:009
00:")
alertText = "Incoming message:"
If you haven’t got two micro:bit devices, you can test
all of your code on the https:77create.withcode.uk
website, simulating communication both ways. Provided
your code has imported the micro:bit module, turned on
the radio and has a loop waiting to receive and
display the incoming message, you can send yourself a
message with the radio test tool. Make sure you’re using
the same channel number (anything between 0 and
100), and send some test data (preferably a simple
string). It should scroll across your simulator micro:bit
LEDs. You can also press the fake buttons on the
micro:bit image and they should function as intended.
When you’re happy with your code, download the
HEX file. Once that’s done, plug your micro:bit device
into your computer using a Micro USB cable; it should
automatically mount. Next, simply drag the HEX file
onto your micro:bit’s drive space. It should override any
previously installed HEX file, since the micro:bit has
Pi PROJECTS
Jonni Bidwell with the help of Tom’s Hardware
bring you the best in Raspberry Pi-based fun.
e do love the Raspberry your desktop, and small enough that
In association with
tom’sHARDWARE
w " '^1
Raspberry Pi is not only one of the world’s
most popular computers - it’s also one of
the most important. Originally designed to help kids
learn about technology, this inexpensive, single-board
system is the leading choice for makers, developers
and hobbyists who want to do everything from
building industrial robots to setting up retro arcade
machines. Whether you’re aged eight or 80, if you
love technology then the Raspberry Pi is made for
you - and there are models ranging from £5 to £65
to suit any budget.
Whatever you do with your Raspberry Pi, you're
going to need an SD card with an operating system on Cheap power supplies are another cause of errors. The latest
it. The official Raspberry Pi OS (formerly Raspbian) is a For older model Pis these are less of a problem, but the incarnation of the
Pi, the 400 model,
popular choice and in many cases is a great start for Pi 3 and above really do need a good 5.2V or they'll be
embodies a Pi 4,
many projects. It’s available in Desktop and Lite flavours subject to CPU throttling and instability. The Pi 4 has also pictured,
at www.raspberrypi.org/software/operating-systems. switched its power input from micro USB to USB-C, and within a keyboard.
There’s an official Raspberry Pi Imager utility that you unfortunately this new port isn’t USB-C compliant. So if
can use to write this (or a selection of other OSes) to an you use a fancy smart charger, it probably won’t power
SD card, or you can use the NOOBS tool. We favour the device, and might possibly damage it.
Balena Etcher, which has the advantage of being able to You won’t run into these issues if you use the official
handle compressed images. charger, so do that. If you’re opposed to that, we’re told
that cheaper USB-C cables (ones that lack the smart
Troubleshooting charge chip) work fine. Cheaper chargers should work
Throughout this feature we’ll use a few different OS too, but they may not be so reliable, so caveat emptor.
images, so we’ve made a handy guide to writing them We’ve handpicked some fun, useful and interesting
below. If you run into difficulties, it’s always worth projects to showcase the tremendous scope of things
remembering that a faulty SD card might be to blame, that can be achieved with the humble Pi. From retro
so it’s worth trying a different one if things go wrong. gaming to machine learning and Bitcoin, the possibilities
are truly endless...
O boienoElcb«f O Q
ft balena Etcher
Q 2O21Ol..Jte.Jme
WNk rou het WMrtf ov. tc/ne projects
Flash. Flawless.
(boot, roods)
« t-
Flash OS images to SD cards & USB drives, safely and easily. Decompressing... Su
* ■■ r I
g|
■ — —-
Browse projects
Select drive
r
Image recognition
Get into machine learning and train your Pi to recognise and classify
other Pis, without having to write a single line of code.
X Axis Y Axis Z Axis the service named EI_PROJECTJD and paste the
Visualization layer 1 v Visualization layer 2 v Visualization layer 3 Project ID value from the Dashboard.
Select Devices from the left column menu in your
• apple
• bird BalenaCloud, and click Add device. Select your Device
• cat
• plant type (Pi 4, Pi 400 or Pi 3).
• raspberry pi 3 <
• raspberry pl 4 Select the radio button for Development. If using
• raspberry pi zero w
• vase
cd
c.
o
□
Wi-Fi, select the radio button for Wi-Fi+Ethernet and
Once you start
cu
enter your Wi-Fi credentials. Download your customised
gathering datapoints balenaOS image and write it to an SD card (you can do
(images). Edge Impulse this using our guide to Balena Etcher on the first page)
can explore and graph
the so-called Features
oF the data. Connect the hardware
Remove the microSD card from your computer and
insert it into your Raspberry Pi. Attach your webcam or
Select Model testing in the left column menu. Click Pi Camera and then power up your Pi. Allow 15 to 30
the top check box to select all and press Classify minutes for your Pi to boot up and BalenaOS to update.
selected to test your data. The output of this action will Only the initial boot requires the long update. You can
be a percentage accuracy of your model. If the level of check the status of your Pi Balena Cloud OS in the
accuracy is low then we suggest going back to the BalenaCloud dashboard.
Data Acquisition step and adding more images or Identify your internal IP address from your
removing a set of images. Select Deployment in the left BalenaCloud dashboard device. Enter this IP address in
menu column and select WebAssembly for your library. a new browser Tab or Window. Place an object in front of
Scroll down (the Quantized option should be selected the camera. You should start seeing a probability rating
by default) and click the Build button. This step may for your object in your browser window (with your
also take three minutes or more, depending on your internal IP address). Try various objects that you
amount of data. entered into the model and perhaps even objects you
didn’t use to train the model.
Setting up BalenaCloud
Connection over BalcnaVPN O
Instead of the standard Raspberry Pi OS, we’ll flash balena Cam + • edge impulse
model’s accuracy for that item in the Edge Impulse Model Testing tab.
You can add more photos by following the Data Acquisition steps and
then selecting Retrain model in Edge Impulse. You can also add more
items by labelling and uploading in Data Acquisition and retraining the
model. After each retraining of the model, check for accuracy and then
redeploy by running WebAssembly within Deployment.
If you want to go further with machine learning, you might want to
check out the Pimoroni’s new BrainCraft HAT for the Pi 4. It features a
240x240 TFT IPS display for inference output, slots for camera
connector cable for imaging projects, a five-way joystick, two
microphones, audio outputs and much more. Most importantly, it has a
controllable fan to keep the thing cool, what with all the never-ending
TensorFlow computations.
Multi-room Pi audio
Get your Raspberry Pis in sync, audibly throughout your home.
LL'Ll
■■ ■ I 3.5mm audio jack. Wait for your Raspberry Pi BalenaOS
5TWi
11 'wlW
Pevi^r
■J^dlEln-g 111 C
£
Logs jl ■ • a
update and confirm all systems are running.
5*
ITtvKt MUffSt
ViriAbteii
Ltfiiui Kiji
C
From your smartphone, tablet or computer, navigate
On|i fr. iEtl
ft
A4EICH1.TU
&■.!£ nriMhr’i
■ .vtarv hudi!
and pair it to your device. Connect the device as the
La.PEI licitJ-.Sil
Locition
St.fl,I fl © HaUA-lSa J I
L IP
sound output for your smartphone, tablet or computer.
il ,HTJH’|F yrl
Nn 1.ip7i i r*
Go to your streaming service and play a song. The music
WfjTl ‘i
should stream via Bluetooth to your Raspberry Pi and
play from the attached speaker.
4
» MULTI-DEVICE/MULTI-ROOM SYNC
For multi-device sync, repeat the setup DJing from your smartphone, tablet, or
stages we described above for each extra computer like a pro.
device. You can flash the same image from If you’re an audiophile you probably won’t
earlier if you’re using the same model of care much for Bluetooth audio, or indeed the
Raspberry Pi. With the same Bluetooth headphone output on the Raspberry Pi.
device connected as mentioned earlier, Fortunately there are a variety of DAC (digital
music can now stream to all Raspberry Pis analogue converter) HAT boards that enable
and their connected speakers. You will only faithful audio reproduction for not much
need to connect one Pi via Bluetooth to your money. IQaudio has been part of the Pi
phone, tablet, or computer to stream to all community since 2015 and we've long been
Raspberry Pi Balena Sound speakers. a fan of its range of DAC and amplifier
That’s it! You can now create multi-room/ boards. Now IQaudio is part of Raspberry Pi Breathe life into unused bluetooth speakers
and old amplifiers with Balena Sound.
multi-device sound experiences in your and those boards are being added to the
home with your Raspberry Pi devices while range of Raspberry Pi products.
Gaming on RetroPie
Turn your Raspberry Pi 4 (or 3 or Zero) into a retro gaming rig
with RetroPie and dubious internet downloads.
ack in the 1980s and 1990s, the arcades grab the latest image from https:Z'retropie.org.uk/
days are now sadly behind us, but retro gaming has
download and use Etcher. Either way, there are separate
editions for first-gen devices (the original Raspberry Pi
and Pi Zero), multicore devices (the Pis 2 and 3) and the
ten-pence coins as we pursued that high score. Those
latest Pi 4 or 400 models. Eject the microSD card and
seen massive growth in the past decade. insert it into your Raspberry Pi 4. Next, plug in a
Using a Raspberry Pi, you can run a variety of controller. Xbox One and PlayStation 4 pads are
emulators that enable you to play not only old-time compatible with RetroPie via Bluetooth, but require a
arcade games, but also your favourite titles from many USB connection until Bluetooth is configured.
old consoles, including the Atari 2600, NES, Power on the Raspberry Pi and wait for your
Nintendo 64, Sega Mega Drive and Game Boy. There are controller to be detected. Configure your controller.
Note that you probably will have fewer buttons on your
controller than RetroPie asks you to configure. Just hold
TUCK INTO A SLICE OF RETROPIE I down a button that you’ve already configured to skip
past any options you don’t need. Press the A button on
“Using a Raspberry Pi, you can run a your controller to close the configurations menu and
open the main menu.
variety of emulators that enable you to
Adding games To RetroPie
play arcade and console games.” I All the games exist as files called ROMs, which are
dumps of real boards or cartridges. The easiest method
a number of emulation platforms available, but RetroPie to add games is to use a USB stick to transfer the files
is by far the most popular and arguably the best. from your computer to your Raspberry Pi. It's important
Up until recently, installing RetroPie on a Raspberry to note that games from retro consoles are under
Pi 4 was a pain. Even though Raspberry Pi 4 came out in copyright no matter their age. If you don’t personally
June 2019, RetroPie didn’t officially support it for nearly own the cartridge/board and rip a copy of your own,
a year and there were some manual steps you needed downloading and distributing these ROMs may violate
to take to make it work. Now, not only can you install laws in your country, so proceed at your own risk.
RetroPie on a Raspberry Pi 4, but you can do it using the On your computer create a folder called retropie on a
Raspberry Pi imager. It couldn’t be easier. You can also FAT32/exFAT-formatted USB flash drive. Plug the USB
flash drive into the Raspberry Pi 4 and RetroPie will
create a folder structure inside the retropie/ folder on
» WELCOME TO THE PICADE the stick. Remove the flash drive and insert it into your
computer. Copy your games to the correct system or
Pimoroni’s Picade arcade cabinets have a long history of quality. console folder in retropie/roms/. For example, put
Coming as a laser-cut, self-assembly kit in eight- or ten-inch screen Atari 2600 games in the Zatari2600 folder. Eject the
sizes, Picade is easy to build and can be used with all models of flash drive and place it back into a USB port of the
Raspberry Pi, but for best results you’ll want a Raspberry Pi 4. Raspberry Pi 4. How long this will take depends on how
Because Picade uses common arcade components, it can be many games are transferred over: a matter of minutes
customised to meet your playing style and aesthetics. If you like for a few games; hours if transferring a large amount.
microswitched buttons and joystick then When complete, remove the USB flash drive and
you can easily swap to get the edge in press START. From the menu select Restart
your favourite game. The Picade X HAT Emulationstation/Restart System. The games list will
attaches to the GPIO of your Raspberry Pi now update and show the available computers/consoles
and provides connections for the controls, for which there are now games. Bear in mind that, when
USB-C power management and an audio it comes to playing retro arcade games from actual
DAC connected to a 5W speaker for arcade machines, not all ROMs are compatible with all
authentic arcade audio. Everything you emulators. RetroPie can run with ten different versions
need to build your own arcade cabinet - of MAME (Multiple Arcade Machine Emulator), the most
just add a Raspberry Pi! A DIY kit with popular arcade emulator, and some ROMs will run on
step-by-step instructions to build, wire some versions of MAME and others will work on others.
and configure a custom cabinet offering a The Picade is the perfect desktop RetroPie maintains a handy chart over at https:/''
slice of retro gaming heaven. I
or bookshelf distraction. retropie.org.uk/docs/MAME, but if your arcade games
don’t load in one MAME, try another.
Environment sensors
With sensors and data and neat tidy cables, that’s how our garden grows.
Bitcoin Node wi
Make the Bitcoin network a bit bigger and
better with a Pi and a large storage device.
ou’re not going to get rich mining Bitcoin on
I
blockchain, so get yourself an external SSD.
instantly rather than subject to the Lightning nodes and penalise them. CPU load 4.19, 3.59, 2.42, temp 58’C 136’F
Free Mem 1483M / 1939M HDDuse 316G (37%)
median six-minute confirmation time Lightning nodes are connected to SSH [email protected] dl4.0MiB u5.7MiB
that is part of the Bitcoin fabric. blockchain wallets, and these must bitcoin V0.20.0 mainnet Sync OK 100.00%
It’s possible to generate some income contain sufficient funds to cover any Public dhqukwv5cgy2r45w.onion:8333 11 peers
by running a Lightning node, but not off-chain business. If malfeasance is LND 0.10.4-beta wallet 0 sat
0/0 Channels 0 sat 0 peers
necessarily something you should jump detected, a so-called Justice Transaction Fee Report; 0-0-0 sat (D-W-M)
into unawares. Since the network lacks is initiated and funds are docked. If your You can use Onion (Tor) routing to keep the IP
the democratic (but lengthy) consensus node accidentally goes offline while a I address of your Lightning Node a secret.
YOU NEED
> Raspberry Pi 3B+, 4 or Pi Zero W
> 8GB (or larger) microSD card
> Raspberry Pi Cam, HQ Camera, Infrared
Camera or webcam
> Monitor/power supply/HDMI cable
Learn how to build your own
motion-triggered home security camera.
Upload Movies ON
Raspberry Pi with a camera into a home
Upload Service ✓ FTP Server
video-monitoring system, where the photos and videos Server Address SFTP Server
can either stay on your device (and home network) or, if Server Port I Google Drive
Location Google Photo
you choose, be uploaded automatically to a cloud Include Subfolders Dropbox
storage service such as Google Drive or Dropbox. Username
Password
Here, we’ll show you how to set up a Raspberry Pi
Test Service
security camera with MotionEyeOS. This software
works with almost any Raspberry Pi (connected to the
internet) and almost any webcam or Pi camera. There’s on the Pi screen. Alternatively, you can find this out
no fancy coding to be done in this project; it just works. from Nmap or your router’s configuration page.
Download the latest version of MotionEyeOS Enter your internal IP address into a browser window
corresponding to the model of Pi you’re using from and MotionEye should start streaming.
https:Z<github.com/ccrisan/motioneyeos/releases and
write it to the SD card. When the process completes, Configuring MotionEye
physically remove and then reinsert your microSD card. Click the Profile icon within your browser menu to pull
We do this because the software automatically ejects up the Login screen. Log in using the default credentials.
the microSD card when the process completes, but we The username is admin, and the password field should
need to add one file before the next step. be blank. Select your Time Zone from the drop-down
Create a new file named wpa_supplicant.conf with menu in Time Zone. Click Apply. MotionEye will reboot
the this text, replacing "YOUR_NETWORK_NAME" and which will take a few minutes. This step is important as
"YOUR_NETWORK_PASSWORD" with your details: each photo and video is timestamped.
country=gb The Frame Change Threshold setting determines the
update_config=l proportion of pixels that change before recording starts.
ctrl_interface=/var/run/wpa_supplicant The intent is to set your percentage low enough to pick
network={ up the movement you’re tracking, but high enough to
scan_ssid=l avoid recording a passing cloud. In most cases, this is
ssid="YOUR_NETWORK_NAME" achieved through trial and error. Start with your default
psk="YOUR_NETWORK_PASSWORD" 4% Frame Change Threshold and then move up until
you reach your optimal setting. Click the down arrow to
Save the file, eject the SD card and insert it into your the right of Still Images to reveal extra settings. Do the
Pi. Connect your camera, monitor and power supply to same for Movies. Set Capture Mode and Recording
your Raspberry Pi and power up. If you have a monitor Mode to Motion Triggered and choose an appropriate
connected, your Pi’s internal IP address will be displayed period to preserve both. A week is reasonable if you’re
working with an 8GB card. Click Apply to save changes.
Set your Camera Name, Video Resolution and other
options in the Video Device section. Click Apply to save
your changes. On the live feed view you’ll see new
buttons for viewing saved images and video.
In the current setup this media won’t leave your local
network. But if you’re okay having your media in the
cloud then it’s easy to set MotionEyeOS to upload to
Google Drive or DropBox. Alternatively, you may want
to enable remote access to your Pi security cam. You’ll
need to configure port forwarding on your router to do
This Raspberry Pi security camera can be used to record porch pirates, this. If you do this there are official iOS and Android
I monitor children or pets, or to watch out for burglars. apps so you can check your home when you’re out. B3
Mike Bedford explains how to get the most from the Raspberry Pi HQ
Camera and learn the basic principles of photography at the same time.
k
w 2020 (which we scored a commendable 8/10
J in LXF264), it introduced something very
Unlike RPi’s
previous
cameras, the HQ
» F-STOPS EXPLAINED
It’s easier to remember something if you 16mm lens, at f/4 the iris shutter will odd-looking sequence f/1.4, f/2, f/2.8,
understand the principles, rather than have a diameter of 4mm. This, of course, f/4, f/5.6, f/8, f/11, f/16, f/22.
just learning by rote. Because f-stops, explains the apparently contradictory The fact that the f-stop is a ratio of the
which are the measure of aperture, aren’t fact that a large f-stop number implies a diameter to the focal length means that,
immediately understandable, here’s what small aperture and vice versa. Because to have the same aperture, a telephoto
you need to know. the amount of light a lens can admit lens must have a greater diameter than a
The way f-stops are written might depends on its area, and the area is wide-angle lens. You can see this by
seem strange. However, it’s really very proportional to the square of its diameter, comparing the two official HQ Camera
simple. An aperture of f/4 means that the we can now see why at f/8 a lens admits lenses. Despite the 6mm lens having a
diameter of the lens - as reduced by the a quarter of much light as f/4, and why slightly larger maximum f-stop of f/1.2
iris shutter - is the focal length divided the sequence of f-stops relating to a than the 16mm lens's f/1.4, the 6mm lens
by 4. So, in the case of the HQ Camera’s halving of the amount of light is the is smaller in diameter.
of the sensor,
shutter speed by altering the aperture. This might into a casing as part of a project, it makes sense to think
it would be
involve an element of trial and error, but you’ll soon about mechanical stability.
wrong to believe
learn how to achieve the effect you want, and don’t The HQ Camera has a tripod socket, and it would be
that12MP
sensor will only
forget that the shutter speed selected by raspistill's good to mount it on a tripod. A small cheap tripod might
provide 3MP automatic exposure will be recorded in the EXIF data be perfectly adequate for use on your desk while
performance in the image file. testing, although if you want to use it in the great
when used with outdoors, as discussed later, you’ll need a taller one. If
a 3MP lens. Getting started the HQ Camera is mounted on a tripod, the associated
Setting up your HQ Camera to work with a Raspberry Pi RPi will end up dangling from the ribbon cable.
board involves plugging its ribbon cable into the camera Since that cable is nowhere as robust as a USB or
socket of the devoce and HDMI lead, and nor are the associated on-board
enabling it using the sockets, this is best avoided by bolting the camera
raspi-config utility. This is module and the Raspberry Pi board together. Hardware
all well described in the is available to achieve that and it doesn’t cost much -
official user see, for example, mounting plate from The PiHut that
documentation so we’ll costs £3 - but if you order the camera from a supplier
If you’re limit our advice to what that doesn’t have the mounting hardware it might not
experimenting
might not be as well be difficult to make one yourself, depending on what
with the HQ
Camera, it makes documented. If you’re you have available. You’ll need a small sheet of plastic,
sense to attach it going start out using the onto which you can mount the HQ Camera on one side
securely to your HQ Camera on your and the Raspberry Pi on the other. You’ll also need eight
Raspberry Pi to
desk, perhaps as a short bolts, eight nuts, and spacers of some sort - you
prevent strain on
the ribbon cable,
learning exercise or to can see the one we made in the photo (on the left).
and to mount it on get to grips with the This will be enough to get the camera up and running
a tripod. camera before building it on your desk, where you’ll have access to a mains power
» CLOSE-UP PHOTOGRAPHY
CREDIT: Joe Ravi.
Commonly, lenses will focus to infinity, but is a misnomer because it’s a simple lens that
they won’t enable you to focus on close-up enables you to focus on closer objects. They
objects, which makes photographing small come in various strengths, measured in
things difficult. We tested out the two official diopters. 1,2,4 and sometimes 10 diopter
lenses. The 6mm was a surprise since it’ll filters are common and can be bought in sets
focus down to just a few millimetres from the of the three or four strengths, which can
front of the lens. That’s not very useful, used singly or in combination. The 16mm
though, because you can’t illuminate lens needs filters with a 37mm thread. We
anything so close to the lens, although tested out the 16mm lens with a combination
focused to a practical minimum distance of of a 2 and 4 diopter close-up filter - because
10mm, the field of view is 15mm wide. The we had them at hand - and were able to
16mm lens is more typical, having a focus down to 11mm, at which point the
minimum focus of about 55mm, and at that horizontal field of view was about 5mm. A set of close-up filters makes it possible
to photograph small objects. This set has
distance the horizontal field of view is 22mm. Yet another option is to use C/CS
too large a thread for the official 16mm
Like most C/CS lenses, the official lenses extension tubes, which separate the lens lens, although if you already have larger
have filter threads at the front which means further from the sensor, thereby decreasing filters for use with a DSLR, you could use
that you can screw on a close-up filter, which the minimum focussing distance. a converter.
I small aperture, Right: small depth of field/large aperture. unscrew the thumbscrew on the focus ring.
Now, while holding the thread or the aperture ring,
EVs (exposure
values] or,
colloquially,
supply and a monitor, and room for a keyboard and rotate the aperture ring. As with the 6mm lens, this
stops. A change
mouse, but if you want to start photographing the world focusing action will cause the lens to become longer or
of 1 EV involves
at large, you’ll need to devise a more portable solution. shorter. To adjust the aperture, tighten the thumbscrew
a doubling or a
For a start, you’ll need a small LCD panel that will act as on the focusing ring and unscrew the thumbscrew on halving of the
the viewfinder, and you’ll need some sort of battery the aperture ring. Now rotate the aperture ring but this amount of light.
power supply. All of that will need building into an time, it’ll adjust the aperture and again you can observe
ergonomic case, of course, and you’ll probably want to that by looking through the lens. Unlike the 16mm lens,
connect a push-button to act as the shutter release. the f-stops aren’t labelled, and the minimum aperture is
Many such projects have been published based on the with the iris shutter fully closed.
earlier camera modules, and you could adapt one of Once you know how to operate the lenses, you can
these, the main change being the mechanical attach them to the HQ Camera so you can see how
arrangement required to house the larger HQ Camera. adjusting the focus alters the distance at which objects
The other thing you need to know is how to use will be sharp, and how the aperture adjusts the depth of
raspistill, the command line utility that enables you to field. Both these effects can easily be seen if you use the
control any of the official Raspberry Pi cameras. There’s preview facility in raspistill. However, if you have both
no shortage of documentation, but to start we suggest lenses, we suggest you start with the 16mm to better
using raspistill -t 0 which won’t actually take a photo see depth of field in action, because telephoto lenses
but which will display a preview so you can try out the have a smaller depth of field than wide-angle lenses. You
manual controls on the lenses. You can terminate the won’t be able to preview blurring due to the
preview using Ctrl-C. consequential change in shutter speed this way though,
because the preview window shows a moving image.
The official lenses This is quite different from the still images that raspistill
Of the two official lenses, the 6mm one has a CS mount, can capture. To see motion blur in action, therefore,
while the 16mm one has a C mount. Confusingly, they you’ll have to capture some still images. E3
both have the same thread, so it’s quite possible to
attach either directly to the HQ Camera. However,
because C and CS lenses focus to a sensor at a different
distance behind the lens, if you’re using a C mount lens
you must use the adapter that’s supplied with the
camera. Failure to use the adapter with the 16mm lens,
or using it with the 6mm lens will mean that you can’t
focus properly.
Before attaching either of the lenses to the HQ
Camera, you’ll probably find it useful to get some
practice using the lenses’ manual controls. We’ll start
with the 16mm lens which is the most intuitive. You’ll
notice there are two rings, each of which has a
thumbscrew. Unlike an ordinary camera such as DSLRs,
with which you’ll regularly be changing the aperture and
focus, these lenses are intended for CCTV use, so they
enable the rings to be locked to prevent accidental
adjustments. Unless you’re using it for some
unattended application, though, it makes sense to use
the 16mm lens with both the thumbscrews unscrewed,
but not so far that they’ll fall out.
The focusing ring is the one with the FAR and NEAR lf you look through a lens while you adjust the aperture control, you’ll clearly see the iris shutter
labels, and as you rotate it, the lens will become longer I open and close to increase or decrease the amount of light admitted to the camera.
BACKUPS
w
k_______ J
piece of computing hardware, the Raspberry Pi
isn’t without its problems. One particular
however. For a start, there’s the volume of storage space
required for multiple images. You should also consider
bugbear is the device’s reliance on flash storage - the amount of time required for the initial image
potentially unreliable SD and Micro SD cards that are creation. Simply having a clone of a fresh Raspberry Pi
prone to data corruption following an unscheduled OS install is pointless, because that’s essentially what
shutdown or restart. you can download directly from raspberrypi.org.
One way to avoid this is to ensure that the Pi is shut Instead, the image should be the underlying operating
Christian down carefully. But it also pays to have a backup of your system together with the key software that you want to
Cawley data, just in case the worst happens. Raspberry Pi has use, along with the data you have saved to the device.
is known as The several options for backup, from cloning the Micro SD Some challenges might be faced with cloning your
Gadget Monkey card to remotely backing up over SSH. Raspberry Pi. For example, a 16GB disk image can't be
because he eats a cloned and then written to an 8GB SD card. However,
banana for Clone Wars you may also run into problems cloning a 16GB image
breakfast, The ability to switch Raspberry Pi projects simply by to another 16GB SD card, because of differences in
microwave chips swapping Micro SD cards means that if a card is found quality-control standards.
for his lunch, and to be corrupt, you can flash an image of its contents to a There may also be some difficulty booting a
a Raspberry Pi replacement. Cloning the SD card is a smart option that cloned disk image on a different system. For example, a
for dinner. enables you to keep a library of ready-to-use Pi images backup that’s been created on a Raspberry Pi 4 will
on your PC’s hard drive, ready for deployment. almost certainly not work on the Raspberry Pi Zero.
Just think of the time you can save. All your favourite However, if you keep in mind basic issues of
software installed just once; Wi-Fi networks already compatibility and file size, then cloning your
Rather than fiddle configured; SSH enabled, ready to use. Where once you Raspberry Pi for back-up purposes should be plain
around with the would reinstall and reinstall, changing numerous sailing. Cloning the SD card can be done on a desktop
odd command
settings to get things just right, cloning the SD card PC or on a Raspberry Pi.
in the terminal,
you can clone means that you can customise Raspberry Pi OS, get
Raspberry Pi SD things working how you like them, and then make a The clone heads
cards with Etcher. copy to use over and over again. To create a clone of your Pi’s SD card on a desktop
computer, all you need is the cross-platform flashing
CUMr tool, balenaEtcher (http:Z^bit.ly/LXF287-etcher).
Download and install this on your desktop system and
then insert the Pi’s Micro SD card into the PC's reader.
You should also have a second Micro SD card
connected ready to write to. Failing this, a USB flash
stick. Writing to a system drive isn’t possible without
first creating a dedicated partition.
Click Clone drive and select a Source. Click Select,
rluM
(WCAL9C0Q ...RCCALBCOO
then Select target to choose the target drive. This
should be the second Micro SD card. Once again, click
Select to confirm, then Flash to commence. Wait while
the software writes and verifies the data. You’ll notice
that it’s possible to flash the data to multiple devices if
you need to. You can also clone the Pi’s SD card directly
to your HDD. This is useful if you only have one SD card
but plan to run multiple Raspberry Pi projects.
SENSEHAT
Les Pounder blasts off with another tutorial showing how a versatile
HAT board can answer all your questions, and even be run in space!
Project 1: Hello World Inside the loop we have a single line of code that will
The first project with any new piece of tech or software scroll our message, with red text and a white
is “Hello World”. It proves that our kit is working, and background. Each step in the scroll lasts 0.1 seconds.
that everything is ready for us to move further. The first sense.show_message(message,text_colour=red,
project is a simple scrolling message that will prove our back_colour=white,scroll_speed=0.1)
software and hardware works. In your preferred Python We now reach the except part of the code. This is an
editor, Thonny IDLE, Mu or a text editor, create a new file exception handler that is activated if we press Ctrl+C to
and call it text_scroll.py. Remember to save often! end the code. When that happens we instruct the Sense
Our first two lines of Python are an import that HAT board to clear:
imports the sense_hat class from the SenseHat module. except Keyboardinterrupt:
We then create an object that enables us to easily use sense.clear()
the class. Save the code and run via your Python editor. Thonny
from sense_hat import SenseHat and Mu have a run/play button. IDLE uses F5 or via the
sense = SenseHat() Run menu. ‘Hello world’ should now scroll across the
The next two lines are tuples - data storage LED matrix. When finished, press Ctrl+C - this
structures which can be created and destroyed but clears the matrix.
YOU NEED never updated. These tuples store the RGB colour
> Any 40-pin values for a particular colour, in this case red and white, Project 2: Magic 8-Bal I
Pi model red = (255,0,0) The Magic 8-Ball is a classic child’s toy. Ask a question
> SenseHAT white = (255,255,255) out loud (“Will my online delivery be left in the hedge
> Raspberry The message to scroll across the screen is stored as again?”, “Am I the only one who can empty the
Pi OS a string inside a variable called message. dishwasher in this family?” or “Is there anything worth
> Code: message = "Hello World" watching on TV tonight?”), then shake the 8-ball. In a
https://github. We now enter a loop, and to start the process we few seconds a message floats to a viewing portal, ready
com/lesp/ start a try and except handler. Any code inside the try to read. With the Sense HAT we can make a modern-day
LXF273- section of the loop is what our project will attempt to version, which uses raw data from the accelerometer to
SenseHAT/ run. In this case it’ll launch an infinite loop. determine that the 8-ball has been ‘shaken’.
archive/ try: Create a new Python project in your favourite editor,
main.zip while True: call the project 8ball.py and remember to save often.
RASPBERRY Pi
STREAMING
Camera-shy Jonni Bidwell conquers his fears
as he harnesses the power of OBS Studio to
stream live to his. er. three followers.
emg an online broadcaster is an expensive undertaking, but you world. You can even run it on a Raspberry
has been a legitimate really don’t need any fancy hardware at Pi, and it works great in tandem with the Pi
profession for some years. all to get started. Many a YouTuber Foundation’s High Quality Camera.
But the pandemic fuelled a started out using just their laptops. But why stop there? Thanks to Owncast,
surge in aspiring home streamers. And Software-wise, the open source OBS it’s remarkably easy to self-host your
despite the ongoing relaxation of Studio is by far the most popular choice. It streaming. All you need is enough
measures, the home streaming wave provides an intuitive interface that makes it bandwidth to support your audience. With
shows no sign of breaking. Whether it’s easy to manipulate scenes and add effects even a modestly fast upload speed you’ll
repairing washing machines on YouTube, during recording. And it can stream to all be able to host a few dozen viewers. And if
playing Doom on Twitch or just ranting the most popular platforms (as well as a you don't, then take Owncast off-world and
on Facebook Live, there’s abundant whole bunch we’d never heard of, and run it on a virtual private server. As long as
diversity in the things people are some we could have done without hearing your stream can get from OBS to Owncast
broadcasting, and tuning into. Setting up about). We’ll show you how to get the most smoothly, then the mass transport all
a professional recording studio at home out of that and start broadcasting to the takes place in the cloud.
The hardware and infrastructure you’ll need to get your stream live.
dam Curtis’s seminal 2002 documentary OBS 27.0.0-modlfied (llnux) - Profile: Untitled - Scenes: Untitled
The Century of the Self highlighted how File £dit View Profile Scene Collection Tools Help
the past decade we’ve seen this appeal to the ego hbhyNRRNy
hWWM hyyyyMMWMh
jrHRfWy
hHNRlM
: Adwat?*
: Va»w [GTK7/1]
1 Yatu [GT12/1]
used to direct not just purchases, but politics too. We I am not a robot 0-HKHy
yyy
w.ei.e rnc qji
misprint. And just because we’ll show you how to put a T Text (FreeType2 O A Mic/Aux
• ———
0.0 dB
Studio Mode
Settings
» STREAMING VS RECORDING
We’re going to concentrate on ‘live’ recording simultaneously. This is mostly a Audacity
livestreaming in this feature, but you might concern for patchy Wi-Fi connections.
prefer to record your show, do some edits The OBS setup wizard can optimise for
install
and retakes, then upload it. OBS Studio is recording from the get-go, which means it’ll
just at home recording as it is streaming - drop frames from the stream before it does
you just need to make sure you have enough so for the recording. Once you’ve got your
disk space. At the default bitrate video recorded, the non-linear video editor
(2,500kbits/sec) an hour of video will KDEnlive is great for editing it. You’ll need
occupy just over a gigabyte (plus more for plenty more space for this though as
audio). If you're recording to another working with large videos tends to produce
machine (say, over your LAN via Samba ) lots of temp files, as well as the finished Never let an opaque data collection policy
then make sure there's enough bandwidth product. You might also want to treat audio get in the way of a quality audio editor.
for this, especially if you’re streaming and separately, using Audacity, for example. Audacity is widely available.
ets start by trying desktop OBS before Well, that’s not strictly true. In order to talk to the
resolutions to that of the camera, so that it appears full Pl Window Capture (Xcomposite) O
_ 40 46 M
A____________________________ —_____
Jb -36 Xi -25 30 15 10 K 0
screen. Video is sent to the streaming platform at the I In no time you’ll be adding beagles and interdimensional portals to your livestream.
r hile we were planning this feature, a little Pi from scratch, the SSH service is disabled by default.
occasionally paradoxical
multi-room antics.
Next, we approached the
Raspberry Pi Foundation which
kindly sent us an 8GB Raspberry
Pi 4, a High Quality Pi Camera and a
6mm lens. There’s another official
lens (and a whole bunch of unofficial
ones): the telephoto model, which is
slightly pricier, but also less suited
for streaming unless you are
shooting distant objects. It’s easy
enough to set all this up (again,
check out page 110) but if you're
using the 6mm lens then remember
to remove the CS-mount adapter
that comes attached to the HQ
camera module, otherwise you’ll
never be able to get it in focus.
Stay Focused apt-dance and machine reboot. Welcome to the future. Media Sources has
all kinds of options.
This lens has two manual adjustment rings - focus and Now download the build.sh file from the GitHub, make it
We couldn’t get
aperture - which lock closed with the helpfully provided executable, and run it with the hardware
screwdriver. If you’re not used to manual lenses, it can $ wget https://github.com/xbelanch/0BS4Pi/raw/ acceleration box to
be tricky to get the hang of, but you can set up raspivid main/build.sh work, though.
exactly as we did earlier and see if you’re going in the $ chmod 755 build.sh
right direction. Our advice is to start by pointing the $ ./build.sh
camera in the direction of where you want to film, then Your Raspberry Pi will take an awfully long time to do
adjust the aperture ring until it looks like enough light is this, and you might find that it gets fairly hot. Besides
getting in (and do take care to ensure that there's OBS, the script compiles custom versions of FFMPEG
enough light, too; it's not a night vision camera). Then (SRT transport support isn’t included in the regular
screw the aperture ring to fix it in place and adjust the
focus until it’s crystal clear.
Speaking of focus, remember that it’s possible to THINKING BIG WHILE GOING SMALL
adjust the focus on the standard Pi camera, too. On
older models you need to be a bit brave scraping off the “There’s no official build of OBS Studio
glue around the lens, but then you’ll find it rotates quite
freely. Then you can get it focused right up close for a for the Raspberry Pi, but it’s open
macrovision stream of your bird box. Pimoroni sells a
handy lens adjustment tool for this, as well as all kinds source so we figured let’s just have
of lenses for both camera models.
To finish, we thought we’d do something a little a go at compiling it ourselves”
adventurous. After all, we had one of the most powerful
Raspberry Pis in the known universe in our possession. version) and all the associated codecs. If it completes
There’s no official build of OBS for the Pi, but it’s open without error, you should be able to start OBS from the
source so we figured let’s just have a go at compiling it command line. We didn’t download the launcher from
ourselves. You might be able to do this on a Pi 3 as well, Xavier’s GitHub, so the instructions to use it won’t work.
but you’ll need a swap file because 1GB of RAM isn’t Try running the obs command directly,
going to cut it. And it’ll take a very long time. There's a though - you’ll see an error about invalid
thread all about this on the OBS forums at https:Z^ OpenGL contexts, because OBS isn’t
obsproject.com/forum/threads/obs-raspberry-pi-build- familiar with the Pi’s video capabilities. To
instructions.115739, so check there if you run into any get around this, force the OpenGL version
difficulties. Things tend to break often, because updates to something respectable with
in both Raspberry Pi OS and the OBS source code itself $ MESA_GL_VERSION_OVERRIDE=3.3 obs
stop the two from playing nicely together. or indeed download Xavier’s launcher.
An awful lot of packages need to be installed before And there you have it - streaming from a
we can begin, and it wouldn’t be terribly useful (for our credit-card-sized mini-computer. Why not
paper readers who can't copy and paste) to list them see if you can get it working with a
here. Instead we’ll use Xavier Alonso’s rather excellent microphone HAT. Or a thermal camera. Oh,
script which you can find at https://github.com/ and big thanks to Alex Blake and The Raspberry Pi
xbelanch/0BS4Pi. You’ll need to upgrade to the just- Foundation for sending us all that useful equipment. If
released Bullseye edition of the Pi OS to start. To do this we become a famous influencer streamer-type we'll be
edit /etc/sources.list and change all references of sure to give you some exposure and a shout-out in any
buster to bullseye . Then do the ol' update, upgrade upcoming awards ceremony.
Further, faster,
free-er streaming
Discover what else OBS can do, then cut the corporate
cord and host your own stream with Owncast.
O
it’s time to look further at what OBS can
do. We won’t tell you how to make a good
broadcast. Like we mentioned before, we’re far from
experts, so we’d encourage you to watch some
popular streamers yourself and take some notes on
what they do well that you enjoy.
We’re big fans of DistroTube on Twitch, so if you’re
planning a Linux-themed channel you could do a lot
worse than following his example. Clicking in the Scene
Collection box is easy during live broadcasts, so if your
Scenes are all set up nicely before you start you won’t It’s so easy to get started with Owncast - even your garden variety
have to fumble around switching between sources and
clumsily repositioning them on the fly. Once you’ve got
kitchen goblins can do it.
I
the hang of Studio View then it’s easy to do smooth name (the text of the caption itself is reasonable),
inter-scene transitions on the fly, too. and then type in some text. And format it to your
To see what that’s about, hit the Studio View button heart’s content. If you use Comic Sans then someone
and you’ll see two panes. Preview, on the left, shows the somewhere will judge you for it, but please, stick to your
Scene that you’re planning, and Program on the right guns. The chat log mode enables recent IRC (or other)
shows what you’re streaming (if indeed you’re doing logs to be displayed, but if your streaming platform has
that). Some basic transitions (Cut, Fade and Fade to its own chat platform, this can be added through
Black) are available by clicking the cog icon next to the View>Docks>Custom Browser Docks. Alternatively, if
Transition button. Add some transitions, then rearrange you set up Owncast (which we’ll get to in a moment)
some sources in the preview window. Use the slider to then that has its own chat interface.
overlay the new scene manually, or hit the button to do It’s also possible to capture your desktop, or a
Adding a it smoothly. Simple. We haven't covered what kind of particular window and use that as a source in OBS. To
transparent other media sources you might be fading into or out capture the whole screen, use the Screen Capture
BPYTop window of, so now would be a good time to look at that. (XSHM) source. You can capture individual screens or (in
to your stream is the advanced settings) a separate X server entirely. To
You can add sources by clicking the + in the Sources
perhaps not the
best monitoring
panel. The simplest source is Text (Freetype2) which capture a window, use Window Capture (Xcomposite).
solution, but it enables you to add captions to your videos. Choose that You can crop captures arbitrarily, which is useful for
looks cool. option, select Create New, give the source a sensible showing the currently playing Scene. Remove any
Filters for ’Window Capture (Xcomposite)'
sources you don ’t need with the minus button, and use
the Scene Collection to collate sources into chapters.
Menu BATl
16:29:32
custom features too. If you wanted to jazz up your game
20Mmt
nHESFr 57*C C
Exit
will now be installed in your home directory and you can •J LIVE 00.00.00 • REC 00.00 00 CPU. 12.3%, 30.00 tps
start it as follows:
$ cd owncast In order for viewers to connect to your stream, port Use ProjectM to
$ ./owncast 8080 of the machine running Owncast will need to be produce glorious
visualisations
Now you can point your browser to http:Z^ open. This means that you’ll need to brave your home
(a la Winamp] For
localhost:8080 (or the hostname or IP of the remote routers settings here. Port 1935 needs to be open for your audio.
machine you installed it on). You should see the Owncast OBS to connect to it over RTMP You can change these in
interface, complete with chat. The first thing you should the settings, but remember that we’re running
do is change the default streaming key (it’s abcl23 ), Owncast as a user here, so you’re not allowed
otherwise anyone on your network could hijack your to claim port 80.
channel before it’s even begun. Or anyone on the If you want HTTPS - and you probably do
internet if your machine is accessible from there. So go for anything other than testing purposes -
to the admin page at http:Zdocalhost:8080/admin and then it’s a little complex. The recommended
change the stream key (which is also the password) in way is to use a reverse proxy. You might
the Server Settings section. You can also change the already have one set up, but if not you’ll find
site’s name, logo and description to suite your instructions for doing so on Apache and Nginx
personality or purposes. at https:Z^owncast.online/docs/sslproxies. It’s
In order to get OBS talking to it, go to OBS's Settings, also possibly to use the Site.js server
and in the Stream section set the service to Custom. For administration tool to install Owncast as a
the server use rtmp:Zdocalhost/live (replacing localhost service with a simple flourish at the command line.
with wherever Owncast is running) and use the stream Exactly how many users you can stream to depends
key you set up earlier. Now if you start streaming in OBS, on your bandwidth and chosen resolution. We found that
and head over the Owncast page, you should see a 1,500kbps (kilobits, not kilobytes) stream was
yourself. Plus you’ll get some idea of the latency you’re sufficient for our purposes, and since we allegedly have a
dealing with. 20Mbs upload speed (fibre is good, traffic-shaping
Speaking of which, you can configure latency in policies might not be) that should accommodate a
Owncast’s settings panel - it’s tempting to turn dozen or so users. That turned out fine for our party, but
everything down to microseconds, but unless you have if you have more than 12 friends (lucky you!), or would
a very low-latency connection to your viewers this will like to stream more bits to them and faster, then you can
result in buffering. For most purposes it really doesn't install Owncast on a VPS and have OBS connect
matter that things happen a few seconds before the remotely to it. Owncast also supports object storage
internet sees them. You’ll get used to people in the chat providers, so (for a small investment) you can outsource
taking a while to respond to your superbly delivered the heavy lifting to the likes of Amazon S3, Backblaze or
jokes and witticisms (we’re still waiting). Digital Ocean Spaces. E3
» COPYRIGHT CONCERNS
Budding disc jockeys, mix masters, but the hope of being vindicated in a broadcasting Major Lazer on repeat
selektas and soundpeople may be couple of days is little recompense for would very much be public performance.
tempted by the self-hosting option your broadcast being shut down. And if you look on Major Lazer (or
because it obviates the problem of We're not lawyers, but if you host a anyone’s) CDs it says “not licenced
automated DMCA takedowns that stream and only tell people you know for public performance”. In the UK
plague other platforms. Many a Twitch about it (and certainly if it’s password you’d need to apply to PPL PRS for an
streamer has found their streams muted protected) then that seems pretty much appropriate license. In the US ASCAP,
or stopped altogether because they had like an extension of your front room and BMI and SESAC hold performance
something that sounded like copyrighted you’d expect to be able to play what you rights to most pre-recorded music.
music playing in the background. There like there. But setting up a massive Oh and there's different licences for
are fair use exceptions to these things cluster of Owncast instances, publicly performance and synchronisation. Did
and copyright strikes can be contested, advertising it on Facebook and then we mention that we’re not lawyers?
GAMING
Connect, configure
and use gamepads
Planning some Raspberry Pi gaming? Christian Cawley shows you
how to set up a game controller either natively or with an emulator.
your Raspberry Pi-based retro gaming system. Configure Bluetooth to accept connections from Bluetooth game
A good selection of game controllers can be
connected to your Raspberry Pi using USB.
■ controllers, then trust the MAC address to enable easy reconnection.
Christian Furthermore, some well-known controllers can also be this is a well-designed, multi-purpose controller that can
Cawley linked up using Bluetooth. be easily connected to a Raspberry Pi, either using USB
A freelance writer In theory, all controllers should work with a or Bluetooth.
and editor Raspberry Pi. This covers everything from generic USB To connect the Xbox One controller to your Pi using
specialising in joysticks and joypads to the latest Bluetooth devices. USB, start by updating and upgrading Raspberry Pi OS:
consumer So, you can expect to be able to connect an Xbox One sudo apt update
electronics, who controller and a PS4 controller to your Raspberry Pi. sudo apt upgrade
is still finding pine Controllers designed for the PlayStation 3 and Next, connect the controller. Try it out with a game,
needles in his Xbox 360 will also work, as will Nintendo gamepads. perhaps Minecraft: Pi. The driver for Xbox One
Raspberry Pi. Own a PlayStation 5? The new Sony console features controllers should be built in - if not, use
a major revision of the much-loved game controller. But sudo apt install xboxdrv
despite being fresh out of the box in 2020, the PS5 Follow the instructions to install the driver, reboot the
controller will easily connect to a Raspberry Pi over Raspberry Pi, and try again.
Bluetooth, just like its predecessor. Using a wireless Xbox One controller with the
Meanwhile, Xbox Series S and X controllers are Raspberry Pi is a little more complicated. Two types of
YOU NEED backward compatible, and can be used on an Xbox One wireless Xbox One controller have been released. One
> Raspberry console. The new controller design should also work uses wireless, while the second requires Bluetooth. How
Pi 3 or later with the Raspberry Pi. can you tell which is which?
> Popular In this tutorial, we'll look at what you need to do to If your Xbox One controller has Wi-Fi, the plastic
game connect the most widely used game controllers to a around the Xbox button is the same colour as the top of
controller Raspberry Pi: those intended for the Xbox One, PS4, the controller where the triggers and shoulder/bumper
> Raspberry Xbox 360 and PS3 consoles. We’ll begin with the Xbox buttons are. Bluetooth Xbox One controllers, meanwhile,
Pi OS One, which boasts one of the most popular game have a single-coloured face. So, the plastic around the
> USB cable controllers available. Also compatible with PC games, Xbox button is the same colour as the rest of the
controller face.
To go in-depth you can open the battery
compartment. Here, the model number is listed: 1697
means it is a wireless controller, whereas 1708 indicates
a Bluetooth model.
Most game
If you have the 1697 wireless model, you’ll need to
controllers will
connect to the
connect the official Microsoft Xbox Wireless Adapter to
Raspberry Pi using your Raspberry Pi. This is a standard USB dongle that
Bluetooth or USB. should work out of the box. Simply hold the pairing
For wireless Xbox buttons on the adapter and the Xbox One controller to
One controllers,
sync, then start playing.
however, you’ll
need a USB For the 1708 Bluetooth controller, you’ll need the
receiver dongle. xboxdrv driver, as described earlier. You’ll also need to
USB game
controllers work
out of the box, but
if you’re not using
RetroPie, Recalbox,
disable ERTM (Enhanced Re-Transmission Mode). While or similar, you’ll
enabled, this Bluetooth feature blocks syncing between need to manually
install the xboxdrv.
the Xbox One controller and your Raspberry Pi.
echo 'options bluetooth disable_ertm=Y' | sudo tee -a I
etc/modprobe.d/bluetooth.conf r QUICKTIP
Follow this by rebooting the Pi
sudo reboot Don’t lumber an
old Raspberry
Pi Model B/
Start Bluetooth tools B+ board with
sudo bluetoothctl a Bluetooth
At the [Bluetooth]# prompt, enable the agent and set dongle-it will
it as default: slow things
agent on Make a note of the MAC code, then disconnect the down. Instead,
default-agent PS3 controller. You’re now ready to start a Bluetooth connect
Next, power up the Xbox One controller and hold the connection as explained earlier in the instructions for Bluetooth
sync button. Quickly enter: the Xbox One. controllers to
iMPTZ/W ^afZ-tXZAWiW<rT^< THE BEST DIGITAL ART FOR ELM ANO GAMES
ji a a ■ taiMakHi m
Paint Draw
Crochet u WATERCOLOUR
HOb) TO C^TUXi-C
u^rtfr With ^il.^
a
NEW!
INSIDEAPJIST’S
FftWlC'
DINOSAURS
L INCLUDED j
step-by-step
tutorials from
artists and
Discover how to
illustrators bring your artistic
creations to life
TOWUI KW • HHMIHl • IB8Y 80&MK • MOMIDHIUW • i IKRf
NEW! NEW Uncover th* ikdk you need to nuitrf painting w*th ecry Scs
PROJECTS
«tep-by-step
tutorials
INCLUDED
Learn and
AvtxvV*»to
Key painting
techniques
urtfeeeli |«jr rrw
in-depth
expert
workshops with drawing
Advice for
and colouring
Cotour theory Essential kit Core skills Unique effects -fhert's activities BOOK FOR KIDS!
NEW
NEW
WbmaniHteeWy
Gel Io grips with key skills, stitches end techniques
and loom how crochet patterns work
ANATOMY
CReaTURes
AMAZING AMIGURUMI PATTERNS
TO MAKE WONDUTVUV
WFIRD ANIMALS
130
Tf&V
ADVKX
Paint&Draw
Beginner's Guide to LNiMAML
DRAWING
FEATURES ♦ WORKSHOPS ♦ INTERVI
WHAT YOU
TO KNOW
COMU
SKETi
Get great savings when 1000s of great titles, many World-wide delivery and
you buy direct from us not available anywhere else super-safe ordering
NEW! 132 pages of expert advice and mdcpth tutorials
0 W.77MA7T GUII>E TO
Paint Draw
PORTRAITS
TO TRY Artist
secrets
• wua> acdon- START TODAY! on illustrating
PACCft> AWW
HOMEWARE realistic beads
HOOPS TOYS
VWMMT nuts IN
CUP srv&o PAtNT GIFT IDEAS
FASHION CROSS STITCH
PATTERNS
INCLUDED!
CUSHION
DESIGNS
TSCHOOLi BLANKETS
EVERYTHING YOU NEED TO CREATE
CRAFTS
_ COSY THROWS FOR YOUR HOME
BtAUTMUl BLAMUH
*O« TM WMOll
k FAMILY TO -
IHK>r
IMPROV!YOUR
PAINTING TODAY (RIGHT & (OLD SWHT DRE AMS
big book of
NEW!
Paint&Draw
Beginner's Guide to
educ.
CROCHET PAINTING .
«JOS of
arf nps STITCHES step-by-step
tutorials
Ln'
FIND INN£R PtMt
THROUGH THe
Take up a <\POh^ OF ART
hobby with
G£? h>MD AMJ CUt AM
arrwR exA«<CTrPi and
gnaw
Imktf.ee/futuretooUxIne*
Guitar‘
farlvgw.vYa
www.magazinesdirect.com/creative
Magazines, back issues bookazines
Delivered direct to your door
or straight to your device
ALONSO
TTie Anfield hero's
I everkusen title bid
&WHIT
O Perfect mono conversion
HEALTH
RETREATS
wu//enjoy!
HOWTO
GOOD Nj
LOVE THE
YOU'RE
£11
I a Cotswold restoration
How tooth ers: our animal heroes
ever star
over Ai Middle-earth
« IAJiqq|G-G3Ujj
|IGL?I OHL 3Uinj5J| JJGLOG2
jq 9 cou/AO|q lgzlol’jxjou
Choose from over 8o magazines and make great savings off the store price!
Binders, books and back issues also available
Simply visit www.magazinesdirect.com
No hidden costs Shipping included in all prices @ We deliver to over 100 countries Q Secure online payment
FUTURE
magazinesdirect •com
Official Magazine Subscription Store
FROM THE MAKERS OF THE NUMBER ONE LINUX MAGAZINE
ULTIMATE
PROJECTS
Expert guides For
open-source enthusiasts
r-------------------------------------------------------
GOOGLE
Whether at home orn the doud. your photos deserve a new host
PHOTOS
Jonni Bid well .hows you hov
to tr uly make »t your’ owi i
'hrfaafvm’wwmccMtoMfld
f • eB MMMm < IMlu
'Me
l*
«
eM
e ee>t' l«Mit Brew
Se»W««aeM mw m<m< .Me mA *« — W
Ml urtona wmv ’rwT -rt* MM mM
• OMMNB Mb
W«M
*
—> — •• OIM— • • »— *«■ Me
eMS, »«|H eeyeneM
m— M 4 —mb
OW MM* *
M MRf14 MB Mt «4l
CM M OmmMm «Mk> Mrt «
*
» —•
WaMrWMWBMU
*
MM M MM —••• MM r
11 * * f
* —•
re—e ——■ r» 4«yNe—mum
MtXM»Ml MRW • UM Mm W ms - •
M—fc R * « *
i ;iw<4Mw re M rBe
KEEPING IT SIMPLE
BUILD A SMART A smart home office? PLUG & PLAY Get your kit ready
HOME OFFICE Take a look at some great tools that can make a smart home
smart, and a home off <e. er. office Pi PROJECTS Pt*( ww your USB cjfol
*s
* ftnubetry hprqvct Ime
IV
SO rarrts and » cup nt twi
l Wiseguy Jonni Bidwell has some tips on making Jormi Bidwcl . ,th the hefc ot Torn?. Hardware
\ our Ixxnes and home offices smarter. Dr ma you the best m Raspberry
W^k with the latest FOSS offerings.
B O O K A Z IN E
Flash Fhwless.
0«—MHflrfcB
•M , I Mm
O
w II I
IftalMlMMi W0C4MWWVB t *
>
AM MB Ml mhm m
VMWrt oM V» VMlto B wMrt >
■< mwwo—
ram
—are
* wrt tn association with I—a * ** •» — 4—• ••
M
rB
«MeAM,tr
* V»
•e tafKV M vm tom'sHAPDWARE