ebook img

Linux User & Developer 169 - Electronics for Pi Hackers PDF

100 Pages·2016·19.495 MB·English
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 Linux User & Developer 169 - Electronics for Pi Hackers

FREE DVD WITH 5 LIVE BOOTING DISTROS www.linuxuser.co.uk L IN U X U S E R & D E V E L O P E R IS THE ESSENTIAL MAGAZINE S FOR THE GNU GENERATION U E 1 6 9 EEEEEEEEEELLLLLLLLLLEEEEEEEEEECCCCCCCCCCTTTTTTTTTTRRRRRRRRRROOOOOOOOOONNNNNNNNNNIIIIIIIIIICCCCCCCCCCSSSSSSSSSS FFFFFFFFFFOOOOOOOOOORRRRRRRRRR PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEERRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS TTTaaakkkeee mmmaaakkkeeerrr ppprrrooojjjeeeccctttsss tttooo ttthhheee nnneeexxxttt llleeevvveeelll bbbbyyyy lllleeeeaaaarrrrnnnniiiinnnngggg hhhhoooowwww ttttoooo hhhhaaaacccckkkk hhhhaaaarrrrddddwwwwaaaarrrreeee E L E C AAAUUUTTTOOOMMMAAATTTEEE PPPRRROOOCCCEEESSSSSSEEESSS T R O N UUUssseee RRReeeddd HHHaaattt’’’sss AAAnnnsssiiibbbllleee tttooo rrruuunnn IC aaa vvvaaarrriiieeetttyyy ooofff ppprrrooojjjeeecccttt tttaaassskkksss S F O R MMAASSTTEERR P I H FFFIIILLLEEE III///OOO IIINNN GGGOOO A C K E LLLeeeaaarrrnnn hhhooowww tttooo dddeeevvveeellloooppp GGGooo R S ppprrrooogggrrraaammmsss ttthhhaaattt rrreeeaaaddd aaannnddd write to files PLUS RRREEEVVVIIITTTAAALLLIIISSSEEE AAANNN » Find files with Bash scripts OOOOOOOLLLLLLLDDDDDDD LLLLLLLAAAAAAAPPPPPPPTTTTTTTOOOOOOOPPPPPPP » Run RiscOS on Raspberry Pi » Linux Mint 18 on test w w GGGGiiiivvvveeee aaaannnn aaaaggggiiiinnnngggg ddddeeeevvvviiiicccceeee aaaa nnnneeeewwww » Manage the Ubuntu system w .lin lleeaassee ooff lliiffee wwiitthh LLiinnuuxx » Build an explorer robot - part 3 u x use HACK A TOY TTHHEE BBEESSTT OOPPEENN SSOOUURRCCEE ISSUE 169 £5.99 r.c MMUUSSIICC PPLLAAYYEERRSS ISSN 2041-3270 69 > o PART 2 .u k Add new functions TThhee bbeesstt wwaayyss ttoo ppllaayy && oorrggaanniissee ttuunneess 9 772041 327002 001_LUD169_week4.indd 1 09/08/2016 14:47 Full Page.indd 1 03/08/2016 16:11 THE MAGAZINE FOR THE GNU GENERATION Welcome Imagine Publishing Ltd Richmond House, 33 Richmond Hill Bournemouth, Dorset, BH2 6EZ ☎ +44 (0) 1202 586200 Web: www.imagine-publishing.co.uk www.linuxuser.co.uk www.greatdigitalmags.com to issue 169 of Linux User & Developer Magazine team Editor April Madden [email protected] ☎ 01202 586218 Designer Rebekka Hearl This issue Photographer James Sheppard Senior Art EditorStephen Williams Editor in ChiefDan Hutchinson Publishing DirectorAaron Asadi Head of Design Ross Andrews » Electronics for Pi hackers Contributors Dan Aldred, Mike Bedford, Joey Bernard, Christian Cawley, Sanne » Ultimate rescue kit De Boer, Kunal Deo, Alex Ellis, Tam Hanna, Oliver Hill, Phil King, Jon Masters, Paul O’Brien, Swayam Prakasha, Richard Smedley, Jasmin Snook, Nitish Tiwari, Mihalis Tsoukalos and Kevin Wittmer » Revitalise an old laptop Advertising Digital or printed media packs are available on request. » Manage the Ubuntu system Head of Sales Hang Deretz ☎ 01202 586442 [email protected] Sales Executive Luke Biddiscombe ☎ 01202 586431 Welcome to the latest issue of Linux User & Developer, [email protected] FileSilo.co.uk the UK and America’s favourite Linux and open source Assets and resource fi les for this magazine can now be found on this website. magazine. The Raspberry Pi has been a runaway success Support fi [email protected] story since its launch in 2012, and it’s at the heart of many International Linux User & Developer is available for licensing. fantastic maker projects. We often talk about the Pi being H☎e a+d4 4of (I0n)t 1er2n0a2ti o5n8a6l 4L0ic1ensing Cathy Blackman a great device for getting people coding, but what about if [email protected] you’re an experienced coder who’d like to create the kind Subscriptions For all subscriptions enquiries of advanced hardware projects that have inspired so many of us? [email protected] ☎ UK 0844 249 0282 That’s where our feature on p58 this issue comes in. It explains all ☎ Overseas +44 (0) 1795 418661 www.imaginesubs.co.uk the electronics a budding Pi hacker needs to know, from detailing Head of Subscriptions Sharon Todd all of the essential tools and components you need to translating Circulation Circulation Director Darren Pearce the symbols on circuit diagrams and how to get to grips with ☎PP☎rro o00dd11u22uc00tci22ot ni55o D88ni66re22c00t00or Jane Hawkins oiLsnos 2ou2ke S f1oe7rp0 t soAldlseori tnhgi.s T iaskseu ey oyuoru m’ll afi knedr tphreo juelctitms atote t hrees nceuxet kleitv oenl t ooudra fyr!e e DVD. Finance Want it sooner? It’s packed with fi ve live booting distros plus two essential data Finance Director Marco Peroni Subscribe recovery tools to help you treat any PC problems. Deal with boot Founder Group Managing Director Damian Butt today! errors, lost data, system repairs and more with this handy disc – Printing & Distribution you can read up on everything you need to know about the distros PPrriinntteedd bbyy WWiilllliiaamm GGiibbbboonnss,, 2266 PPllaanneettaarryy RRooaadd,, Willenhall, West Midlands, WV13 3XT and FOSS on it in our feature on p18. If you read the digital edition Distributed in the UK, Eire & the Rest of the World by: of the magazine, don’t worry – it’s all on our secure FileSilo repo for Marketforce, 5 Churchill Place, Canary Wharf London, E14 5HU you to download (I strongly recommend you grab the lot and burn it ☎ 0203 148 3300 www.marketforce.co.uk to a disc or fl ash drive just in case you ever need it!). Enjoy the issue! Distributed in Australia by: April Madden, Editor Gordon & Gotch Australia Pty Ltd 26 Rodborough Road Frenchs Forest, New South Wales 2086, Australia ☎ +61 2 9972 8800 www.gordongotch.com.au Get in touch with the team: Disclaimer The publisher cannot accept responsibility for any unsolicited material lost or damaged in the post. All text and layout is the copyright of Imagine Publishing Ltd. Nothing in this magazine may be reproduced [email protected] in whole or part without the written permission of the publisher. All copyrights are recognised and used specifi cally for the purpose of criticism and review. Although the magazine has endeavoured to ensure all information is correct at time of print, prices and Buy online availability may change. This magazine is fully independent and not affi liated in any way with the companies mentioned herein. Facebook: Twitter: If you submit material to Imagine Publishing via post, email, social Linux User & Developer @linuxusermag network or any other means, you automatically grant Imagine Publishing an irrevocable, perpetual, royalty-free license to use the material across its entire portfolio, in print, online and digital, and to deliver the material to existing and future clients, including but not limited to international licensees for reproduction in international, licensed editions of Imagine products. Any material you submit is sent at your risk and, although Visit us online for more news, opinion, tutorials and reviews: every care is taken, neither Imagine Publishing nor its employees, agents or subcontractors shall be liable for the loss or damage. www.linuxuser.co.uk © Imagine Publishing Ltd 2016 ISSN 2041-3270 www.linuxuser.co.uk 3 003_LUD169.indd 3 10/08/2016 14:59 CCoonntteennttss Subscribe & save! 28 C gUchraSeena cc tksu n usoebtuowstm c ooruefibfrres er ! on page 98 RReevviieewwss 8855 MMuussiicc ppllaayyeerrss && oorrggaanniisseerrss WWhhiicchh mmuussiicc ppllaayyeerr iiss bbeesstt ffoorr ddiisscceerrnniinngg LLiinnuuxx uusseerrss?? 58 Electronics for Pi Hackers Learn to build electronic circuits to interface with your Pi SSppoottiiffyy Audacious OpenSource Tutorials 08 News 30 Bash masterclass: Find files T he biggest stories from Computers are good at storing fi les. Bash TOMAHAWK Clementine the open source world scripts makes fi nding them again easier 12 Interview 34 .NET reboots on Linux with 90 Linux Mint 18 Boken Lin from Onion on the .NET Core Distrowatch’s favourite continues on in Omega2 board Explore the new open source .NET leaps and bounds runtime and SDK 16 Kernel column 92 Free software The latest on the Linux 38 Revitalise an old laptop Richard Smedley recommends some kernel with Jon Masters Give an old laptop a new lease of life excellent FOSS packages for you to try with lightweight Linux 42 Automate your project tasks with Ansible Learn how to install and use Ansible and Ansible Tower to automate tasks 46 Manage the system on Ubuntu Linux Take a closer look at how you can manage the system within Ubuntu 50 Learn Go: Develop programs that Features read and write to files LLeeaarrnn hhooww ttoo ddeevveelloopp aanndd uussee GGoo ppaacckkaaggeess 18 Ultimate rescue kit Ten ways to fix your PC with 57 Practical Raspberry Pi our rescue disc Continue our Explorer robot and toy hacking tutorials, get RISC OS on your 58 Electronics for 96 Free downloads Pi, check mail with a Python script and Pi hackers Find out what we’ve uploaded to our digital discover key electronics skills Take maker projects further content hub FileSilo for you this month Join us online for more Linux news, opinion and reviews www.linuxuser.co.uk 4 004_LUD169.indd 4 10/08/2016 16:59 Full Page.indd 1 09/08/2016 14:59 Open Source On the disc On your free DVD this issue Load DVD Find out what’s on your free disc To access software and tutorial files, simply insert the disc into Welcome to the Linux User & Developer DVD. for PC problems. Just restart your computer your computer and double-click Save your system from data loss, fi x boot and boot from the DVD to access the fi ve live- the icon. problems, interrogate partitions and hard booting distros. Plus there are two great FOSS Live boot drives, and much more with the ultimate rescue programs for recovering data from hard drives kit. This live booting disc is your one-stop triage and storage media. To live-boot into the distros supplied on this disc, insert the Featured software: disc into your disc drive and reboot your computer. Please note: • You will need to ensure that your computer is set up to boot from disc (press F9 on your computer’s BIOS screen to change Boot Options). • Some computers require you to press a key to enable booting from disc – check your manual or the manufacturer’s website to fi nd out if this is the case on your PC. • Live-booting distros are read KNOPPIX from the disc: they will not be Puppy Linux Slacko 6.3 installed permanently on your computer unless you choose KNOPPIX is a bootable live system consisting of a Puppy Linux is a special build of Linux meant to make representative collection of GNU/Linux software, to do so. computing easy and fast, even allowing you to do magic automatic hardware detection, and support for many by recovering data from destroyed PCs or by removing graphics cards, sound cards, SCSI and USB devices For best results: malware from Windows. and other peripherals. This disc has been optimised for modern browsers capable of CloneZilla rendering recent updates to the HTML and CSS standards. So SystemRescueCd CloneZilla is a partition and disk imaging/cloning to get the best experience we SystemRescueCd is a Linux system rescue disk program similar to True recommend you use: available as a bootable CD-ROM or USB stick for Image or Norton Ghost. • Internet Explorer 8 or higher administrating or repairing your system and data after a It helps you to do system crash. It aims to provide an easy way to carry out admin deployment, bare metal • Firefox 3 or higher tasks on your computer. backup and recovery. • Safari 4 or higher • Chrome 5 or higher Trinity Rescue Kit ddrescue 1.16 Problems with Trinity Rescue Kit or TRK is a free live Linux distribution GNU ddrescue is a data recovery tool. It that aims specifi cally at recovery and repair operations copies data from one file or block device the disc? on Windows machines, but is equally usable for Linux (hard disc, CD ROM, etc) to another, trying recovery issues. to rescue the good parts first in case of read errors. Send us an email at linuxuser@ safecopy 1.7 imagine-publishing.co.uk Please note however that if you safecopy is a data recovery tool, which tries to extract as are having problems using the much data as possible from a problematic (i.e. damaged sectors) source – like fl oppy drives, hard disk partitions, programs or resources provided, CDs, tape devices, where other tools like dd would fail then please contact the relevant due to I/O errors. software companies. 6 006-007 Disc Tutorial.indd 6 10/08/2016 15:13 Disclaimer Important information Check this before installing or using the disc For the purpose of this disclaimer statement the phrase ‘this disc’ refers to all software and resources supplied on the disc as well as the physical disc itself. You must agree to the following terms and conditions before using ‘this disc’: Loss of data In no event will Imagine Publishing Limited accept liability or be held responsible for any damage, disruption and/or loss to data or computer systems as a result of using ‘this disc’. Imagine Publishing Limited makes every effort to ensure that ‘this disc’ is delivered to you free from viruses and spyware. We do still strongly recommend that you run a virus checker over ‘this disc’ before use and that you have an up-to-date backup of your hard drive before using ‘this disc’. Hyperlinks: Imagine Publishing Limited does not accept any liability for content that may appear as a result of visiting hyperlinks published in ‘this disc’. At the time of production, all hyperlinks on ‘this disc’ linked to the desired destination. Imagine Publishing Limited cannot guarantee that at the time of use these hyperlinks direct to that same intended content as Imagine Publishing Limited has no control over the content delivered on these hyperlinks. Software Licensing Software is licensed under different terms; please check that you know which one a program uses before you install it. • Shareware: If you continue to use the program you should register it with the author • Freeware: You can use the program free of charge • Trials/Demos: These are either Live boot time-limited or have some Distros functions/features disabled Insert the disc into your computer and Distros can be live booted so that you • Open source/GPL: Free to use, reboot. You will need to make sure that can try a new operating system instantly but for more details please visit your computer is set up to boot from disc without making permanent changes to https://opensource.org/licenses/ your computer gpl-license FOSS Explore Unless otherwise stated you do not Insert the disc into your computer and have permission to duplicate and double-click on the icon or Launch Disc Alternatively you can insert and run the distribute ‘this disc’. fi le to explore the contents disc to explore the interface and content wwwwww..lliinnuuxxuusseerr..ccoo..uukk 77 006-007 Disc Tutorial.indd 7 10/08/2016 15:13 08 News & Opinion | 12 Interview | 96 FileSilo Hardware $8 Raspberry Pi challenger revealed The NanoPi Neo is big on features, but for a wallet-friendly price Of course the raspberry Pi is no expensive piece of kit; in fact, it’s one of the best ways for budding builders and tinkerers to get themselves started with computing without breaking the bank. With units of the original Pi and its numerous successors selling in their millions, it was inevitable that a whole host of competitors would try and get in on the action. We’ve encountered many of them during our time on Linux User & Developer, and it’s truly hard to beat the value for money and ease-of- use that the Raspberry Pi can offer. One of the newest, and also arguably one of the best, to arrive on the scene is the NanoPi NEO. Produced by the relatively well known FriendlyARM brand, the biggest selling point of the tiny computer is its $8 price tag. But it’s not until you take a closer look at the internals of the NanoPi NEO that you realise just how much of a steal it is at that price for both beginner and advanced users alike. The NanoPi NEO is available with 256MB and 512MB of RAM, with the larger variant only slightly more expensive at $10 and worth the upgrade for the added power. It’s also remarkably smaller than other noted competitors, with a 40mm square board powered by the Allwinner H3 quad-core processor clocked at 1.2GHz. For above The 40mm square board is one of the smaller Pi competitors on the market most beginner-level projects, that’s more than enough power, and FriendlyARM itself themselves on its website. The processor and The NanoPi Neo comes pre-loaded with lists a number of projects for users to try out RAM combination is also much faster than the Ubuntu, but it’s also being marketed as Pi Zero’s offering, but it’s slightly less than the being adaptable to work with many other bigger Raspberry Pi models. distributions. The number of ports also allow Expect to be able to build Dig even deeper and you’ll ind a 10/100 it to work with many other expansion sets. So things like a USB camera, Ethernet port, three USB 2.0 ports and an expect to be able to build things like a USB additional microUSB port. Despite its size, camera, a GPS system, a USB Wi-Fi device a GPS system, a USB Wi-Fi there’s also room for a microSD slot and a and a multi-media streamer. The only real device and a multi-media debugging serial port to top it off. Expansion limit is your own creativity and imagination. also plays a key role in the development of the At the time of writing, stock of the NanoPi streamer. The only real NanoPi, with a 36-pin GPIO also included for NEO was plentiful, but due to initial press limit is your own creativity good measure. We should also add that the feedback, it’s expected that stock will soon GPIO included here also includes UART, SPI, I2C dwindle. You can order your own NanoPi NEO and imagination. and IO, all integral part of a developer’s arsenal. over at www.friendlyarm.com. 8 008-011_LUD169.indd 8 10/08/2016 15:14 NVIDIA TOP FIVE Lesser- known Linux distributions 1 Scientifi c Linux Scientifi c Linux is defi nitely for those who have spent years learning the ins and outs of the wonderful world of Linux distributions. It includes a variety of packages; including Cluster Suite, Nvidia unveils big FUSE and Squashfs, which all work in tandem with one another in order to create a seamless user experience. changes in graphic 2 Yellow Dog Although Yellow Dog was originally released for use on early Apple computers, under its current driver update management, it has been transformed in to a Big fi xes are plentiful in Nvidia’s latest update It’s been just over a month since we last saw tool. Based on user responses, it seems that the 367.27 video driver update from Nvidia, both of these crashes have been rectifi ed in the which first introduced support for its costly, update. Another small bug that’s been squashed high-performance distribution that doesn’t have a steep learning curve. but impressive, GeForce 1080 and GTK 1070 addresses the system crash when the peer-to- graphics cards on the Linux kernel-based peer mapping tool was enabled, but we’ve yet to 3 Ubuntu Studio operating system. But that short timeframe see the effectiveness of this in action. hasn’t stopped it releasing the next milestone As well as bug fi xing, the one key inclusion Whether you’re into music, video or photography, update, 367.35. In its current form, the update of the 367.35 update comes in the form of Ubuntu Studio is the ideal choice for media is available for all UNIX-like operating systems, new support for VDPAU (Video Decode and enthusiasts. It comes packed with an array of media-friendly apps and a host of helpful editing including Solaris, FreeBSD and GNU/Linux, Presentation API for UNIX). For end users, it will tools to boot. although wider support is expected to appear in enable their Nvidia graphics card to decode 8K the coming weeks. encoded video streams, a massive step for media 4 Parted Magic The main thrust of this update is to provide consumption for Linux users. It’s expected that fi xes and tweaks to an array of issues fi rst the feature will be fl eshed out over the coming Parted Magic is half distro, half program. It includes all the necessary tools you could highlighted in the previous version. One of the months, as Nvidia explores the true capabilities possibly need to fi x broken partitions, and key fi xes is the stopping of console corruption, of VDPAU. Last but not least, the overall buffer is especially useful when trying to diagnose when users would resume their activity after write performance has been massively improved something that simply won’t boot. using the suspend feature, something that in the update. The implementation of DRM Dumb would often lead to additional errors appearing Buffers should make the buffer write process 5 Bodhi Linux on other areas of the desktop. Another big that little bit more manageable. Perhaps the best known of these is Bodhi Linux, a hole that’s been plugged is within the nvidia- Users can download Nvidia 367.35 for their 65 unique distribution in terms of both its looks and settings confi guration tool. Previously, there or 320bit system over at nvidia.com, or directly usability. It includes a fantastic window manager was a frequent crash on displays using 8 or 15- through the Nvidia desktop client installed on system, which is handy to have when organising bit colour depths when using the confi guration their machines. your desktop. www.linuxuser.co.uk 9 008-011_LUD169.indd 9 10/08/2016 15:14 OpenSource Your source of Linux news & views SKYPE Alpha release of Skype for Linux is fi nally here An all-new Linux client brings voice calls back to your machine It’s been a while since we’ve seen a release from Skype for its Linux client, so much so that the old client was stuck on version 4.3, Above Microsoft has ditched the old Skype client and launched something new whereas the Windows version is on version 7. Instead of providing a new update for the current currently involved. Behind the scenes, Skype of Skype for Linux, but a more wide-spread client, Microsoft has launched an all-new client is working on a big overhaul of its network release will be taking place soon. for Linux users to enjoy. infrastructure, to help improve connection Also new from Skype is a second client Due to the client currently being in its performance and keep server problems to an for Linux users to get excited about. Skype alpha stage, there are numerous restrictions absolute minimum. There’s also restrictions Web Client will work on both Chrome on on the type of calls that can be made, with only Linux machines, as well as any Chromebooks Instead of providing a voice calls working at the time of writing. And running the Chrome OS. By and large, the core new update for the current for those hoping to use the old version of Skype capabilities of the program are the same as in the meantime, it won’t work in tandem with the desktop version, and it runs on Chrome’s client, Microsoft has the new client, so be warned. WebRTC to provide a plugin-free Skype launched an all-new client In its current state, only users of the current experience. Users should head over to Skype. OS X, Windows or Android version of Skype will com for download links and installation guides for Linux users to enjoy be able to get their hands on the alpha release to both of these clients. OPEN SOURCE Toyota and others join Open Invention Network Established back in 1995 in a bid to defend self-driving cars, many of which are embracing stop any internal battles between members. Linux against intellectual property attacks, the open-source ethos, patent protection is at In return, all members have a say on how the Open Invention Network was spearheaded an all-time high. Also joining Toyota are Ford the Open Invention Network handles its by an array of leading technology brands. Motor, Kia and Hyundai. businesses and enforces its shared patent While the likes of Red Hat, Sony, IBM and Philips In this case, the same rules apply as any pool. Considering the potential cost of patent are all credited with launching the alliance, it has other company joining the network; members enforcement and litigation, the alliance has grown dramatically to cover many areas outside need to agree that they’ll share their patents proven to save many companies a lot of money of core technology companies. with the OIN License Agreement, arguably to and headaches. One of the last remaining areas not to In total, the Open Invention Network boasts get heavily involved with the Open Invention The Open Invention over 2000 members, covering everything from Network has been the automotive industry, mobile, IoT, embedded technologies, and now Network handles its but that has just changed for the better. automotive. Following on from the recent rise in Toyota has led a wave of leading automotive businesses and enforces members, rumours are hinting that Microsoft manufacturers to join the network and their may soon be jumping on board with the Open its shared patent pool reasons for doing so are clear. With the rise of Invention Network, but nothing is confi rmed. 10 008-011_LUD169.indd 10 10/08/2016 15:14

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.