Tag Archive for Tutorial

The MagPi, Issue 77

The MagPi Issue 77If you’ve ever wanted to tackle an electronics project but didn’t quite know where to start, my latest article for The MagPi Magazine should get you up and running: it’s a look at resources for learning beginner-level electronics.

Centred, naturally enough, around the Raspberry Pi itself, my feature walks through a number of different resources: books, including Phil King’s Simple Electronics with GPIO Zero, all-in-one electronics kits of components and project sheets, online courses, and video tutorials for everything from connected LEDs and switches to the Raspberry Pi through to core concepts surrounding precisely what electricity is and how it works.

As with all Raspberry Pi Press publications, The MagPi Issue 77 is available for free download under a Creative Commons licence from the official website, or you can pick up physical copies in your favourite newsagent, supermarket, or from the comfort of wherever you are right now via the Raspberry Pi Press Store.

The Official Raspberry Pi Beginner’s Guide

The Official Raspberry Pi Beginner's GuideToday sees the release of The Official Raspberry Pi Beginner’s Guide, my latest educational book on the remarkable single-board computer and its software and the first to be made available for free download and redistribution courtesy of a Creative Commons Attribition-ShareAlike-NoCommercial licence.

Written in partnership with Raspberry Pi Press, The Official Raspberry Pi Beginner’s Guide walks newcomers through a tour of the Raspberry Pi and what it can do, setting up both the hardware and the software, learning how to navigate the Raspbian desktop, how to write programs in Scratch 2 and Python 3, and even building custom circuits that use the Raspberry Pi’s general-purpose input-output (GPIO) header. If that weren’t enough, there are chapters on using the Sense HAT add-on board, the Raspberry Pi Camera Module, and a handy list of additional resources for when you’ve finally exhausted the book itself.

While it’s my name on the cover, this book is very much a team effort. I’d like to thank everyone at Raspberry Pi Press who was involved in its creation, from the authors of the original projects pulled in and updated in this new publication to eternally-patient project editor Phil King, fantastic technical editor Simon Long, amazing illustrator Sam Alder, and a whole host of others without whom the book would be nowhere near as good as it has turned out.

The book is available to buy now in all good newsagents, supermarkets, and bookstores, or direct from Raspberry Pi Press. The digital edition, as a Creative Commons-licensed PDF without any digital rights management (DRM) restrictions, is available from The MagPi website now.

Custom PC, Issue 183

Custom PC Issue 183In Hobby Tech this month, there’s a look at a project which has genuinely transformed my mornings, a tiny temperature-controlled soldering iron with a hackable firmware, and the latest brain-melting program-’em-up from Zachtronics.

Starting with the game first, Exapunks caught my eye as soon as I saw it announced by developer Zachtronics. Taking the assembler programming concept of earlier titles TIS-100 and Shenzhen-IO, Exapunks wraps them up in a 90s near-future cyberpunk aesthetic alongside a plot driven by a disease called “the phage” which turns victims into non-functional computers. Because of course it does.

Anyone familiar with Zachtronics’ work will know what to expect, but Exapunks really dials things up. From the puzzles themselves – including one inspired by an early scene in the classic film Hackers – to, in a first for the format, the introduction of real though asynchronous multiplayer on top of the standard leaderboard metrics, Exapunks excels from start to oh-so-tricky finish.

The MiniWare TS100 soldering iron, meanwhile, sounds like it could be straight from Exapunks – or, given its name, TS-100: a compact temperature-controlled soldering iron with built-in screen and an open-source firmware you can hack to control everything from default operating temperature to how long before it enters power-saving “sleep mode.” While far from a perfect design – and since supplanted by the TS80, not yet available from UK stockists – the TS100 is an interesting piece of kit, with its biggest flaw being the need to use a grounding strap to avoid a potentially component-destroying floating voltage at the iron’s tip.

Finally, the project: an effort, using only off-the-shelf software tied together in a Bash shell script, to print out a schedule of the days’ tasks on my Dymo LabelWriter thermal printer. Using the code detailed in the magazine, the project pulls together everything from weather forecasts to my ongoing tasks and Google Calendar weekly schedule – along with a word of the day and, just because, a fortune cookie read out by an ASCII-art cow.

All this, and a variety of other topics, is available in the latest Custom PC Magazine on newsagent and supermarket shelves or electronically via Zinio and similar services.

Custom PC, Issue 180

This month’s Custom PC Magazine sees my Hobby Tech column take a look at TheC64 Mini, a rather annoyingly-stylised recreation of the classic Commodore 64, experiment with Raspberry Pi-powered cluster computing via GNU Parallel, and drink a toast to the memory of the late and lamented Rick Dickinson.

First, Rick. Best known for having been Sinclair Radionics’ – later Research, still later Computers – in-house industrial designer, Rick is the man responsible for the iconic look of the ZX80, ZX81, Sinclair Spectrum, and Sinclair QL, among other devices. While blame for their keyboards lies further up the chain, Rick did the best with his instructions to the point where his designs are still immediately recognisable today. Sadly, Rick had been in ill health of late, and recently passed; my article in this month’s magazine serves as a ode to his memory.

TheC64 Mini, then, feels like a bit of an insult, being as it is the modern incarnation of a device from US Sinclair rival Commodore. Created by Retro Games Limited – not to be confused with Retro Computers Limited, creators of the two-years-late-and-counting ZX Vega+ handheld console, but rather a separate company formed by a split between RCL’s directors present and former – TheC64 Mini appears, at first glance, to be a breadbin-style Commodore 64 that’s been shrunk in the wash.

While deserving plaudits for actually existing, unlike the ZX Vega+, TheC64 Mini isn’t exactly a stellar success: inside its casing, which is dominated by a completely fake keyboard, is a tiny Arm-based single-board computer running Linux and a hacked-around version of the Vice emulator. Its emulation suffers from input lag, something RGL originally attempted to blame on people’s TVs before releasing an update which reduced the problem without completely fixing it, and the bundled Competition Pro-style joystick compounds the problem by being absolutely awful to use courtesy of a rubber membrane design that should have been left on the drawing board.

Finally, the cluster computing tutorial walks the reader through creating a multi-node cluster – of Raspberry Pis, in this instance, though the tutorial is equally applicable to anything that’ll run SSH and GNU Parallel – and pushing otherwise-serial workloads to it in order to vastly accelerate their performance. In the sample workload, which passes multiple images through Google’s Guetzli processor, run-time went from 1,755 seconds in single-threaded serial mode to 125 seconds running on the eight-node cluster – housed in a Ground Electronics Circumference C25 chassis, because if you’re going to do something you should do it in style.

All this, and the usual selection of other interesting articles, can be found in your nearest newsagent, supermarket, or electronically via Zinio and similar digital distribution platforms.

Custom PC, Issue 179

Custom PC Issue 179This month’s Hobby Tech column takes a look at an open-source microcontroller-driven hobbyist oscilloscope and a book which aims to document art in video games, while also walking readers through the rather handy trick of setting up a reverse SSH tunnel.

First, the tutorial. Since Code42 announced that CrashPlan Home, my chosen off-site backup solution, was being discontinued, I’ve been looking into alternatives. A Raspberry Pi with a USB hard drive and a copy of Syncthing installed does the job nicely, except for the issue of management: once it’s off-site, I’d have to configure someone else’s router to forward a port so I can SSH into it. An easier alternative: a reverse SSH tunnel.

Where a traditional SSH connection goes from local device to remote host, a reverse tunnel goes from remote device to an intermediary device – in my case, a home server on my own network. Your local device then also connects to said intermediary device, and you have full access to the remote device regardless of whether or not it’s behind one or more firewalls or even whether you know its public-facing IP address.

The first of the reviews, meanwhile, is a little cheeky: while the device on test is based on the JYE Tech DSO138 open-source oscilloscope design and firmware, I’ve been using a clone rather than an original – having spotted it on offer during an Amazon sale and been unable to resist a bargain. While the conclusions I draw on the scope’s functionality and usability apply equally to both, a first-party JYE Tech version is likely to feature better build quality and certainly includes better support.

Finally, my review of the coffee table tome – yes, another one – Push Start: The Art of Video Games is one of those rare occasions where I’ve been disappointed by what should have been a product aiming for a very low bar. While the full-colour hardback publication includes plenty of high-quality pictures, it also includes some extremely low-quality screenshots as well – particularly noticeable at the beginning where vector games are captured as bitmaps using MAME’s default ultra-low resolution, and at the end where tell-tale artefacts show the use of third-party JPEG images rather than first-party captures. Worse still is the limited accompanying text, which is riddled with errors.

The latest Hobby Tech is available now from newsagents, supermarkets, and electronically via Zinio and similar digital distribution services.

Custom PC, Issue 174

Custom PC Issue 174This month’s Hobby Tech column takes a look at a very special eight-byte – not a typo – microcomputer, walks through turning a spare Raspberry Pi into a Nav Coin-mining cryptocurrency machine, and looks forward to the launch of the ZX Spectrum Next with a look at a deep-dive book detailing the original Spectrum’s neat Ferranti Uncommitted Logic Array (ULA) chip.

First, the Mini C88. Designed by the multi-talented Daniel Bailey as a more affordable version of his C88, swapping the field-programmable gate array (FPGA) on which he implemented his own processor core design for an Arduino Zero and the extremely clever Dynamic Binary Translation (DBT) technique, the C88 is designed to be about as simple as a computer can get. Based on a custom instruction set, the C88 has just eight memory locations of eight bits apiece and is programmed by toggling each bit using a series of pleasingly tactile switches while monitoring the process on the 8×8 LED matrix that serves as its display.

For regular readers, this will all sound familiar: the original FPGA-based C88 and its 32-byte bigger brother the C3232 were the subject of an interview back in Issue 155. While Daniel has still not turned the C88 into a kit you can head out and buy, the Mini C88 is definite progress in that direction – and, as always, anyone interested in the project should hassle him about it on Twitter.

For those with a Raspberry Pi and a desire to play with cryptocurrency, meanwhile, this month’s tutorial will be of definite interest: a guide to turning a Pi into a ‘Stake Box’ for the Nav Coin cryptocurrency. Designed as an alternative to Bitcoin, Nav Coin offers those who run network nodes rewards in the form of a five percent return on their coin holdings when locked up in this manner. Taking less than an hour to set up and requiring nothing more than a low-powered computer, it’s a great way to get involved – and the Nav Coin project itself definitely one to follow.

Finally, while waiting impatiently for my ZX Spectrum Next microcomputer to land – which, I’m pleased to say, has since happened – I enjoyed a re-read of Chris Smith’s excellent The ZX Spectrum ULA: How to Design a Microcomputer. Based on interviews and deep-dive analysis, the book investigates the tricks and techniques which allowed Sinclair Computers to build the ZX Spectrum micro at such a bare-bones cost – which, in turn, was thanks to clever use of an Uncommitted Logic Array (ULA) chip from Scottish electronics giant Ferranti. Effectively a write-once version of the modern FPGA, Ferranti’s ULA saw the number of components in the ZX81 drop to a quarter compared to the ZX80 and is key to how the ZX Spectrum does what it does.

For all this, and a bunch of other interesting things by people who aren’t me, pick up a copy of Custom PC Issue 174 from your nearest supermarket, newsagent, or digitally via Zinio and similar services.

Custom PC, Issue 171

Custom PC Issue 171This month’s Custom PC magazine has a bumper crop for fans of Hobby Tech: a four-page shoot-out of do-it-yourself handheld games consoles on top of my usual five-page column, which this time around looks at setting up Syncthing on a Raspberry Pi, building the Haynes Retro Arcade Kit, and my time running a soldering workshop at the Open Source Hardware User Group (OSHUG) UK OSHCamp gathering.

The workshop first: organiser Andrew Back got in touch with me shortly before the OSHCamp workshop day, held in Hebden Bridge as part of the annual Wuthering Bytes technology festival, was due to take place. The scheduled soldering workshop was at risk, he explained, as the person due to run it was no longer available. I was happy to help, and I’m pleased to report a great day was had by all assembling Cuttlefish microcontroller kits – despite the use of some particularly ancient soldering irons with tips which appeared to be made of freshly-hewn coal!

The Haynes Retro Arcade Kit feels like a device which could have been in the DIY console shootout, but it wouldn’t have fared well. Designed by Eight Innovation and slapped with the Haynes brand, the Retro Arcade Kit is a fiddly and distinctly unrewarding soldering kit which ends up as a particularly basic version of Pong. The coin activation system is its only redeeming feature: two pieces of thick solid-core wire sit side by side, and are shorted out by an inserted metal coin to start a fresh game. Not an original trick, but one well implemented – if you ignore the terrible instructions and poor build quality.

Syncthing, meanwhile, has been a mainstay of my toolbox for years. An open-source project designed to keep files on two or more computer systems synchronised, Syncthing is built with security and convenience in mind – and works a treat on the Raspberry Pi. Given that I was needing to find a new home for my off-site backups anyway, as my regular provider CrashPlan is ceasing its cheapest product line, it seemed natural to write up the process of turning a Pi and a USB hard drive into an off-site backup destination.

Finally, the four-page DIY console shoot-out is a reprint of the same feature as it appeared in PC Pro Issue 277 in mid-September. As before, four Arduino-compatible devices are covered: the Gamebuino, MAKERbuino, Creoqode 2048, and Arduboy.

All this, and the usual selection of things written by others, can be found at your nearest newsagent, supermarket, or electronically via Zinio and similar distribution services.

Custom PC, Issue 167

Custom PC Issue 167This month’s Custom PC features a look at the effect of compiler optimisation on applications plus reviews of Google’s AIY Voice Kit for the Raspberry Pi family and Jimmy Wilhelmsson’s Generation 64.

The tutorial, to begin, stemmed from investigations I was carrying out into Google’s Guetzli perceptual JPEG encoder. Having cut my teeth in computing back when every byte – never mind kilobyte – really counted, I have a soft-spot for compression both lossy and lossless. Over the years I’ve toyed with a range of compression algorithms, from LZMA and Robert Jung’s ARJ through to the clever if short-lived Fractal Image Format (FIF). Like most, though, I eventually settled on two popular formats for my image compression needs: JPEG where lossy compression is acceptable and PNG where it isn’t.

Guetzli aims to cut the file size of JPEG files by around a third for no apparent loss in perceived image quality. That was enough to pique my interest, but it comes at a cost: a runtime of minutes per megapixel to recompress each image. As an open-source project, Guetzli is provided in source-code form – so I began to play with the optimisation options available in the GNU Compiler Collection (GCC) to see if I couldn’t speed things up.

As readers of my column will discover, I could indeed speed things up – cutting the time taken to compress the small sample image provided with Guetzli from 14.3 seconds using Google’s precompiled binary version down to just 9.56 seconds. Although not an exhaustive guide to compiler optimisation in general nor even GCC-specific options – a topic which would take a book, rather than a couple of magazine pages, to cover adequately – hopefully the write-up of my experiments will help shine a light on the gains that can be made, the potential pitfalls of excessive optimisation, and the benefits of open-source distribution.

The Google AIY Voice Kit, meanwhile, is something quite special: an add-on for the Raspberry Pi family of microcomputers which, in essence, turns them into a somewhat cut-down version of the company’s Google Home voice-activated assistant platform. Initially distributed with The MagPi Magazine as a cover-mounted giveaway, the kit should soon be available for purchase by the general public – and it’s definitely worth seeking one out.

The kit itself centres around a Hardware Attached on Top (HAT) add-on board, which includes servo and motor control, connectivity for an arcade-style button, and links to a break-out board with a pair of MEMS microphones. Combined with some simple software and a link to Google’s cloud computing platform, the AIY Kit can be made to respond to your natural-language queries or even control external hardware via voice recognition – with some major caveats regarding how often you can use it before you need to start handing over cash for the voice recognition platform.

Finally, Generation 64. Originally written in Swedish by Jimmy Wilhelmsson and with design by Kenneth Grönwall, Generation 64 investigates the influence the Commodore 64 had on the Swedish computing scene – complete with an introduction by the founder of Digital Illusions, also known as DICE, and MOS 6502 creator Chuck Peddle. Translated into English and re-released by Bitmap BooksGeneration 64 is an absolutely fantastic read which I would have otherwise missed had it remained untranslated.

Full details on all of these, plus a bunch more stuff written by people who aren’t me, can be found in Custom PC Issue 167 at your nearest supermarket, newsagent, or digitally via Zinio and rival distribution platforms.

Custom PC, Issue 166

Custom PC Issue 166Readers of my regular Hobby Tech column this month will find a BBC micro:bit-driven tutorial alongside two reviews covering the remarkable Raspberry Pi Zero W microcomputer and the fascinating Delete by Paul Atkinson.

The idea for the tutorial came about while working on a chapter of my upcoming Micro:bit User Guide, and seemed like a perfect fit for the readers of Custom PC Magazine: turning the low-cost yet extremely flexible micro:bit into an addressable USB-connected 5×5 LED matrix and having it display current CPU load in a constantly-updating bar graph. Naturally, the same technique could be used to graph almost anything.

The secret lies in MicroPython’s REPL, an interactive interpreter which can run on the micro:bit and accept commands via the USB serial port. By switching the micro:bit into REPL mode, it can be slaved to another system over USB. The result: the entire program code, written in Python using the serial, time, and psutil libraries, exists purely on the host machine. A quick bit of Blu-tack later, and my monitor was wearing a CPU monitor which worked even when the display was off.

The Pi Zero W, meanwhile, was a device to which I had been looking forward for quite some time. An upgraded version of the original £5 Raspberry Pi Zero microcomputer, the Pi Zero W differs in only one respect: it has a built-in radio module, the same BCM43438 as found on the far larger and more expensive Raspberry Pi 3.

While the addition of the radio module, which offers Bluetooth, Bluetooth Low Energy, and 2.4GHz Wi-FI connectivity, almost doubles the price of the Pi Zero W to £9.60, it’s money well spent. In almost every Pi Zero project I have built, I’ve ended up using a USB OTG adaptor and low-cost USB Wi-Fi dongle to add network connectivity, and having it on-board – even at a slightly higher cost compared to a USB-connected solution – makes life considerably easier.

Finally, Delete. Billed as “a design history of computer vapourware,” Paul Atkinson’s coffee table book is packed with high-quality photographs – and, for the rarer machines, the occasional rescaled JPEG exhibiting unfortunate compression artefacts – covering machines from an upgraded Sinclair QL to a bright yellow IBM that never left the drawing board. Each comes with pages on its history, with interview subjects detailing features and failures alike, and while not all machines were strictly vapourware few are likely to have a place in the average vintage computing collection. In short: if you like old computers you’ll like Delete, which is available now from Amazon and other bookstores under ISBN 978-0857853479.

As always, you can read the whole column and a whole lot more by picking up Custom PC Issue 166 from your nearest supermarket, newsagent, or electronically via Zinio and similar services.

Create, Issue 1

Create Issue 1It’s always nice to see your name in a new publication, and doubly so when it’s the magazine’s very first issue, so imagine my pleasure when Future Publishing’s Create Magazine hit shelves this week and brought my feature on building your own Linux PC along for the ride.

Presently exclusive to North America, Create – styled [email protected] – is billed as offering “adventures in technology” to a mixed audience ranging from those with considerable technical proficiency to relative newcomers. This broad focus can be seen in the content on offer from the launch issue: my relatively technical guide to building a desktop PC from parts sits alongside tutorials on installing Minecraft on an old Apple MacBook and booting up a Raspberry Pi for the first time, along with building your own drone and seeing how camera lenses are made.

The PC-building feature itself was originally written for Imagine Publishing’s Linux User & Developer Magazine and first appeared in Issue 161, alongside my detailed reviews of a number of Steam Machine PCs and my four-page news spread. Written in partnership with Overclockers UK, which kindly provided the parts required for the build, the guide walks the reader through choosing components with an eye on price, performance, and compatibility with the Linux kernel – the latter being a key point that can be overlooked by system builders more used to building Windows-based machines – before putting everything together in an attractive case and installing the operating system.

Those who missed the feature the first time around and are located in North America will find Create Issue 1 on shop shelves now, while international readers can purchase a copy from Future’s web store.