Ex­ploit the Pi

The Rasp­berry Pi was created to be a low-cost ed­u­ca­tional com­puter, but thanks to hard­ware up­grades it can be a lot more

Linux User & Developer - - Feature -

Make the best use of the hard­ware up­grades in the pop­u­lar lit­tle pow­er­house.

Server dis­tri­bu­tions are no­to­ri­ously dif­fi­cult to set up, but Di­etPi sim­pli­fies the process with a menu

the Rasp­berry Pi was de­signed as an af­ford­able and func­tional com­put­ing de­vice for kids who wanted to learn to pro­gram. How­ever, the de­vice hit it off with the hack­ers and mod­ders who be­gan us­ing it cre­atively and made it us­able to au­di­ences and ap­pli­ca­tions that the orig­i­nal cre­ators hadn’t imag­ined. The lat­est it­er­a­tion of the in­ex­pen­sive com­puter has am­ple re­sources and yet is small enough to run ev­ery­thing from your smart lamp to your file server. While Rasp­bian does an ex­cel­lent job as a gen­eral-pur­pose distri­bu­tion for the Pi, spe­cialised ap­pli­ca­tions re­quire spe­cialised dis­tri­bu­tions, such as the fol­low­ing.

Op­ti­mised de­ploy­ments

One of the most pop­u­lar uses for sin­gle­board com­put­ers such as the Rasp­berry Pi is as an al­ways-on and ef­fi­cient stand­alone server. Di­etPi (https://di­etpi.com) is one of the best op­tions for rolling out such a server.

Di­etPi in­stalls the bare min­i­mum com­po­nents you need to flesh out the in­stal­la­tion ac­cord­ing to your re­quire­ments. The rea­son be­hind the distri­bu­tion’s suc­cess is its hand­ful of cus­tom scripts, one of which en­ables you to in­stall soft­ware op­ti­mised for the Pi. Server dis­tri­bu­tions are no­to­ri­ously dif­fi­cult to set up, but Di­etPi sim­pli­fies the process by of­fer­ing a nice menu to help you pick and choose a func­tion­al­ity for your de­vice. For ex­am­ple, us­ing Di­etPi’s cus­tom pack­age man­age­ment script you can turn the base in­stal­la­tion into a stream­ing me­dia server, file shar­ing server, backup server, web server, VPN server, seed box and lots more. If servers aren’t your thing, Di­etPi gives you the op­tion to turn it into a graph­i­cal desk­top with ei­ther Mate, LXDE, Xfce or GNUStep desk­tops. As it’s a De­bian-based sys­tem, out­side of the script you can use the com­mand-line APT pack­age man­age­ment sys­tem, or pull-in the Sy­nap­tic graph­i­cal apps for eas­ier pack­age man­age­ment. Fur­ther­more, the cus­tom script also en­ables you to over­clock the Pi, mount re­mote shares and even en­able the Pi cam­era mod­ule.

Docker in pro­duc­tion

Be­fore you can use Docker in pro­duc­tion you need to de­cide an OS to run it on. You can run it on just about ev­ery Linux distri­bu­tion, but RancherOS (https://rancher.com/rancheros) gives you a min­i­mal­ist Linux en­vi­ron­ment that’s tai­lored to ex­plic­itly run Docker. RancherOS is stripped right back to the bare es­sen­tials with only the min­i­mum amount of soft­ware needed to run Docker. Ev­ery­thing in­side the OS runs as a Docker con­tainer. Ar­chi­tec­turally speak­ing, there’s the Linux ker­nel over which runs a sys­tem docker as the first process, which man­ages all the sys­tem ser­vices such as rsys­log and udev. Then there’s an­other con­tainer that runs all the other con­tain­ers that users want to run. This ar­range­ment works well for a pro­duc­tion server as it cre­ates a nice level of iso­la­tion and avoids sys­tem ser­vices be­ing im­pacted by the users.

Al­though the OS it­self is very in­ter­est­ing, what re­ally makes it use­ful is the Rancher plat­form that runs on top of it. Rancher can man­age and mon­i­tor con­tainer hosts and pro­vides things like re­source man­age­ment, con­tainer net­work­ing, ser­vice dis­cov­ery via DNS, load balanc­ing based on HAproxy and more. You can run RancherOS on bare metal, vir­tual hosts and var­i­ous cloud plat­forms. One of the bare-metal plat­forms it sup­ports is the Rasp­berry Pi 3. Trans­fer the im­age to an SD card and re­fer to the on­line doc­u­men­ta­tion to get started.

Power IoT de­vices

Be­sides ed­u­ca­tion, the one area in which the Rasp­berry Pi has had a mon­u­men­tal im­pact

is the In­ter­net of Things (IoT). The open, hack­able na­ture of the small and in­ex­pen­sive com­put­ing de­vice has made it one of the most pop­u­lar pro­to­typ­ing and de­vel­op­ment boards for de­vel­op­ing and pro­gram­ming all kinds of IoT projects.

Of course, stan­dard bare-bones dis­tri­bu­tions such as Ubuntu Core (www. ubuntu.com/core) give you a won­der­ful base plat­form to code your IoT projects – but you don’t re­ally need to be a pro­fi­cient pro­gram­mer to in­ter­act with your appliances and de­vices. You can use Prota Pi (https:// prota.info/prota/pi) to make the Pi talk to your de­vices with­out writ­ing any code.

Prota Pi is a head­less OS with which you can in­ter­act with the de­vices from a pointand-click, HTML5-based user in­ter­face. The core au­to­ma­tion en­gine of Prota OS is named Sto­ries and helps you cre­ate au­to­ma­tion rules for con­nected de­vices. These rules are based on the apps avail­able in Prota Pi. One of the most use­ful is the GPIO app that al­lows you to con­trol all the GPIO pins on a Rasp­berry Pi from di­rectly within Prota Pi’s re­mote in­ter­face.

Check out some of the in­ter­est­ing IoT and au­to­ma­tion projects shared by the de­vel­op­ers of the Prota Pi, Naran Inc, on in­structa­bles.com (www.in­structa­bles.com/ mem­ber/Naran/in­structa­bles) to get a taste of the pos­si­bil­i­ties on of­fer – you may be sur­prised at what it can do.

You don’t re­ally need to be a pro­fi­cient pro­gram­mer to in­ter­act with your

IoT de­vices

above Be­sides the Rasp­berry Pi, you can run the Di­etPi dis­tr­bu­tion on sev­eral other SBCs in­clud­ing Bea­gleBone, Ba­nana Pi, Or­ange Pi and more

Newspapers in English

Newspapers from UK

© PressReader. All rights reserved.