PC Pro

PAUL OCKENDEN

Paul shares his thoughts on the various Raspberry Pi clones before revealing his preferred options for setting up a (real) Raspberry Pi

- @PaulOckend­en

Paul shares his thoughts on Raspberry Pi clones before revealing his preferred options for setting up a (real) Raspberry Pi.

Someone asked me what’s the best way to set up and interact with a Raspberry Pi the other day. That’s one of those questions where there’s no single correct answer, so I thought I’d talk through some of the options in this month’s column.

Although what I’m going to discuss is specific to the Raspberry Pi, much the same applies to many other single-board computers (SBCs), and particular­ly Raspberry Pi clones such as the Orange Pi, Banana Pi, NanoPi, ZeroPi, and the various Pine models.

Incidental­ly, should you buy one of these clones rather than a real Raspberry Pi? Again, that isn’t an easy question to answer. Proper Raspberry Pis are cheap, work well, have good support, and the cost partly funds a charity that works to promote IT learning and making worldwide. By comparison, some of the clones seem to be blatantly copying other people’s ideas, or pushing the boundaries of “open” hardware design to the absolute limit.

So it’s a no-brainer to just get a proper Raspberry Pi? Well, yes and no. Most of the time, I’d say that it’s the right thing to do for the reasons I outlined above, but some of the clones do have advantages over the Raspberry variants, such as built-in eMMC and SATA interfaces for storage or more grunty CPUs. Some have hardware for encoding or decoding digital video without stressing the CPU. A few Pi-sized boards even have low-powered x86 processors rather than ARM, but if that’s a requiremen­t I’m not sure you should be looking at Raspberry Pis anyway.

Some of the clones that you might consider include the ZeroPi (not to be confused with the Pi Zero!) from Friendly Elec. You’ll find more details at pcpro.link/315zero, but it’s a $10 board with an Allwinner H3 quadcore CPU running at up to 1.2GHz, 512MB of RAM and 1Gbit/sec Ethernet. It’s perfect for things such as running a Pi-hole ( pi-hole.net).

Another clone that goes beyond the equivalent Pi can do is the Banana Pi BPI M2 Zero ( banana-pi.org/m2z. html). It’s pretty much identical to the Raspberry Pi Zero W to look at ( see image left). The main difference is with the CPU: the Raspberry Pi Zero W has one core running at 1GHz, while the Banana Pi M2 has four cores running at 1.2GHz, so it’s much faster. But, as with all of these boards, more speed means more heat – that’s just physics. The M2 gets very hot: if you’re using it in anger I don’t think a heatsink is going to be sufficient – you’ll almost certainly need a fan, and to an extent that defeats the object of using such a small board. On the other hand, you might be using it inside an enclosure that’s already cooled or has forced airflow – perhaps inside an existing PC. The other main difference with the official Pi Zero W is that the Wi-Fi on the M2 requires you to plug in an antenna wire because it doesn’t have that fancy triangular resonant cavity design that you’ll find on the Raspberry Pi Zero W, I guess because that would involve paying licensing fees to Proant.

Beyond these clones there’s also a number of really low-powered SBCs, including the various NodeMCU and

Arduino-based boards that I’ve written about in this column over the years. Although there’s a small degree of overlap between these and the Raspberry Pi Zero, in reality they’re quite different things and aimed at quite different uses. If, for instance, I was going to create an IoT sensor to send temperatur­e readings to a home automation system, I might choose one of these cheaper and lowerpower­ed boards, but to run that home automation system itself I’d go for a Raspberry Pi.

The other thing you’ll notice with these lower-spec boards is that they don’t tend to have a display output. In contrast, all versions of the Raspberry Pi (and indeed many of the clones) have some form of HDMI output, whether that’s the full-sized, mini or micro variant, providing a desktop user environmen­t.

Perfect Pi output

Which brings me neatly back to the subject of how to interact with a Raspberry Pi. Let’s stick with that HDMI port, as it provides a lot of flexibilit­y. The quickest and easiest thing you can do is to simply plug it into your television. You might have a spare HDMI socket on the set and, if not, you can always temporaril­y unplug a Sky box or games console. The main thing you need to watch is that you’ve got the right kind of cable, or more particular­ly, that you have the correct plugs on each end. Your TV will almost certainly have fullsized HDMI sockets, so that end of the cable is easy. However, with the Raspberry Pi it all depends which version you have. The various Pi Zero models all use mini-HDMI, whilst the Pi 4 models use micro-HDMI – at first glance they might look similar but the micro plugs and sockets are definitely smaller, as the name implies. All of the other Pi models use full-sized HDMI connectors.

If you chop and change between various models, rather than having a selection of different leads it’s a good idea to stay with standard leads – fullsized plugs at each end – and then use adapters to get down to mini and micro sizes. You’ll find kits of suitable adapters easil y available online. If you want to be absolutely sure you’re buying the right thing, as well as the full-sized, mini and micro monikers, they’re also known as type A, type C and type D respective­ly. You might wonder where type B went, but it’s the name that was given to a dualwidth version of type A, incorporat­ing two digital video channels. I don’t think I’ve ever seen one of these used in the wild, though. Oh, and just for completene­ss there’s also a type E connector. This has a similar size to type A, but the plugs and sockets incorporat­e a locking mechanism. Type E is designed for environmen­ts where vibration and movement is likely to occur – it was originally designed for use in cars, but these days you’ll also find it in aeroplanes and in some touring entertainm­ent stage setups.

What if you don’t want to use your telly? Well, the next easiest thing you can do is connect the Pi to your computer monitor. Most monitors have HDMI inputs these days, and you probably have a spare one so just connect up to that. If you have a fancy monitor, it might even offer a picture-in-picture (PiP) facility, meaning that you’re able to view the Pi desktop and your main computer’s output at the same time. If you don’t have that, there will be buttons on the monitor to flick between inputs. Just be aware that the control systems on most monitors appear to have been designed to come last in a usability competitio­n – you’ll almost certainly end up pushing the wrong button bu more often than not!

Of course, you might not be using a monitor – your main computer could be a laptop. If that’s the case another option is to display the Raspberry Pi desktop as a window on your laptop screen. Now, here’s where a lot of people make a big mistake: there’s possibly an HDMI socket on the laptop, so peop people think you can just plug the aspberry Pi into that. If only it was that simple! The HDMI ocket on your laptop is purely r output – I don’t think I’ve seen a laptop where it could d as an input as well, but I’ve line posts from people who ent hours trying to make it ke that! onnect your Raspberry Pi to C, you’ll need some kind of or external box. There are lots m available for the PC, but on c the “accepted” choice has been the Elgato product line. I have one of its Cam Link dongles and it works well, apart from sometimes complainin­g that it needs to be plugged into a USB 3 socket rather than USB 2, despite sitting firmly in a USB 3 socket!

The main problem with the Elgato product is that it’s ridiculous­ly expensive for what it is. I’m looking on Amazon ( pcpro.link/315elgato) and it’s currently selling for £120. Which is why I was pleased to recently find an alternativ­e. It’s called Eagle Smart ( pcpro.link/315eagle), it works brilliantl­y on both PC and Mac, and at the time of writing it was just £9! The specs are very similar to the Elgato Cam Link, in that it will do 4K video but only at 30fps. The £9 dongle has the same maximum frame rate at 1080p, whereas the Elgato goes up to 60fps at this resolution. So if you want to record your games console output you might be better off with the Cam Link, but for simply connecting your Raspberry Pi to your laptop the much cheaper Eagle Smart is perfectly adequate and, at less than a tenth of the price, the only sane choice. It’s even made of metal where the Cam Link is plastic, so hopefully it will survive rougher handling.

Perfect Pi input

We’ve only looked at output so far – of course, you’ll also need input for the Raspberry Pi, specifical­ly a keyboard and mouse. The easiest way is to use normal USB devices such as you’d plug into a desktop computer. You u can use wireless versions if f you want: many come with a small USB dongle that accepts both the mouse and keyboard input, so you’ll only use one USB socket. For occasional use, I like those little bat-shaped combined keyboards and touchpads that hat are designed for use with h things such as Android

“I’ve read online posts from people who have spent hours trying to make it work!”

“I was using over £200 of keyboard and mouse to control a £10 computer”

TV boxes. They only cost a tenner or so and work perfectly with Raspberry Pis – see pcpro.link/315key.

All of the Wi-Fi equipped Raspberry Pi models (from the current range, that’s everything except the non-W version of the Pi Zero) also have Bluetooth onboard, and you can use this to connect suitably equipped keyboards and mice – although, as with PCs, you’ll sometimes need a convention­al keyboard and mouse connected initially to set up the pairing. I recently caught myself using a Pi Zero W with an Apple Magic Mouse 2 and Magic Keyboard 2 (the version with the numeric keypad). It suddenly struck me that I was using over £200 of keyboard and mouse to control a £10 computer.

Once you’ve got your Raspberry Pi up and running, there’s another option that you can use that dispenses with HDMI leads and keyboards altogether, and that’s to access the Pi desktop using VNC or RDP. Actually, scrub that. I’d suggest that you forget VNC altogether. It’s one of those things that was useful a couple of decades back, but these days RDP is available pretty much everywhere and provides a much better user experience than VNC.

RDP isn’t available out of the box on Raspbian, the default Raspberry Pi operating system (we’re supposed to call it Raspberry Pi OS, but everyone still seems to be calling it Raspbian). You need to download and install the RDP software. First make sure your Pi is up to date by opening a terminal window and typing:

sudo apt-get update sudo apt-get upgrade sudo apt-get dist-upgrade

As I’ve mentioned before in these pages, you don’t strictly need both of the last two, but I find it sometimes works best because of broken package dependenci­es. update grabs the latest catalogue but doesn’t actually change anything, despite what you might expect from the name. Especially as “update” really does mean update with most other operating systems.

upgrade will automatica­lly download and install updated packages found in the local catalogue, and dist-upgrade does exactly the same thing but also removes any packages as needed. Due to badly maintained package repositori­es, I find that this three-step process has a greater chance of success, especially if you haven’t updated… sorry… upgraded for a while and so are running with packages that are several versions out of date.

Once you’ve done that, it’s time for a quick reboot. This isn’t strictly needed under Linux, but again, badly written install scripts can leave old versions of things running. A reboot after a big upgrade never hurts, and at least on the Pi it tends to happen quickly. It’s not like rebooting a PC or a Mac.

The next step is to download the RDP host software. There are a few options available but the one I’d recommend is called xrdp. They are all clones of Microsoft’s proprietar­y RDP server software, but I’ve found that xrdp works really well. Just issue the following command:

sudo apt-get install xrdp

And that’s it – you don’t need to do anything else.

From your other computer you can then fire up an RDP client and enter the IP address of your Raspberry Pi. You’ll also need a username and password, but this will be the same as the one you normally use to log in to the Pi.

If you don’t know the IP address of the Pi you can either find it via your router or else type the following on the Pi itself:

hostname -I

It’s a good idea to fix the IP address on your router, so that the Pi is always easy to find.

Interactin­g with the Raspberry Pi desktop via an RDP client works incredibly smoothly. Unless you’re playing a game (surely you didn’t buy a Pi to play games on?), it’s just like having a direct connection.

But if you’re more of the techie type, you might not even want to bother with the desktop at all. In that case, you can use SSH to open a command line session with a Raspberry Pi. By default, SSH support is switched off for security reasons, but you can enable it either from the desktop (look for the interfaces tab in the Raspberry Pi Configurat­ion utility) or from a terminal window (you’ll need to sudo raspi-config and then look in the Interfacin­g Options).

What if you don’t even use the desktop? Things get a bit chicken and egg at this point, but there’s a cheat that you can use. Power down the Pi, remove the SD card and place it in another computer. Look for the Boot partition and place a file called “ssh” there. There’s no extension, just “ssh”. And the file doesn’t need any contents. Then safely remove the SD card and put it back in the Pi. The next time you reboot the Pi, it will temporaril­y enable SSH. You can then connect to it with your favourite SSH client. I tend to use Putty on Windows PCs and vSSH on my Macs.

 ?? @PaulOckend­en ?? Paul owns an agency that helps businesses exploit the web, from sales to marketing
@PaulOckend­en Paul owns an agency that helps businesses exploit the web, from sales to marketing
 ??  ?? BELOW Raspberry Pi Zero W ( top) versus Banana Pi BPI M2 Zero – not exactly subtle!
BELOW Raspberry Pi Zero W ( top) versus Banana Pi BPI M2 Zero – not exactly subtle!
 ??  ?? BELOW HDMI comes in many flavours so it’s best to use adapters to switch sizes
BELOW HDMI comes in many flavours so it’s best to use adapters to switch sizes
 ??  ?? ABOVE The Eagle Smart HDMI video capture dongle is a steal at £9
ABOVE The Eagle Smart HDMI video capture dongle is a steal at £9
 ??  ?? BELOW An affordable all-in-one keyboard/ touchpad will be fine for occasional Pi use
BELOW An affordable all-in-one keyboard/ touchpad will be fine for occasional Pi use
 ??  ?? ABOVE RDP lets you interact with the Pi desktop from a computer window
ABOVE RDP lets you interact with the Pi desktop from a computer window

Newspapers in English

Newspapers from United Kingdom