ebook img

raspberry pi arch linux owncloud bash PDF

232 Pages·2015·61.28 MB·English
by  
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview raspberry pi arch linux owncloud bash

RASPBERRY PI ARCH LINUX OWNCLOUD BASH CYRUS AND PROCMAIL MOUSE-FREE COMPUTING WRITE ONCE, PUBLISH ANYWHERE SERVE EMAIL TILING WMS MARKDOWN Forget Google – take control of Master the awesome i3 window Future-proof your words with this your email by hosting it yourself manager for maximum speed lightweight markup language TUTORIAL MEGAPACK The best hands-on guides, tips and tricks for your Linux box 222 PAGES OF TUTORIALS ENCRYPTED COMMUNICATIONS Chat securely using Tox OPEN MEDIA VAULT Turn your old PCs into NAS boxes SHELLSHOCK Understand how the Bash vulnerability works SYSTEM MANAGEMENT CLASSIC COMPUTING RASPBERRY PI PROJECT SYSTEMD THE ATLAS HOME ARCADE Take control of what starts and Learn how to program a Relive the glory days by building when during boot up supercomputer from the 1950s your own arcade machine 1 PYTHON + MYSQL › SHELL TRICKS › UEFI › LATEX + MORE! www.linuxvoice.com Tutorial Megapack Cover 4sb.indd 1 09/12/2015 14:11 WELCOME Linux for everyone Where would the world be without Free Software? Linux Voice is different. Linux Voice is special. Here’s why… GRAHAM MORRISON A free software advocate At the end of each financial 1 and writer since the late year we give 50% of our 1990s, Graham is a lapsed profits to a selection of KDE contributor and author organisations that support free of the Meeq MIDI step software, decided by a vote among sequencer. our readers (that’s you). Linux has developed into an incredibly versatile operating SUBSCRIBE No later than nine months system: it runs on everything from giant IBM mainframes to 2 after first publication, we the cheapest smartphones, and businesses around the ON PAGE 57 relicense all of our content under world depend on it. It’s fast, reliable, secure and open – helping the Creative Commons CC-BY-SA companies to avoid vendor lock-in. In practical terms, nothing licence, so that old content can beats GNU/Linux as the best all-round mainstream operating still be useful, and can live on even system in use today. after the magazine has come off But the combination of GNU, Linux and other components in a the shelves. Free Software operating system is also the best geek toy in the world. It’s great to play with – to explore, to pull apart the pieces, We’re a small company, so see how they work, and (hopefully!) put them all back together 3 we don’t have a board of again. So as thanks to the awesome Free Software community, we directors or a bunch of at Linux Voice have decided to give away over 222 pages of shareholders in the City of London tutorials from previous issues of the magazine. Whether you’re a to keep happy. The only people home desktop tinkerer, a server admin or a budding developer, that matter to us are the readers. there’s something here for everyone. Indeed, you can even brew your own beer with Linux! Time to explore… Graham Morrison THE LINUX VOICE TEAM Editor, Linux Voice Editor Graham Morrison [email protected] Deputy editor Andrew Gregory [email protected] What we love in this megapack Technical editor Ben Everard [email protected] Editor at large Mike Saunders [email protected] Games editor Michel Loubet-Jambert [email protected] Creative director Stacey Black [email protected] Malign puppetmaster Nick Veitch [email protected] Editorial contributors: Juliet Kemp, Andrew Conway, ANDREW GREGORY BEN EVERARD MIKE SAUNDERS Valentine Sinitsyn, Jon Archer, Mark Crutch, Les Pounder, “With governments and big “Never lose any important data “Ever since I learnt the i3 window Mark Delahay, Marco Fioretti, business trying to spy on again with regular backups. It manager, my productivity has John Lane, Mayank Sharma, everything we do, encrypting may seem like tedious work, but shot up. I no longer have to keep email with PGP is essential.” p5 we make it easy.” p175 reaching for mouse.” p211 2 www.linuxvoice.com www.linuxvoice.com Tutorial Megapack Welcome 4sb.indd 3 09/12/2015 14:10 TUTORIAL MEGAPACK CONTENTS Contents A vast compendium of GNU, Linux and Free Software knowledge. comets, from the comfort of your Linux machine. 19 35 Raspberry Pi: build an emergency beacon 62 Stay safe in the event of disaster by broadcasting the theme from Star Wars from a lunch box. Control virtual machines with Python and libvirt 66 Dispense with the GUI for the awesome power of virtual machines commanded by Python. PGP: Keep your messages secure 5 Stay effortlessly* up to date. Make your own typeface with BirdFont 70 Encrypt your emails and reclaim a little bit of *Some effort required Design software has never been more accessible. privacy from Big Brother/the NSA/GCHQ. Now go and brand something! Bug reports: help make free BrewPi: Brew beer at home with software better 27 Raspberry Pi: Build a Mars Rover 72 a Raspberry Pi 7 If you do it right, getting bugs fixed can be an Create robots programmable in Python quicker Control and monitor the brewing process with the important part of free software development. than you can say “Sarah Connor”. help of a handy Linux-powered kit. Raspberry Pi & MAME: build Raspberry Pi: Monitor woodland OwnCloud: Say goodbye to Google Docs an arcade machine 29 creatures 78 & Gmail 15 Play the games of your youth* without Keep tabs on your local badger population with a Set up your own cloud services and get the squandering all your pocket money. remote, home-brewed wildlife camera. convenience of the cloud without the intrusive *Graham’s youth advertising messages. SSH, Apache & Tiger: Secure Old code: Grace Hopper and UNIVAC 35 your servers 80 Old code: Ada Lovelace How to program on a machine that weighs more Stay one step ahead of the script kiddies who and the Analytical Engine 19 than a double-decker bus. want to vandalise your web servers. Travel back to the dawn of time to see how programming began – then try it for yourself! KDE: configure the hell out of VirtualBox: Keep Windows XP your desktop 39 after migration… 84 Arch Linux: Installation and setup The defaults in KDE are an affront to taste and … should you wish to, that is. made easy 23 decency – so fix it and make your life better. John von Neumann: EDVAC & IAS 88 UEFI: The new world order of booting 45 The Manhattan project bore strange fruit… Boot Linux without Grub or a BIOS. Benchmarking: how fast is UK SUBSCRIBERS Customise the LXDE desktop 49 your computer? 92 TURN TO PAGE 57 Make your Raspberry Pi a lot prettier by Test the capabilities of your machine and enhancing its default desktop environment. persuade the boss to let you get a new one. Make smart clothes with Raspberry Pi: make games with Scratch 95 an Arduino LilyPad 51 Build a set of traffic lights and a random number Sew a wearable circuit into clothing to turn your dice-rolling game – both with flashy lights! wardrobe into an electronic canvas. Office migration: printing and email 98 Hunt comets with Python and open data 58 Let your small or home office labour no longer Filter image data in the search for Thargoids under the oppressive yoke of XP. Freedom! 3 www.linuxvoice.com www.linuxvoice.com Tutorial Megapack Contents 4sb.indd 4 09/12/2015 14:08 CONTENTS TUTORIAL MEGAPACK Compile software from source code 103 Python and MySQL: Big data analysis 150 Get the latest software, extra features and more Don’t trust the official statistics – take the data speed with home-rolled source code. and make your own. US SUBSCRIBERS BASIC and the dawn of the Linux 101: Power up your shell 154 TURN TO PAGE 116 microcomputer 106 Customise the stock Bash command line and The language that started a revolution. feel epic. PyParted: partition your disk with Python 110 Fargo: Write and publish outlines Gain insane levels of geek points. in open formats 158 Turn the web upside-down with a simple way to Krita: Get started with brush publish content. modes and layers 118 Paint your masterpiece with Free Software and Write a device driver with PyUSB 162 the Divine Stallman. Reverse engineer the software to control a USB toy car. Build a quiz in Python, EasyGUI and Pygame 120 HDR: Create awesome photographs 169 Use functions, variables and lists to expand your Combine images to achieve stunning visual programming skills. effects. Latex: Compose beautiful text 197 The layout tool for the über geek isn’t as hard as Tor: Encrypt your internet traffic 124 Raspberry Pi: Let’s get animated 171 it looks. You may not have anything to hide, but you can Craft a movie masterpiece with Python and the still help. Raspberry Pi. OpenMediaVault: NAS for everyone 201 Get network attached storage Linux 101: Master your package manager 128 Linux 101: Back up your data 175 the easy, Linuxy way. Find out what’s going on at the heart of your One day you’ll wish you used encrypted backups. Linux distro. Shellshock: Breaking into Bash 205 John The Ripper: Crack passwords 179 How the scary security flaw works. Now update! Arduino & Python: Build robotic … then create new ones that are more secure. weaponry 132 Cyrus: Build your own mail server… 207 Add face recognition software to a toy gun. Cyrus: Build your own email server 183 … and implement bespoke antivirus and spam Mayhem ensues! Take control of your communications. checking. Sigil: Create quality ebooks for any OS 140 URWID: Create text-mode interfaces 187 i3: Learn a tiling window manager 211 Self publishing is the future of the novel, so why The interface of the 90s is alive on Make better use of your screen space and kill the not try it today? low-bandwidth systems. mouse for good. Raspberry Pi model B: Tox: Encrypted peer-to-peer Raspberry Pi: Use different kinds of input 213 Void your warranty 144 communications 191 Use your Pi to protect a plate of biscuits from Add bits, hack bits, then overclock it and fry it. Chat without any government spooks listening interlopers. It’s fun to be a geek. to you. Markdown: Write once, publish anywhere 217 Sonic Pi: Program electronic music 146 Python: Write a simple Twitter client 193 Publish your content in a simple format that Code bleeps and beats in a wonderfully simple Connect your application to the weird world of looks here to stay. syntax. social media. Linux 101: Get the best out of Systemd 221 Love it or hate it, Systemd is here – you might as 132 171 well use it. Grub 2: Heal your bootloader 225 How to fix a broken installation without losing all your data. Olde code: Atlas – the UK’s supercomputer 229 How the transistor revolution brought supercomputing to Manchester. 4 www.linuxvoice.com www.linuxvoice.com Tutorial Megapack Contents 4sb.indd 5 09/12/2015 14:08 TUTORIAL PGP KEEP MESSAGES SECURE WITH PGP TUTORIAL The Feds (and GCHQ, and the NSA) are snooping on our BEN EVERARD communications, but we can fight back with encryption Normal email is one of the least secure forms of communication available – less secure even than post cards. These mails can typically be read by anyone on the same network as you, anyone at the ISP, anyone at your mail provider, anyone at the recipient’s ISP and anyone on the same network as the recipient, as well as anyone with access to the various networks between the two ISPs. If you use SSL or TLS to connect to your inbox, then it improves things a little, but it’s still vulnerable as soon as it leaves your mail provider. The colour and message in the top-right corner are PGP (Pretty Good Privacy) is a program designed to a random security code so you can distinguish real remove these weaknesses. It uses the normal email Mailvelope messages from spoofs. system, but adds a layer of encryption to protect them in transit. These days, PGP is usually used to refer to key encryption comes into play. Everyone who uses the OpenPGP format for these encrypted messages, PGP first creates a public/secret key pair. The public rather than the PGP program specifically. key is made public while the secret key is known only The OpenPGP format uses two different types to the user. However, anything encrypted with the of encryption: symmetric key and public key. In public key can be decrypted only with the secret key symmetric key encryption the same key (basically and visa versa. just a binary string that’s used as a password) is used to encrypt and decrypt the message. In public key Public and private keys encryption, two different keys are used (one to encrypt The solution is to encrypt the key for the message and one to decrypt). The phrase ‘private key’ can refer with the recipient’s public key. When they receive to either the key in symmetric encryption, or the secret the message, they can then decrypt the key for the key in public key encryption. To avoid this ambiguity, message, and then decrypt the message itself. This we won’t use the phrase in this article, but you may is a bit convoluted, but it’s much less processor- come across it in software. intensive than encrypting the whole message using When encrypting a message with an OpenPGP- public key encryption. compatible program, the software generates a You can use OpenPGP in most mail clients, but random symmetric key and encrypts the text. This we’ll look at doing it in webmail. Since OpenPGP is ciphertext forms the bulk of the message. purely a text format, you could generate the encrypted The problem is that the recipient of the message message elsewhere and copy and paste it into your has to know the key, but it can’t be included in the email. That’s exactly what we’ll do, but instead of copy message otherwise anyone who intercepts the and paste, we’ll use a browser extension to convert message will be able to read it. This is where public the plaintext to encrypted ciphertext. Mailvelope (www.mailvelope.com) works with Chrome/Chromium and Firefox, and it comes pre- USING OTHER MAIL CLIENTS configured to work with some of the most popular We’ve described the process for working mentioned in the main text, you should be webmail providers (Gmail, Yahoo, Outlook.com with Mailvelope, but the process is almost able to transfer keys between these pieces and GMX). Installing it is no more challenging than identical for all OpenPGP-compliant of software so you can access the same mail downloading the extension from its Releases section software. You shouldn’t have any problems account through different programs. (https://github.com/toberndo/mailvelope/releases) following along using Thunderbird or Mailpile is a mail client designed to bring and opening the file with the appropriate web browser. Evolution, or even AGP and K9 for Android or PGP to the masses by making it easier Cyanogenmod. to set up OpenPGP encryption, even for The first step is to generate a public/secret key pair. Regardless of the software, you’ll still new users. The project raised just over In Chrome/Chromium, you can get to this by clicking have to go through the same process of $163,000 in crowdfunding and is currently in on the padlock icon that should have appeared to the generating and exchanging keys before development, and you can track its progress right of the address bar. In Firefox, this options menu you can communicate with someone. As at www.mailpile.is. is a little more hidden. First, you’ll need to go to view 5 74 www.linuxvoice.com www.linuxvoice.com LV001 074 Tutorial PGP.indd 74 08/02/2014 16:07 TUTORIAL PGP DIGITAL SIGNING OpenPGP encryption ensures that only the intended recipient can read the message; however, it doesn’t guarantee that they receive the message, or prove who sent the message. Encryption can’t help with the first of these, but there is something you can do about the latter measure. In many OpenPGP mail clients (and the gpg command line tool), you can add a digital signature to a clear-text message. It does this by leaving the message in plain text, but also encrypting a hash of the message with your secret key. This encrypted hash is known as a digital signature. Since it’s encrypted with your secret key, it can be decrypted with your public key. Any recipient that knows your public key can then decrypt this hash and check it against the message. If they match, the recipient knows that it really came from you. > Toolbars > Add-on bar. This will make the Add-on or http://pgp.mit.edu. Of course, it is possible that You can send encrypted bar appear at the bottom of the screen, and then you some attacker could take control of one or more of messages to several should find the padlock icon on the right-hand side of these key servers and put fake keys in them. Webs people at once, and Mailvelope encrypts it for this. This icon will bring up a menu, and you’ll need to of trust have a decentralised method of verifying each of them. select Options (see the image, left). keys. It’s done by people digitally signing the keys of In the Options screen, you can create a new public/ people they’ve met and exchanged keys with. If you secret (private) key pair by selecting Generate Keys. need to communicate with someone, you can then Once you’ve done this, you can go to the Display Keys tap into this web of trust and see who trusts them. screen to see it. This screen will show all the keys Perhaps someone you trust also trusts them. Perhaps that Mailvelope knows, whether they’re other people’s someone you trust trusts someone who trusts public keys or your own public/secret key pairs. them. If this chain is short enough, then you can be Before you can receive emails, you have to send confident that you can trust the person. Unfortunately, your key to the people you want to communicate with. Mailvelope doesn’t currently support webs of trust. The key file can be exported from the Display Keys screen (you can also export your public/private key Keep it secret, keep it safe pair here and import them into another mail program). As is so often the case, the decision on which way to Getting the public key to the recipient can be a distribute your key comes down to security versus challenge. The best way to do this is to physically convenience. If you’re concerned, you could always transport the key, as you can be completely sure that follow up with another method such as a phone call to they got it correctly. The easiest way is just to email confirm the key. Once someone has sent you their key, them the keyfile. However, it’s possible for some you just need to load it into Mailvelope using the malicious attacker to intercept this message and Import Keys screen in the Options. change the keyfile. Getting set up with keys is the hardest (or at least, There are two other options: key servers and webs most inconvenient) part of using any OpenPGP-based of trust. Key servers are databases of keys that you communication. Once you’ve done this, it’s easy. With can add your keys to, and retrieve other people’s keys the Mailvelope extension running, just use your mail from. For example, try http://keyserver.pgp.com provider’s web page as normal (if your mail provider isn’t already on the Mailvelope watch list, you’ll need to add it in the Options). When you get to the compose page, you’ll see a floating icon of a pen and paper. Click on this and it will open a new window to let you enter the text for the message. Once you’ve written the message, click on the padlock, and add one or more people to the list that it’s encrypted for, then Transfer to put the ciphertext into the email. If you receive an encrypted message, Mailvelope will display a decrypt icon; click on this to enter the passphrase you entered when you generated the key. This password gives you some security even if an attacker gets access to your machine. You can use gpg to create signed documents from the Provided you exchange keys securely, and keep command line. Just run gpg --clear-sign <text-file> to your keys safe, OpenPGP provides security that is generate a file containing the plain text and a signature. thought to be unbreakable with current technology. 6 www.linuxvoice.com 75 www.linuxvoice.com LV001 074 Tutorial PGP.indd 75 08/02/2014 16:08 TUTORIAL BREWPI BREW PERFECT BEER WITH HELP FROM THE RASPBERRY PI TUTORIAL We love beer, we love the Raspberry Pi and we love the Arduino GRAHAM MORRISON – so we’re bringing them together for one awesome project. Beer is lovely. But when you’re making it at 7 STEPS TO BEER home, the biggest challenge (after discovering • Brewing a way to boil vast quantities of water) is always • Cooling finding somewhere to leave your brew to ferment. It’s • Fermenting this stage of beer-making magic that turns what’s • Priming known as wort into beer, creating alcohol and oodles • Bottling of flavour. And for this stage to work well, you ideally • Ageing need to be able to manage the temperature of the • Drinking environment your beer is sitting in. In the UK, many amateur brewers resort to using an ‘airing cupboard’, normally situated next to the hot water tank and used for drying clothes. This isn’t a bad place, because it’s The various bits of the BrewPi give little indication that warmish – many beer kits like to ferment at around they can be put together to create something awesome. 20 degree centigrade – and the temperature doesn’t fluctuate massively. But it still fluctuates, and it may has its creator, Elco Jacobs, built an incredibly GENERAL LINUX even prove too warm. Many yeasts, especially for ale, effective system for fermenting beer, he’s created an prefer things a little cooler (18–20 degrees, ideally, but extremely helpful community of BrewPi enthusiasts, this depends on the beer). And lifting 25 litres of wort an online shop and an assembly system for easy HARDWARE into a first-floor cupboard could break your back, and access to all of the bits and pieces you’ll need. you’ve got a hygiene nightmare if it falls over, or falls through the flimsy shelf its sitting on. What you’ll need BrewPi is the answer to this conundrum. It’s a While you will need a fair bit of kit, it needn’t cost very brilliant project that brings together a love of Linux, a much. The fridge or freezer is the biggest little hardware hacking and plenty of beer into one consideration, as well as somewhere to put it. We DIFFICULTY fermenting barrel of hoppy goodness. It’s essentially a asked the internet, and Mark Einon in Wales very device that controls the environment surrounding the generously obliged with a freezer he was going to give DISCLAIMER fermenting bucket of beer, enabling you to make to the local freecycle initiative (thanks Mark!) Almost perfect beer every time, regardless of climate and any fridge or freezer will do, as long as it’s working, The following tutorial mixes liquid, electricity house heating cycles. Many people use an old fridge and you should be able to find someone willing to let and DIY modifications, or freezer as the surrounding container and connect an old model go for very little. You need enough space all of which can create the BrewPi to a cooling and heating mechanism to within the freezer to stand your fermenting bin, and as a lethal cocktail of enable its clever algorithms to create the perfect our freezer’s shelves were made from coolant pipes, danger. Don’t make any modifications yourself environment for your beer. The BrewPi itself is a we had to bend these back before there was enough unless you’re certain mixture of hardware, software and initiative. Not only room. Fortunately, the pipes were easily pushed back. they’re safe, and get a We then slotted in an old wooden shelf to stand the qualified electrician to fermenting bucket on, as they can be very heavy when check any modifications you do make. full of 25 litres of brewing beer. If the fridge or freezer has an inside light, this can be coerced into another essential task – heating up the inside environment. If not, you’ll need some other kind of heating mechanism. Some people use a reptile mat wrapped around the fermenting bin, but we plumped for a 60W waterproof greenhouse heating bar, which cost us £15 new on eBay, and slotted nicely into the bottom of the freezer with plenty of room. You will also need both a Raspberry Pi, complete with a > 2GB SD card, and either an Arduino Duo or an Arduino This shows the rear of the LCD connecting to the Arduino Leonardo microcontroller. If you’re anything like us, and the shield, with the OneWire connector above. you’ve got an old Duo tucked away in a drawer 7 76 www.linuxvoice.com www.linuxvoice.com LV001 076 Tutorial BrewPi.indd 76 08/02/2014 16:11 BREWPI TUTORIAL somewhere and a Raspberry Pi going spare. And despite the name of the project, there’s no specific reason for requiring a Raspberry Pi – any Linux device with a USB port capable of running the Apache web server and some Python scripts should be up to the job. You might want to try a NAS, for example, if you’re running one already. But the Pi is well suited to being tucked away in the garage, and it’s relatively cheap, so it’s still a great option. Most of the hard work is done by the Arduino, as this interfaces with the various sensors and relays and runs the complex controlling algorithms that adjust the temperatures within your freezer. Your brew will even keep brewing if the Pi crashes, which is handy if there’s a power failure and your Pi develops a read/write error. The Pi is really just logging and serving up the data for the web portal. Unless you’re an expert who’s happy building circuits, you’ll also need the BrewPi kit (brewpi.com). This includes everything you need to turn your Arduino into a sensor-wielding beer factory. It includes the process first, and then experiment a little with an The BrewPi isn’t an easier the shield, a PCB that slots onto the two compatible old circuit board and some wire. You’ll then be set for way of making beer. It’s Arduino form factors, along with the LCD, the sensors, the main event. an easier way to make it perfect. the actuators (more details later if none of this makes The shield is the bit that attaches to the Arduino, sense) and the other fiddly bits that may otherwise and it’s probably the most complex part of the whole take an afternoon to source. It’s even possible to buy assembly, so let’s get this out of the way first. The the whole thing pre-constructed, but we think that’s main instructions can be found at www.brewpi.com/ missing half the fun, especially when the build itself brewpi-soldering-guide, but we’re going to cover the isn’t that difficult. broad detail of the process, along with any particular We’d also highly recommend buying the case kits. notes we make along the way. The official instructions These lasered bits of plastic encase both your are made up of photos, and while they’re great if you Raspberry Pi and your Arduino to create a sleek, know what you’re doing, we want to make the project professional solution that looks great sitting atop your as accessible as possible by making fewer freezer. They also stop bits getting bashed about or assumptions about the builder than the official site. falling off. Expect to pay around £70 for the shield and case kits together. You’ll also need a miscellany of Forging the shield common tools to put the whole thing together; a First, lay out all the components on a table top, soldering iron and solder, maybe a solder sucker, grouping them together so you can check they’re all some tweezers, a range of differently sized there. This also makes it easier to install. Now start by screwdrivers and a steady hand. being brave – you’ve got to snap the shield apart into Did we just say soldering iron? Yes! You’ll need to four separate boards. It’s a little like breaking bonfire solder the various components on to the Arduino toffee. The large board that breaks off (labelled with shield. But it’s straightforward, and this should make www.brewpi.com) connects directly to the Arduino. an ideal first project if you’ve not done any soldering Then there’s a long strip embedding seven columns of before. All the components are large and there’s no three holes, a medium-sized rectangle of a board with fiddly soldering required. Try watching a couple of a surface mounted integrated circuit, and a tiny YouTube soldering videos to familiarise yourself with rectangle that will host the rotary encoder. Break off the broken tabs remaining on the boards with a pair of pliers or a small pair of cable cutters so that the edges are as smooth as possible. Some of the pin arrays – the ones with the two collars of black plastic – are designed to fit on to your Arduino board so that it can connect to the holes on the shield. There are five of them, and you should find there’s one for every header on the Arduino. These need to be connected to the Arduino first, before being soldered into the shield – this locks their orientation and connection. The longer pin goes into the Arduino, while the shorter piece goes into the shield. As we The Raspberry Pi can also fit on top of the BrewPi case, were using an ancient Arduino Uno, there were fewer in a separate box or au naturel. Cases are good. power headers on the circuit board that pins allocated, 8 www.linuxvoice.com 77 www.linuxvoice.com LV001 076 Tutorial BrewPi.indd 77 08/02/2014 16:11 TUTORIAL BREWPI Next is what’s known as the OneWire distribution board (the only board remaining). Sometimes it’s written as ‘1-Wire’, and it’s a standard protocol for communicating with devices from Dallas Semiconductor (such as the temperature sensors we need for our BrewPi), using a single connector, hence its name. This needs seven of the three-pin green connectors – two shaped at right angles for the edge connectors, and the other five directly pointing up (you can see this illustrated on the board itself now you know what to look for, and that’s the side they need to be connected to). Official instructions suggest starting with the two outer connectors, as these are oriented outwards lengthways. The other five all face upwards with their pins on the left when you’re looking at the text on the board. The green ‘AT-AT’ connectors (for Red or blue LEDs on the but the eight-pin array still fitted over the power pins that is what they look like, not an official designation) shield indicate whether the and the 10-pin header still fitted across the IO pins then plug into these and the two end connectors. BrewPi is currently heating without getting in the way of everything coming Now it’s the turn of the rainbow-coloured ribbon or cooling your brew. together. Don’t forget there’s also smaller six-pin cable, which we need to turn into something a little rectangular connector. Fortunately, the shield only fits more civilised to enable it to connect to the ports one way. Start your soldering at the corners to make we’ve been soldering. If you’ve ever made your own sure all the pins stay aligned. IDE cable for an ancient PC, this is very similar. The Now solder the single green connector onto the black plastic connectors that attach themselves to the ACT1–ACT 4 shield holes, with the component ribbon cable have teeth that penetrate the insulation attached to the side with the website URL. Connect a on the outside of the wire to make a connection three-pin green connector to one side, and one of the without soldering anything. Just make sure the PRO TIP two-pin connectors to the other (they all offer ports at triangles on the connector align with the black wire in Soldering tips; heat up right angles to the board, and have the same the flat cable. Push the cable through until it just the destination first, dab the solder onto the connector form factor as the eight-pin one you’ve just protrudes from the other side, and taking the advice of joint, make sure it flows connected). Ours wobbled slightly while fitting them, the official instructions again, place the smaller edge into the joint naturally so it’s best to solder one of the middle pins first and on a table and use something flat to put considerable and try not to bridge any connections. If you do, wiggle the connector into alignment, before soldering pressure onto the connector. It should just about heat and remove using a any remaining pins. Flip the shield over and solder one come together, and in so doing, connect the pins to solder sucker. of the 10-pin block connectors to the header labelled the cable. When this seems secure, fold the long end “To the LCD backpack”, and make sure you’ve got the of the cable up and over the back of the connector gap in the right place (facing the edge). before sliding the remaining black connector to hold That’s all that needs to be done to the main board! the cable together. This needs to be done on both Congratulations. Now might be a good time for a cup sides of the ribbon cable, and both connectors need to of tea before moving on to the LCD backpack itself. point the same way so that the cable won’t twist. That last bit can be a little mind bending as you try to work Glowing electronic display The LCD board is the one with the small integrated circuit already on it. The circular speaker fits into the middle with the upwards side on the same side as the chip, and after soldering, you need to cut the protruding pins from the other side. Another 10-pin header comes next, with the gap facing the integrated circuit. Flip this small board over (to the side without any components), and fit the 16-pin header into the holes. Solder from the other side. The tiny board for the rotary encoder is up next. The official instructions mention that the biggest two pins on the encoder need to be squeezed slightly to fit into the holes. We didn’t need to do this, but we did need to use a fair amount of strength to get the encoder into position. Make sure the side with the handle is the one with the circle on the board, and solder the joints from the other side. A washer, a nut and then the handle We had to bend one of the shelves in our freezer to make can be slipped over the encoder when you’ve finished. enough room for the fermenting bin. 9 78 www.linuxvoice.com www.linuxvoice.com LV001 076 Tutorial BrewPi.indd 78 08/02/2014 16:11 BREWPI TUTORIAL THE BREWPI SURVIVAL KIT The flat packed The LCD, which fits Raspberry Pi and into the hole in one Arduino shield cases. of the case panels. Shield parts are mostly soldered Temperature sensors are onto the shield, used to measure the beer but our kits had a temperature, the freezer few bits left over. temperature and the outside temperature. The shield itself. out which way to put the connector on so that the enough to solder the lone pin alongside the others. black cables stay in the same place and the connector Solder these pins on the top surface (the same side as is pointing in the same direction after you’ve twisted the LCD itself), and you can now attach the LCD to the the cable back over the connector. You can now female header. connect both of the boards with the correctly sized The final stage of shield forging is to take the connector together with the cable, and we felt slightly sensors and strip the insulation off the end of the more optimistic after testing the continuity of the wires – a couple of millimeters will do. Each cable has connections to make sure we’d pushed through the three ‘cores’, and each core needs to be screwed into connectors to the ribbon cable with enough pressure. a three headed ‘AT-AT’ green connector, so that when For the other ribbon cable, pull off the ends where these plug into the OneWire board, red is at the top they’ve been cut and wiggle this into the underside of (marked 5V – this is important), and yellow at the the rotary controller board. Pin 4 should always be red. bottom. The official instructions note that the colour Then solder the pins to the board, The other end of order of the yellow and green wires has changed, so this cable goes to the LCD board, parallel to the it’s worth making doubly sure if you’re reading this in rainbow ribbon cable, and connected to the same the distant future, as the sensors might not be able to side. Make sure pin 4 lines up and solder this as well. take 5V going in the wrong cable. To make the ends of The next stage is the LCD, and you first need to the wires easier to insert into the tiny screw holes, and break off 16 pins for the LCD itself. The official guide to make them more resilient, it’s worth dabbing them has a great tip, where you connect the whole header in a little molten solder. to the female header on the other board and use this as a guide for snapping the 40-pin header at the right Porter, Stout, IPA – and the case place with your hands. This didn’t quite work for us, as You now have a choice. You can either keep the we broke the header one pin short, but it was easy OneWire connector close to the rest of your BrewPi hardware, or place it closer to where the sensors are going to be. This might be useful if you wanted to position the OneWire board within the fridge, for example, but we decided to go with the official instructions and wire up a short three-core cable (maybe 20cm), with AT-AT connectors at either end, to connect the OneWire board to the BrewPi. We used an old power cable with earth for easy access to three cores with insulation attached. This cable eventually loops outside the case from the main board to the OneWire connector. The cases are all made from various bits of lasered plastic, and it’s never clear exactly what goes where. To make the sensors inside the fridge easily removeable, It’s like a BrewPi 3D jigsaw puzzle. The Raspberry Pi use a connector like this within a container. case is a good place to start, as this is emblazoned 10 www.linuxvoice.com 79 www.linuxvoice.com LV001 076 Tutorial BrewPi.indd 79 08/02/2014 16:11

Description:
PYTHON + MYSQL > SHELL TRICKS > UEFI > LATEX + MORE! 5. Encrypt your emails and reclaim a little bit of privacy from Big Brother/the How to program on a machine that weighs more .. Semiconductor (such as the temperature sensors we need for .. php5-curl ntp curl php5-imagick php-apc.
See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.