FEATURE

RASPBERRY PI 4 STARTER

t’s been a month since 4 came out and we’ve been seeing a lot of people on social media get stuck in with their new Get to know Iincredible computer. We’ve also seen a lot of new GUIDERaspberry i users finally take the plunge and get their first Raspberry i and to those people we say: welcome! your brand new ome o you may still be getting your heads around your new Raspberry i so were here to help with our tarter uide that should teach you Raspberry Pi 4 some o the and beyond o how to use it rab a micro card and find a spare monitor By Sean McManus because its time to hae some un

24 magpi.cc Raspberry Pi 4 Starter Guide FEATURE

Basic setup

he heart o your new computing 01 eperience Raspberry i ind out the ull amaing specs here magpi.cc/benchmarks

Power up to two 4K monitors 02 with Raspberry i s dual micro- ports

ith a keyboard and mouse you can 03 easily use it as a desktop computer

he ports allow or 04 high-speed file transers

02

01

04

03 magpi.cc 25 FEATURE

FIRST STEPS WITH

Now you’ve set up your Raspberry Pi, discover some of its accessories and explore the Raspbian RASPBERRYoperating system. SeanPI McManus is your guide

Raspberry Pi Case Protect your Raspberry Pi rom spills and dust with a chic case Ocial Raspberry i cases come in redwhite and grey black but there are plenty o cases aailable rom other companies too youll be building electronics Sense HAT proects look or a case that gies you easy access to the O s short or ardware ttached on op magpi.cc/YNvYfF are accessories that plug onto a Raspberry is O pins he ense includes a colourul grid o s and a fie-button oystick ts packed with sensors gyroscope accelerometer barometric pressure sensor Raspberry Pi Camera Module V2 magnetometer thermometer and humidity ou can plug a Raspberry i Camera sensor ts a portable science lab odule into a dedicated connector on magpi.cc/sense-hat Raspberry i and it has an -megapiel sensor t works with Raspberry i and hoot a moie in high definition get close to nature with a bird-bo cam or secure your home Fan SHIM magpi.cc/camera Raspberry Pi 4 is a bit more power hungry than earlier models you find it runs hot or CamJam EduKit #3 your application ith its easy control o electronic try using the an circuits Raspberry i is ideal or t proides a robots his kit contains eerything -controllable needed to build your first robot fan to cool a Raspberry including a motor controller board i ou can use it together with s by sensors and wheels ake a chassis rom fitting a booster header to lit them aboe ego -print one or een use the bo the an Read more in our reiew on page magpi.cc/RhpjZh magpi.cc/qZYBWd

26 magpi.cc Raspberry Pi 4 Starter Guide FEATURE

Meet Raspbian wih e 01 03 06 01 Click the Raspberry i logo to open the applications 02 04 07 05 menu his is where youll find the sotware thats pre- installed in Raspbian and 09 anything else you add later

02 Click the globe or uick access to the web browser.

03 Click the olders to open the ile anager ou can use it to find moe 08 copy and delete files on your storage deices hy not eplore the inu file system

04 ind the erminal here t gies you powerul tools or managing your files and deices and the command line is oten the uickest way to get things done

05 olume control Right- hoer the mouse pointer wirelessly control your store your files in the click to select audio output oer the icon to see your Raspberry i deice /home/pi older Raspberry is address 06 WiFi options. Turn 08 ile anager se the 09 ith scientific ii on and o and switch 07 anage luetooth hierarchical browser on and paper modes this networks here the icon connections. You can use the let or the o menu to calculator is handy ind it is blue like this youre luetooth deices such find deices connected to in the ccessories section o connected ou can also as keyboards and mice to Raspberry i ou should the applications menu

Raspberry Pi nfirain

Need to adjust some settings? he o adust the amount o memory or Raspberry i Configuration tool is the or to set older Raspberry i in the reerences section o the models to run aster oerclocking applications menu n its ystem tab isit the erormance tab you can change your password adust ou can change the time one display options and set Raspberry keyboard and other geographic i to boot to the command-line options in the ocalisation tab interace instead o the desktop here are separate options in n the nteraces tab you can reerences or configuring the enable connections including appearance audio main menu remote O access and the camera mouse and keyboard and screen

magpi.cc 27 FEATURE

AWESOME

APPLICATIONSDiscover some of the software Claws Mail | INTERNET end and receie eail. he setup wiard that comes with Raspbian, and helps you add your eail account, and the strealined interface shows you your ailboes, find out how to install more essage list, and a preiew of the selected essage.

aspbian comes with a selection of pre- installed software (which depends on VLC | SOUND & VIDEO which version you install), so you can start Listen to usic while youre coding using Rworking, learning, and making things straight L, a fully featured edia player for away. Ranging from productivity suites to games, usic and ideo. It can play digital les, streas, youll nd a wellcurated collection of software is and physical edia such as Ds and DDs. ust a click away, in the applications enu. here are lots ore packages to browse and install, too. Minecraft Pi | GAMES e call it a gae, but its ore a way LibreOffice Writer | OFFICE of life. ith inecraft i, you can build o coputer is coplete without a word things in reatie ode, and write progras to processor. Librece riter has all the change the gae world. font and foratting options you would epect, and has basic copatibility with icrosoft ord. Python Games | GAMES hese teabreak gaes are fun, but LibreOffice Calc | OFFICE theyre also great ython deos. ind the ork out your budgets with this code in the /usr/share/python_games folder, and spreadsheet package. If youre failiar open it in a ython editor to see how it works. with icrosoft Ecel, youll feel at hoe here. Librece alc can open and use typical Ecel les. SmartSim | PROGRAMMING Eperient with designing and testing LibreOffice Impress | OFFICE digital logic circuits. ou can deelop If youre presenting to a roo of people, custo coponents, and then incorporate the dont panic Ipress has your back. se into other circuits. Download eaples and read it to craft and display your slide deck. Its largely tutorials at smartsim.org.uk. copatible with icrosoft oweroint.

Sense HAT Emulator Chromium | INTERNET PROGRAMMING hroiu is the opensource ersion his eulator features onscreen of oogle hroe. he default search controls to simulate temperature, pressure, engine in Raspbian is Duck Duck o, which huidity, and deice position changes. A great way proises not to track you online. to try out the ense A before you buy one

28 magpi.cc Raspberry Pi 4 Starter Guide FEATURE

Updating your software Why not software comes in packages, which are compressed archives ina that you can download. package manager is used to find and install hee them including any other sotware they need to work | PROGRAMMING se ddRemoe otware to Fritzing esign and document your update your packages rom the electronics circuits based on menu choose reerences dd Remoe otware Click on Raspberry i with this design tool e use Options and Check or pdates it to make circuit diagrams in The MagPi. ou can also update rom erminal n Raspbian the package manager is called pdating all the sotware rom the erminal is a two-step process irst enter sudo apt-get update in the erminal to update the cache o aailable sotware hen enter GNU Image sudo apt-get upgrade Manipulation Program to update the sotware installed on Raspberry | GRAPHICS i oull be told what changes will be made and asked to confirm by (GIMP) is a powerul image editor ou can typing Y and pressing ENTER. use it to create digital art but its best eature is probably the clone tool which enables you to retouch holiday photos

Mathematica PROGRAMMING ood or more than ust maths athematica uses the olram language which has data and intelligence built in nstall it rom Recommended otware in the reerences section o the applications menu

Installing software The easiest way to manage software is to use the Add / Remove Software tool in the Preferences part of the applications menu. t proides a isual ront-end or the package manager ou can click a category on the let to browse applications or enter a keyword in the search bo in the top-let to look or a particular application Choose the applications you want to install by ticking the bo beside them ome packages reuire other packages to work properly but the tool will take care o that or you o remoe an application untick its bo hen youe made your choices click O to install or remoe your sotware

magpi.cc 29 FEATURE

GET CONNECTEDIf your Raspberry Pi is in a tree photographing nature, you don’t want to climb up there just to update it. Log in remotely and take control

here are two technologies you can use to he software for is preinstalled on connect to your Raspberry Pi: Secure Shell Linu, ac, and indows . tart by opening (SSH) and Virtual Network Computing the coand line. n a ac, nd it by typing T(VNC). efore you can use the, they need to be erinal into the potlight search. n indows switched on in the Raspberry i onguration , se + to open the Run dialog bo, then settings. o do so, click the Interfaces tab, then type in cmd. enable andor . nce youre in the coand line, enter oth approaches reuire you to know the I ssh [email protected], but replace the nubers address of your Raspberry i deice. o nd out, with the I address of your own Raspberry i click the erinal icon on the taskbar, and enter deice. he pi bit is your usernae. ifconfig at the propt. It will show you all your network connections. oure looking for an I address, which will be four nubers with a dot SSH enables you to use between the, like .... oull nd it the command line on your beside inet, in the details for wlan if youre using ii or in the eth suary if youre plugged in to Raspberry Pi remotely, so the network. it’s very handy Using SSH enables you to use the coand line on he rst tie you connect to a deice using , your Raspberry i reotely, so its ery handy for youll see a warning that shows the EDA key installing software and ing conguration les. for the deice youre trying to connect to. ou can ou cant use to run any applications that need if you wish alidate that this is correct by using the graphical desktop, though. ssh-keygen -l -f /etc/ssh/ssh_host_ecdsa_key.pub in the Raspberry i erinal. ut its usually to just type in yes and then press ENTER to conr Tip! you want to connect. oull be asked to enter the password for your See our SSH Raspberry i deice. ou wont see the cursor oe tutorial on page while you do this, so type on regardless. hen you or more detailed press ENTER, youre in oull see a Linu welcoe information on essage, the date and tie of your last login, and using to then the Raspbian coand propt, waiting for remotely control a instructions. hen youe nished, enter exit to Raspberry Pi. leae the session. If youre using an earlier ersion of indows, download u fro putty.org. Enter your Raspberry is I address in the ost ae bo, and click pen. Again, youll see a warning if this is your rst connection, which you can safely disiss. Log in as pi, and enter your password. Raspberry i is Enable SSH and VNC before you try to use them now at your coand

30 magpi.cc Raspberry Pi 4 Starter Guide FEATURE

Top Tips for VNC

t the top o C iewer in the middle is a tiny toolbar he ile ranser option enables you to easily copy files to Raspberry i

Using VNC Viewer to manage Raspberry Pi from an iPad

Using VNC irtual etwork oputing enables you to reotely access the Raspberry i desktop, so you can anage les and run software using it. oe people use to share their keyboard, ouse, and onitor between a and Raspberry i. Raspbian includes erer, which runs autoatically in the background if youe enabled it in your settings. oull need to download and install end files rom Raspberry i using the ile ranser iewer magpi.cc/FuGnye on the deice you option in C erer in Raspbian se the three-bars want to use to control Raspberry i. iewer is menu top-right to find it aailable for indows, ac, and Linu. here are also Android and i apps, so you can use to control Raspberry i fro a obile deice, although its rather ddly without a real ouse and keyboard. ptionally, by creating a Real account and registering your Raspberry i, you can then access it fro anywhere in the world using iewer. hen you start iewer, itll ask you to enter a erer address. his is the I address you noted when you ran ifconfig on your Raspberry i. he rst tie you connect to a deice, iewer warns you that it has no record of connecting to this deice before, and shows you the deices signature and identication catchphrase. o erify youre connecting to the correct deice, click the icon on the right of the taskbar in Raspbian to see your deices details. iewer propts you to enter the usernae and password for the deice youre connecting to. oull then see your Raspbian desktop in the iewer window. ou can now use your keyboard and ouse or touchscreen on a obile deice se the toolbar in C iewer to start a chat to control the Raspbian desktop, including using session with anyone using the serer Raspberry i progras installed on Raspberry i. deice and anyone else connected to it remotely

magpi.cc 31 FEATURE

CODE TO JOY Raspberry Pi comes with everything you need to start programming

f you’ve never programmed before, you’re in for a treat. Raspbian coes with seeral integrated deelopent enironents IDEs Iyou can use to write your own progras, supporting languages that are friendly to use, and fun to tinker with. If youre a eteran coder, youll nd powerful IDEs are included to help you be productie, too.

Scratch 2 Node-RED LANGUAGE: SCRATCH LANGUAGE: JAVASCRIPT/NODE-RED ith its friendly draganddrop coands and odeRED enables you to use a flowchart to progra a library of sprites and sound effects, cratch data flows for Internet of hings applications on akes it siple to get started with coding. y Raspberry i. It uses aacript, the language of the minimising typing, and guiding you to sensible web. Run the odeRED console in Raspbian and block cobinations, it helps you to aoid coon then isit http://localhost:1880 in your browser to istakes. Dont be fooled by its accessibility, progra it. or help, see nodered.org. though its a fullyfledged prograing language, with plenty of potential. LANGUAGE: aa is one of the LANGUAGE: PYTHON worlds ost popular ython is one of the ost popular languages on programming Raspberry i, and honny is our faourite way to languages. reenfoot edit it. In a single window it shows you your code, makes it easier to the shell, and your data ariables, so you can easily learn, by providing a friendly environment for see whats going on and any bugs that creep in. building siple gaes. he editor incorporates a gae world, and you add aa code to iage obects to control their interactions. ind out ore Sonic Pi at greenfoot.org. LANGUAGE: SONIC PI Learn how to compose and perform usic with code LANGUAGE: LOTS! onic i incorporates If youre looking for a lightweight but powerful synths, saples, and IDE, try eany. It supports any languages, effects that you can including L, , aa, , aacript, and erl. control by writing progras using a language based Its code autocopletion and synta highlighting on Ruby. ou can deelop and odify progras can help you code faster, and reduce errors. ur while the usic plays, to perfor lie concerts or faourite feature ode folding, used to show or iproise at hoe. hide logical chunks of code in a long progra.

32 magpi.cc Raspberry Pi 4 Starter Guide

FURTHER

There’s a wealth of resources available to support RESOURCESyou as you learn more about Raspberry Pi and Raspbian

The Official Raspberry Official Raspberry Pi Pi Beginner’s Guide Documentation ailable to buy in print and as a ree he documentation proides concise user this book shows you how to set up Raspberry guides or inu inecrat onic i cratch i and gets you started with programming and ython ts also the place to go or it in cratch and ython t also coers the adice on configuring Raspberry i hardware ense and Raspberry i Camera odule specifications and remote access tips seul with code eamples you can build and tailor or both beginners and power users magpi.cc/BGbook rpf.io/docs

GPIO Zero Documentation Conquer the Command Line ee how easy it is to start programming your e publish a series o short books called The own electronics projects for Raspberry Pi. MagPi Essentials and this one eplains the he documentation or O ero shows you erminal including using it or connecting how to connect up sensors s motors disks compiling sotware and backing up ou and more ith a bag o cheap components can download all the books in the series and you can start building your first circuits past issues of The MagPi at magpi.cc/issues. rpf.io/gpiozero magpi.cc/CLIbook

Hacking and Python Games Making in Minecraft o behind the scenes o the ython games that inecrat on Raspberry i is a come pre-installed in Raspbian with l weigarts great way into the world o coding ree online book t eplains the program code or his book another in The MagPi seen o the games in detail and lets you study Essentials series shows you how to another our listings yoursel shape the world with ython code magpi.cc/RTfkvD use a connected as a treasure sensor and use onic i and ode- R together with inecrat magpi.cc/MCbook

magpi.cc 33