Sunteți pe pagina 1din 12

http://lifehacker.

com/5976912/a-beginners-guide-to-diying-with-the-raspberry-pi

A Beginner's Guide to DIYing with the Raspberry Pi The Raspberry Pi is a wonderful little computer that fits in the palm of your hand, yet packs enough power to run your home media center, a VPN, and a lot more. Before you can do anything awesome, however, you need to configure it and install an operating system. ere!s how. It's Raspberry Pi week at Lifehacker, and for the next five days we'll be showing you some cool DI pro!ects you can put together with this little miracle of a device" If you haven't bought one yet, check out the first section below to learn more about what it is, what you'll need, and the cool stuff you can do with one" Update: Raspberry Pi week is over! Check out these Raspberry Pi guides to see all the fun stuff we did, and check out our Raspberry Pi tag for more cool projects !his past week, we walked you through some of the common projects people tackle with their Raspberry Pi, like:

"nstall Raspbian and get started with Raspberry Pi #"$ Build an %B&'(powered media center )et up a personal VPN for secure browsing anywhere you go 'reate an *irPlay receiver and stereo companion

What's a Raspberry Pi?

The Raspberry Pi is a very capable mini computer that!s small enough to fit in your pocket +even though you!d probably never keep it there,. -or about ./0(12, you get a caseless computer with #&" and analog composite video output. $ou can add up to two 3)B devices +which, in most cases, will be a mouse and keyboard, and connect it to the internet via wired ethernet. The Raspberry Pi is powerful and ine4pensive, allowing you to create a home media center, internet radio, or even your own VPN server on the cheap. That said, a little setup and a lot of other parts are re5uired to get it up and running. "n this post we!ll take a look at how to get a Raspberry Pi set up so you can start using it for a variety of purposes.

What You'll Need


!he Raspberry Pi may be a computer all on its own, but you"ll still need a lot of other things to make it work:

A Raspberry Pi6 "f you!re not sure where to buy one, you!ll find links below to help you out. An HDMI- or composite video-capable television or monitor6 "n this post we!ll be working with an #&"(capable monitor because it offers better resolution and built(in sound. $ou can use analog if you want, however. An HDMI or composite video cable6 $ou!ll need this cable to connect your Raspberry Pi to your television or monitor. A 4GB Class 4 SD card +or better, and a card reader +if you don!t have one built into your computer,6 &ost )# cards will work, but some aren!t compatible and will therefore cause issues. $ou can find out which cards are compatible, or locate a place to buy a compatible card with an operating system pre(installed, on this page. A USB eyboard and mo!se6 *ny standard 3)B keyboard or mouse will do. 7ireless +non(Bluetooth, peripherals worked for me, but " had to unplug them and plug them back in after the Raspberry Pi booted. $ou!ll have fewer issues with fully wired keyboards and mice. An et"ernet cable6 *ny standard ethernet cable will do. $ou only need this to connect to your network and the internet, however, so you can leave this item out if desired. A #ood $!ality% micro USB po&er s!pply t"at can provide at least '((mA at )*6 &ost modern smartphone chargers supply 822m* at 0V, but not all do. 'heck the bottom of your charger and look for a block of te4t. $ou!ll see its output values in that te4t which may read 2.8* instead of 822m*,. "f it offers at least that much power, you!re probably good to go. 9ust don!t use a poor 5uality charger or you may run into problems. A +,)mm stereo a!dio cable6 $ou only need this if you!re using analog video and want to connect your Raspberry Pi to a set of e4ternal speakers or internal ones on your television or monitor.

Raspberry Pi Model B Re ision !"# $%&!MB' #ou can find the majority of those items pretty much anywhere, but Raspberry Pi units are difficult to come by due to popular demand $ere are a few places to try that often have a few in stock:

*dafruit +the kit is almost always in stock if the singular unit isn!t, *ma:on +almost always in stock, but through third parties at a premium, *llied ;lectronics +only available in North *merica,

%nce you"ve got your Raspberry Pi, you can start setting it up!

(ow to )et *p Your Raspberry Pi with a Basi+ ,perating )yste-

#ou can use the Raspberry Pi for all sorts of different things&some of which may re'uire their own special operating systems&but to start out, it"s a good idea to get ac'uainted with the Pi by installing Raspbian, a Raspberry Pi(focused version of )inu* $ere"s what you need to do

)tep ,ne. Prepare Your )D /ardP


+irst things first, we need to prepare your ,- card for the Raspberry Pi !his involves formatting it properly and putting Raspbian, the standard Raspberry Pi operating system, on it !he steps vary depending on whether or not you"re on a .ac, )inu*, or /indows PC, so just follow the instructions for your operating system below

Windows

<. #ownload the lastest version of Raspbian and un:ip the .img file inside. +"t!s almost 2. #ownload 7in/=#isk"mager and un:ip the application +.e4e file, inside.

022&B so it may take a little while to download.,

/. "nsert your )# card into your 7indows P' using a card reader. 1. >pen 7in/=#isk"mager.e4e, the application you ?ust downloaded, by double(clicking on it. "f you!re running 7indows 8 or @, right click on it and choose ARun as *dministratorA instead. 0. "f your )# card isn!t automatically detected by the application, click on the drop(down menu at the top right +labeled A#eviceA, and choose it from the list. B. "n the image file section of the application, click the little folder icon and choose the Raspbian .img file you ?ust downloaded. 8. 'lick the 7rite button and wait for 7in/=#isk"mager to do its thing. 7hen it finishes, you can safely e?ect your )# card and insert it into your Raspberry Pi.

OS X

#ownload the lastest version of Raspbian and un:ip the .img file inside. +"t!s almost 022&B so it may take a little while to download.,
1. #ownload RPi(sd card builder +be sure to pick the appropriate version for your

=. /. 1.

0.
6.

8.

installed version of >) %, and un:ip the application. "nsert your )# card into your &ac using a card reader. >pen RPi(sd card builder. $ou!ll immediately be asked to choose a Raspbian image. 'hoose the .img file you downloaded earlier. $ou!ll be asked if your )# card is connected. )ince we inserted it earlier, it is, so go ahead and click 'ontinue. $ou!ll be presented with )# card options. "f you only have one inserted, you won!t see anything else in the list and it!ll be checked. "f not, ?ust check only the card you want to use and click >C. ;nter your administrator password and click >C. $ou!ll be asked if the )# card was e?ected. This is supposed to happen, as the application needs to unmount it so it can perform a direct copy. #ouble(check that your )# card is no longer available in the -inder. DO NOT remove it from your 3)B port. 7hen you!re sure, click 'ontinue. RPi(sd card builder finishes prepping your )# card, safely e?ect it and insert it into your Raspberry Pi unit.

RPi(sd card builder isn"t an app so much as it"s an 0utomator action that acts like one ,ome people have reported issues using it, so if you run into problems just open up the !erminal app 1#our $ard -rive 2 0pplications 2 Utilities 2 !erminal3 and follow the instructions for )inu*

Linux

#ownload the lastest version of Raspbian and un:ip the .img file inside. +"t!s almost 022&B so it may take a little while to download.,
1. >pen up your Dinu4 terminal emulator of choice. "f you don!t have one, try our

favorite. 2. "nsert your )# card. "f it mounts automatically, unmount it but make note of its location +e.g. EdevEdisk=s<,. Even though the card is unmounted, do not remove it from the reader . "n the command line, you!re going to need to type a single line to copy the contents of the Raspbian .img file to your )# card. "t!ll look like this6 sudo dd if=PATH_TO_IMG_FILE of=PATH_TO_SD_CARD_MOUNT_POINT bs=1m $ou!ll need to replace P*T FT>F"&GF-"D; with the path to the .img file and P*T FT>F)#F'*R#F&>3NTFP>"NT with the path to the )# card mount point. +The bsH<m ?ust specifies the byte si:e and you don!t need to mess with it., 7hen you!re done, the command should look something like this6 sudo dd if=/Use s/!d!"#is/Do$%&o!ds/'(1')1')1*)$#ee+,) !s-bi!%.im/ of=/de0/dis1's1 bs=1m "t!s very important that you do not get this information wrong or you could end up writing Raspbian to the wrong disk and cause serious data loss. Be carefulI 7hen you!re sure you!ve got everything right, press enter. 1. $ou will be prompted for the root password +or your administrator password for those of you on >) % who are using this method,. Type it and press enter. 0. "t!ll take some time for the dd command to copy everything over to your )# card. 7hile that happens, it!ll probably look like the Terminal fro:e up. #on!t worry, it!s still working and will likely take longer than an average =GB copy to an )# card +so be patient,. 7hen it finishes, the command prompt will return and your )# card will be ready. ;?ect it safely and stick it in your Raspberry Pi.

)tep 0wo. (oo1 *p Your Raspberry Pi

Connecting everything to your Raspberry Pi is pretty easy ,tart by connecting the $-.4 cable from the unit to your television 1or monitor3 4f you"re using the analog composite video connection instead, connect it to your television 1or monitor3 and plug in a set of speakers to the 5 6mm audio jack 4f you want your Raspberry Pi to connect to your network and7or the internet, use an 8thernet cable to connect it to your router 4f you"ve set up a computer before, this should all seem familiar +inally, you need to connect your Raspberry Pi with a micro U,9 power adapter 0s mentioned earlier, you need an adapter that can provide at least :;;m0 at 6< +ortunately, you probably already have one .any smartphone and tablet chargers utili=e micro U,9 and provide :;;m0 at 6< 1or more3 #ou can find out by reading the small te*t on the plug and looking for the output section 1>ote: it may say ; :0 1or higher3 instead of :;;m0 3 /hen you have a compatible power adapter on hand, connect it to a micro U,9 cable and then connect that cable to the micro U,9 port on your Raspberry Pi unit 4t"ll turn on all by itself and you should see it boot for the first time

)tep 0hree. /on2igure Your Raspberry Pi

%nce your Raspberry Pi boots for the first time you"ll need to configure a few things #ou"ll know it"s ready for you when you see a Raspi-config window with a pretty big list of settings #ou can mess with the others if you feel so inclined, but the only thing you really need to do is e*pand the file system so you can use up all the space on your ,- card !o do so, follow these steps:
1. )elect e-pand.root/s +the second option, and press enter.

=. 'onfirm that you want to e4pand the file system and let Raspbian do its thing. /. 7hen you!re returned to the configuration list, go all the way to the bottom and select the -inish option. 1. "t!ll ask you if you want to reboot. 'hoose yes. #our Raspberry Pi will reboot and take a little longer this time because it needs to e*pand the file system 0fter a about a minute you"ll be asked to log in #ou"ll need to use the default username and password: Username: pi Password: raspberry %nce you"ve logged in, you"ve got yourself a working Raspberry Pi Congratulations!

%f course, this is far from the end #ou can use your Pi as much more than just a tiny computer, so check out )ifehacker all week at ?:;; 0. P! for how(tos on some of the coolest things you can do with it !omorrow we"ll show you how to turn that tiny little board into a killer @9.C media center

Dis+uss

Patrick -rawley3*dam #achis >kay, "!ll play the role of the non(tech(head interloper +which " am, here6 !his sounds like a lot of fun ( 4 love the -4# factor and the farmer"s(market pricing ( but can a Pi conceivably function as a normal desktop computer replacementA /ill it function as an effective /eb browser and office(software platform, which is B6C of what 4 and most other people do with a computer anywayA 1Could it maybe even be better than crapware(heavy consumer productsA3 !his of course leads to concerns about what software e*actly would be best here 1is there even %ffice for )inu*A i!unesA3 but just curious about the core idea D7ED7D5 ?:EDam

tvguy?ohn3Patrick -rawley Patrick, the system is still relatively new, and it!s based on *R& architecture. This means that many programs that run on other chips +say, 4@B(based,, won!t run on the Pi. !hat being said, programmers are indeed busy either porting programs over, re(compiling them 1where applicable3, or just writing new software 4t already has a new Fapp storeF ( like i!unes or the Ubuntu market ( although it"s a little limited in terms of number of apps 1think less than a hundred3 9ut to answer your 'uestion ( it does run )ibre%ffice 1a great .icrosoft(%ffice replacement suite3, as well as 0udacity 1an audio editing program3 4f you use the Rasbian %,, it"s based off of a flavor of )inu* called -ebian, and it comes pre(loaded with a bunch of cool software, including a fully(functional web browser and others 4 actually got mine up and running last night, and was pretty impressed with it /ith additional media licenses 1less than GD;3, it"ll play back full($- media without any problems ,o if you"re just typing emails, browsing the web, and working on office documents ( yes, it would serve as a desktop replacement $owever, 4 wouldn"t e*pect it to edit $- video or render 5d graphics 'uickly 1though, with its on( board HPU, someone might port 9lender over to it, so we"ll see 3D7ED7D5 ?:55am

7hitson Gordon3Patrick -rawley " haven!t tried to use it as a regular computer. "t could, but " don!t know if you!d really want toJit!d be pretty darn slow. The Acore ideaA isn!t to use the Raspberry Pi as a day(to(day computerK instead, the core idea is to use it for numerous #"$ pro?ects that would normally re5uire a computer, but that don!t really re5uire a powerful computer. 7e!ll show off some of those pro?ects over the coming weekK this was a bit more about getting oriented and getting inspiration for things you could do with it using Dinu4Jnot necessarily setting it up as your day(to(day desktop computer.<E=<E</ @6//am

krystalL=0@B3*dam #achis

"!m << and "!ve been using a Raspberry Pi since new years. " wanted to point out a mistake in the article and one in the comments. -irst, there are two 3)B ports, but you can connect a D>T more than two 3)B devices if you plug in a 3)B hub. )econd, one of the commenters said that you can!t read te4t on composite video. " do it all the time and have no problem. "!m blogging about my adventures. 'heck it out at http6EEraspberrypikid.wordpress.com<E=<E</ L6=1am

Tycho<=/3krystalL=0@B " ?ust took a look at your blog. " en?oyed it. Thanks for sharing it.<E=<E</ /6/<pm

rcarusoL23krystalL=0@B *re the usb ports poweredM Powerful enough to run a portable hard drive off of themA 1the kind that does not plug into the wall3D7ED7D5 D;:;Bpm

'rypton1@23*dam #achis $ou could use usb(imagewriter for ubuntu based distros in step <. noobs like meI<E=<E</ @6//am elped a lot for linu4

sudoecho3'rypton1@2 3buntu doesn!t support *R& VB architecture.<E=<E</ <6=Bpm

'rypton1@23sudoecho " meant if you are using ubuntu to flash the sd card in step <<E==E</ <<61=am

*udi02223*dam #achis &y Pi has been a sufficient media streamer for 8=2P content, but "!m thinking of replacing it with a Roku to get the T7' app. " want a Pi'ade, but the kickstarter fund has been reached and " can no longer back it. " hope they do well and will be available for purchase later this year.<E=<E</ L6=/am

9'B0<023*udi0222 3gh, " have had nothing but issues with Roku since " bought a few months ago. 7hat are you using your Pi for, in terms of 8=2 streaming. ;4ternal # to Pi to tv or whatM<E=<E</ L60Lam

*udi022239'B0<02 Running RaspB&' to stream .mkv from a 7indows @ P', using )&B protocol. " also connect an e4ternal flash drive sometimes. Both handle the playback pretty much flawlessly, sometimes when streaming there are buffering issues but that is mainly due to my networkEhost P', " believe.<E=<E</ <260/am

)corp<us3*dam #achis "!m looking for a Pi that comes in a bo4 with a touch screen. *ll nice and professional like. " don!t care if it is stylish or a simple rectangle, " ?ust want ti to fit snugly together.<E=<E</ <<6/2am

enderF/=/3)corp<us 7hyM "t will be about as powerful as a phone(why not get an *ndroid phone or tabletM * tablet can do most things a Pi can, and trying to rig a touch screen with Rasbian Dinu4 would be very difficult. The Pi is a #"$ thing(it doesn!t come nicely packaged. *lso, a battery for the Pi poses some issues. These issues aside, by the time you were to pay for the Pi, the case, the battery, the screen, and the touch screen, you would have a thick, bulky, package that would cost more than a .=22 Ne4us 8.<E=<E</ B6/@pm

&ichael Dush3enderF/=/ This... 4 spent about E; minutes wondering if a Pi would make a good almost disposable travel PC, the odds would be good that 4 could hook it up the the rooms !< so 4 wouldn"t need a screen but the fact that 4 would need to carry cablesI keyboard and mouse sank the idea just in terms of bulk a cheap android tables would do so much better %!%$ U,9 /i+i IRasPi would make a cheap light wired to hotspot bo* 4f 4 needed to do any login 4 could connect to it via its /i+iD7EE7D5 E:E?am

sector?unkie3*dam #achis "t is composite video not component. "f you use this however, don!t plan on reading any command line te4t, the resolution isn!t high enough.<E=<E</ L62/am

TFBeermonster3sector?unkie Reading command(line te4t at the terminal via composite is comparatively easy. "t!s when you try to read detailed fonts in gui environments that composite is a fu::y mess. 4f for some reason the default font at the tty is no good for composite, then in debian you can reconfigure your console font by issuing: sudo dpkg(reconfigure console(setup

or su to root and don"t sudo if you prefer D7ED7D5 B:D:am )moak on the 7ater3*dam #achis This is the e4act type of series " need for my #reamplug. " have a device, and " had an idea for it ( using it as a /GE1GE7i-i gateway for video conferencing e5uipment ( only to watch TPDink make the same thing for <E/rd the price. Now, "!ve got a #reamplug, a bit of Dinu4 skills, but not enough to thrive with the machine.<E=<E</ <60<pm

?c/B13*dam #achis *n #&" to #V" cord is useful for regular monitors. " got this one for B bucks, and it works great. http:77www ama=on com79lueRigger(,peed(0dapter(Cable(.eters7dp79;;J,JR6CK7refLsrMDMEA ieLU!+?N'idLD56??OE:E6NsrL?(ENkeywordsLhdmiItoIdviD7EE7D5 6:6Eam

?c/B13*dam #achis &y e4perience with the 7in/=#isk"mager was terrible. "t won!t recogni:e internal card readers, and other users report having to use it multiple times before it worked. " used dd for 7indows instead, and it worked like a charm.<E==E</ 0602am

kamranL00@3*dam #achis before buying any peripheral devices or sd cards for using with rpi, i would suggest going through this wiki as its very very helpful in this regard http6EEelinu4.orgERPiFVerifiedPeripherals<E=<E</ 16/Lpm

S-ar putea să vă placă și