Showing posts with label Raspberry pi. Show all posts
Showing posts with label Raspberry pi. Show all posts

Friday, 23 September 2016

How To Flashing an SD card on a Mac

Flashing an SD card on a Mac

Image result for RasPiWrite mac
On Mac, you can use a script called RasPiWrite to automate much of
the process of flashing the SD card including
unzipping it.
Because this operation involves erasing a disk using beta soft-
ware, we strongly advise
you to make sure your computer is backed up before you begin, just in case
something should goes wrong.
RasPiWrite can download one of the officially recommended distributions
before flashing it to the SD card. Our instructions are slightly different than
the instructions provided with RasPiWrite because we prefer to download
the distribution separately, so that we can choose from any of the distribu-
tions available, not just those that are officially endorsed, and so we can
more easily see how the download is progressing.
Here’s how you can use the script to flash your SD card:
Downloading the Operating System
1. In your Documents folder, create a folder called SD Card Prep and a
subfolder called RasPiWrite inside that.
2. Visit click here to  download the Zip file for RasPiWrite.
3. Double-click the downloaded file and open the resulting folder.
4. Drag the three files it contains into the RasPiWrite folder you created.
5. Drag the Zip file of your Linux distribution into the RasPiWrite folder.
6. Launch the terminal. If you can’t find it, press Cmd+Space bar and
type terminal into the Spotlight search bar. Press Enter to launch the
terminal.
7. Go to the SD Card Prep folder in a Finder window and, in the terminal
window, type cd, followed by a space. Then, without pressing another
key, drag the RasPiWrite folder into the terminal window.
This places the path of that folder into the command line.

8. Press Enter. Then type ls (in lowercase) and press Enter to see a list
of files in the folder.
You will use this list later to copy the name of your distribution Zip file
so you can avoid making a mistake while typing it.
You should now be in the RasPiWrite folder in the terminal.


9. Remove any memory cards, USB keys, or other removable storage
devices you might have plugged in and then run RasPiWrite by typing
sudo python raspiwrite.py (in lowercase).
10. Enter your system password.
You will see a few paragraphs of information about the script, topped off
with a lovely raspberry created using text characters.

11. Insert your SD card either in the Mac’s SD slot (if it has one) or
through an SD card reader, and then press the Enter key.
What happens next depends on your system.
For example, the has a partition that it runs Boot Camp from and RasPiWrite
thinks this is his SD card. This is why you’ve got to be vigilant: RasPiWrite
can get confused about which device is your SD card and could mistakenly
wipe the wrong one if you drop your guard. (In practice, it doesn’t work if
it can’t unmount the drive, so it wouldn’t actually wipe the Boot Camp
partition, but other disks might be vulnerable to accidental loss.) The

 Raspberry Pi
Image result for RasPiWrite install mac
The following drives were found, please verify the name of
the SD card in finder with the name under the Mounted On
column (after /volumes/):
Filesystem
Size
Used
Avail
Mounted
Capacity on
Volumes/WINDOWS
/dev/disk1s1
56Mi
34Mi
22Mi
61%
/Volumes/
Untitled
---------------------------------------------------------
I believe this is your SD card: /WINDOWS is that correct?
(Y/n)

12. This is not an SD card, so we respond with N for No and press Enter.
If RasPiWrite correctly identifies your SD card, enter Y and skip to Step 15.
13. RasPiWrite then responds with Please Enter the Location You Believe
Holds the SD Card. Enter dev/disk1s1 or simply copy and paste this
from the window.
14. You’ll see a message that says, I Believe This Is Your SD Card: /dev/
disk1s1. Is That Correct? (Y/n). Reply by pressing Y and then Enter.
It will then ask if you want it to download a distribution.

15. Because we have already done this, type N and press Enter.
The script asks you to locate the disk image. Scroll the terminal window
back up to where you used the ls command and copy the file name of
the distribution, and then scroll down to the bottom of the window and
paste in the filename.
The image file is extracted from the Zip file, which might take a short
while. After that, RasPiWrite summarizes the setup you have chosen and
reminds you that you use RasPiWrite at your own risk. Double-check
the details here, especially that the SD card has been correctly chosen.
Whatever you’ve selected here is where the Linux distribution will be
installed.

16. To proceed, type accept and press Enter.
At this point, you might think that the program has hung up. You should
see a series of dots being slowly printed on the screen. This can take
a long time: Paul, our technical editor, found his computer finished in
under half an hour but Mike’s computer took over an hour. You can use
the computer for other things while this is going on, but if the computer
crashes, you have to start over from the beginning of the flashing pro-
cess. When it’s finished, you get a message telling you that you can dis-
mount your SD card.Chapter 2: Downloading the Operating System
There’s one other thing you should look out for when using this script. After
typing accept, you might immediately get an error message like this:
Running dd bs=1m if=2012-08-16-wheezy-raspbian/2012-08-16-
wheezy-raspbian.img of=/dev/disk1...
Waitingdd: 2012-08-16-wheezy-raspbian/2012-08-16-wheezy-
raspbian.img: No such file or directory
done!
.Transfer Complete! Please remove the SD card
The message telling you that the transfer is complete is not true, and the clue
is that there was no delay before you saw this message. The message “No Such
File or Directory” is saying that it couldn’t find your Linux distribution image.
This can happen if the distribution contains just an image file instead of the
image file inside a folder of the same name. In this case, go back to the Finder
and create a folder inside the RasPiWrite folder and give it the same name as
your distribution Zip file, but without the .zip on the end. Then go into the
RasPiWrite folder and drag the .img file (which the RasPiWrite script has now
unzipped for you) into the folder you just created. You can then repeat the
previous steps successfully.

Before you leave, do me a favor and answer me this question:
What’s your opinion of Bitcoin
~Is it here to stay — permanently — or is it just another passing fad?
Leave your comment below  (Please! Don’t forget to use the social sharing buttons, either)!

Wednesday, 21 September 2016

Setup Raspberry Pi

Installing Raspbian And Getting It Up And Running

Image result for how to setup raspberry piImage result for how to setup raspberry pi
What you'll need:


*USB keys:(also known as flash drives or memory sticks) arefairly cheap and high capacity now (a 64GB USB key is readily afford-
able), which makes them an ideal complement to your Raspberry Pi.
Image result for flash drives and memory sticksImage result for sd card


*Power supply: The R.Pi uses a Micro USB connector for its

power supply, and is theoretically compatible with a lot of mobile phone

and tablet chargers. In practice, many of these can’t deliver enough cur-
rent (up to 700 milliamperes), which can make the Raspberry Pi perform
unreliably. The resistance in the cables that connect the Pi to the power
supply varies greatly too, and this can prevent peripherals like the 
mouse from working.Don’t try to power
the Pi by connecting its Micro USB port to the USB port on your PC with
a cable, because your computer probably can’t provide enough power
for your Pi.
Image result for power supply raspberry pi
*Cables: You’ll need cables to connect it all up, too. In particular, you
need an HDMI cable (if you’re using an HDMI or DVI monitor), an HDMI
to DVI adapter (if you’re using a DVI monitor), an RCA cable (if you’re
connecting to an older television), an audio cable (if connecting the
audio jack to your TV or stereo), and an Ethernet cable (for networking).
You can get these cables from an electrical components retailer and
might be able to buy them at the same time as you buy your Raspberry
Pi. Any other cables you need (for example to connect to PC speakers or
a USB hub) should come with those devices.
*External hard drive: If you want lots of storage, perhaps so you can use
your music or video collection with the Raspberry Pi, you can connect
an external hard drive to it over USB. You’ll need to connect your hard
drive through a powered USB hub, or use a hard drive that has its own
external power source.

*Speakers: The Raspberry Pi has a standard audio out socket, compatible
with headphones and PC speakers that use a 3.5mm audio jack. You can
plug your headphones directly into it, or use the audio jack to connect
to speakers, a stereo, or a TV. If you’re using a TV or stereo for sound,
you can get a cable that goes between the 3.5mm audio jack and the
audio input(s) on your television or stereo. You won’t always need
speakers: If you’re using an HDMI connection, the audio is sent to the
screen with the video signal so you won’t need separate speakers, but
note that this doesn’t work if you use a DVI monitor.

*Case: It’s safe to operate your Raspberry Pi as-is, but many people prefer
to protect it from spills and precariously stacked desk clutter by getting
a case for it. You can buy plastic cases on eBay (www.ebay.com), most
of which are transparent so you can still admire the circuitry and see
the Pi’s LED lights. These cases typically come as simple kits for you to
assemble. The Pibow (www.pibow.com) is one of the most attractively
designed cases, with layers of plastic giving it a rainbow look, side-on (see
Figure 1-4). It’s designed by Paul Beech, who designed the Raspberry Pi
logo. You don’t have to buy a case, though. You can go without or make
your own (see Chapter 3). Whatever case you go with, make sure you can
still access the GPIO pins so you can experiment with connecting your Pi
to electronic circuits and try the projects in Part V of this book.
Image result for raspberry pi caseImage result for raspberry pi case
A list of compatible and incompatible devices is maintained at click and you can check online
reviews to see whether others have experienced difficulties using a particular
device with the Raspberry Pi.

Downloading the Operating System
Before you can do anything with your Raspberry Pi, you need to provide
it with an operating system.
The operating system used on the Raspberry Pi is GNU/Linux, often called
just Linux. The Raspberry Pi might be the first Linux computer
you’ve used, but the operating system is good and powerfull.
There are several different Linux distributions available for the Raspberry
Pi, and you can find an officially endorsed list at this page.
The officially distribution recommended for beginners is called Raspbian
Wheezy. IA Debian based Linux OS.

To download the distribution you want to use. If you’re using
a recommended distribution, start by pointing your web browser to downloads page. This page lists several different distributions, and each one has
two ways to download it,You can use a BitTorrent file And You can also use a direct download.
Unzipping Your Linux OS
When you download your Linux OS, it may be contained
in a Zip file, just Unzip it by double-
clicking the Zip file, it should show you the Linux distribution file and give you a
button to click to extract (or unzip) it.
If you have more than one file inside the Zip file. In that case,
the one you need is the one that has .img at the end.
Flashing Your SD Card
windows

To flash an SD card in Windows, you’ll need to download and install  Image Writer for Windows to do the job. is available for free download.
 NOTE:The software is alpha software, which means it’s still in a fairly early stage of
development, so make sure you have a current backup of your computer, just
in case something goes wrong.
steps you need to follow using Image Writer:
1. Visit this website and download the latest version of Image Writer.
 Download the binary is the one you need.
2.  Click Extract All the Files into a folder and open it.
3. Double-click the file Win32DiskImager.exe to start it.
If you are asked to give the program permission to make modifications
on the computer, allow it.
Image result for Win32DiskImager
 The long white box is for the filename of your
Linux distribution image.

.Image result for inserting the SD Card The Raspberry Pi
4. Click the folder icon on the right of the filename box to open a file
browser, navigate to your Linux distribution .img file and double-click it.
5. Use the device menu on the right to choose which drive your SD card
is in.
Double-check this information, and then check it again. Remember: This
drive is going to be completely wiped.
You can go through the Start menu to My Computer to check the letters assigned to the different drives on your PC. As a failsafe, this menu
should only list removable drives, so you shouldn’t usually have an
option for your hard drive here
6. Click the Write button, and Image Writer starts its work.

Mac users click.
Flashing an SD card using Linux
We’re using Ubuntu, the most popular desktop distribution make
sure you have a recent backup of your computer before you proceed, just in
case you accidentally wipe the wrong disk.
follow the walkthrough.
Linux is case-sensitive, so you need to use upper- and lowercase as we have in
these instructions. For example, you can’t use LS in place of ls.
1. Remove any SD cards or USB keys that you won’t be using for this
process from your computer.
2. Insert the SD card you want to erase and install the Linux distribution
onto.
 3.  Open a terminal window.
 use the keyboard shortcut (Ctrl+Alt+T in Ubuntu).
Image result for terminal
4. Enter sudo fdisk –l, where the last character is the letter l.
This gives you a list of the disks available, as you can see in Figure 2-2.
5. Study this list to find your SD card.
In Figure 2-2, the screen lists three disks, with the information about
each one starting with the word Disk. The file size is usually a good indi-
cator of which is your SD card. The first one (Disk /dev/sda) is 500.1GB,
which is a large hard drive. The second one (Disk /dev/sdb) is 1000.2GB,
which is a huge hard drive. The third one (Disk /dev/sdg) is just 8068MB.
8068MB is roughly 8GB, so that’s the SD card. Take a note of the disk’s
directory, which in this case is /dev/sdg.
6. Use cd to go to the directory where you stored your Linux distribution
image.
We put ours in the Documents directory, so we used cd Documents, as
you can see in Figure 2-2.
7. To see the name of your image on screen, enter ls *.img.
8. To actually write the Linux image to the SD card, use
sudo dd if=distribution.img of=/dev/sdX bs=2M
You need to replace distribution.img with the name of your distribution
(in our case 2012-09-18-wheezy-raspbian.img) and replace sdX with the
directory of your SD card, which was sdg when we did it.
Double-check this: The content of the device you name here is erased
and replaced with the Raspberry Pi Linux distribution when you press
Enter.
You can copy and paste the distribution filename from where it was
listed onscreen in Step 7. Use the mouse to highlight it, and then right-
click to copy. Right-click in the sudo dd command to paste in the file-
name. Alternatively, if you start to type the name and then press the Tab
key on the keyboard, Linux attempts to complete the name for you.
 The screen won’t update
during Flashing, but if your SD card slot has a light beside it, you might see
it flickering. When it’s finished, you may see a short statement onscreen
telling you how much data was copied, and a proud declaration of
how quickly it was finished.

Connecting The Raspberry Pi
Image result for Connecting the Raspberry Pi
To insert your SD card, flip your Raspberry Pi over (see Figure 3-2) so you’re
looking at its underside. On one of the short sides is a plastic fixture for your
SD card. Slide the SD card in with the label side facing you and gently press
the card home to make sure it’s well connected.
Image result for inserting the SD Card The Raspberry Pi
Connecting an HDMI or DVI display
On the top surface of your board, in the middle of the bottom edge is the
HDMI connector. Insert your HDMI cable into that, and then
insert the other end into your monitor.
If you have a DVI display, rather than a HDMI display, you need to use an
adapter on the screen end of the cable. The adapter itself is a simple plug,
so you just plug the HDMI cable into the adapter, and then plug the adapter
into your monitor and turn the silver screws on the adapter to hold the cable
in place. Figure 3-3 shows the HDMI cable lined up for insertion into the DVI
adapter.
Image result for Connecting an HDMI The Raspberry Pi

Connecting a USB Hub
Your Raspberry Pi’s USB socket(s) can be found on the right of the circuit
board. Your USB hub should have a USB cable that connects
snugly into one of these sockets.
It’s important to use a USB hub that has its own power source, so plug your
USB hub into a wall socket (mains electricity) using the power supply unit
that came with it.

Connecting a Keyboard and Mouse
Your keyboard and mouse can be connected directly to the USB socket(s)
on your Raspberry Pi; however, it’s better to connect them to your external-
powered USB hub that is connected to the Pi. It reduces the risk of problems
caused by the devices drawing too much power from the Pi.

Connecting Audio
If you’re using a HDMI television, the sound is routed through the HDMI cable
to the screen, so you don’t need to connect a separate audio cable.
Otherwise, the audio socket of your Raspberry Pi is a small black box stuck
along the top edge of the board. If you have earphones or headphones from a portable music player, you can plug them directly into
this socket.
Image result for Connecting an HDMI Raspberry Pi port
Alternatively, you can plug a suitable cable into this socket to feed the audio
into a television, stereo, or PC speakers for a more impressive sound.

Connecting to Your Router
The Raspberry Pi Model A has no network connection on the board. The
Model B Raspberry Pi has an Ethernet socket on the right edge of the board.
Use this socket to connect your Raspberry Pi to your
Internet router with a standard Ethernet cable.
The Raspberry Pi automatically connects to the Internet when used with a
router that supports the Dynamic Host Configuration Protocol (DHCP), which
means it works with most domestic routers.


Connecting the Power and Turning
on the Raspberry Pi
The last thing you should do is connect the power. The Micro USB power
socket can be found in the bottom-left corner of the board.
The Raspberry Pi has no on/off switch, so when you connect the power, it
starts working. To turn it off again, you disconnect the power.

Using Raspi-config to SetUp Raspberry Pi

The first time you use the Raspberry Pi, it goes into a program called Raspi-
config, which you use to change some of the settings on your Raspberry Pi.
 Note: That you can’t use the mouse to move through these menus. You use up
and down keys to select different options on the screen, and left and right or
Tab to select actions such as OK,
Cancel, Select, and Finish. Press Enter to confirm a choice.
Image result for Raspi- config

info: This is a short paragraph explaining the purpose of the
tool. After you’ve read it, press Enter to return to the menu.
expand_rootfs:This option in Raspi-config is used to ensure
your Raspberry Pi can use all the space on your SD card. When you
press Enter with this option highlighted, it runs straight away. The next start up (or boot), your Raspberry Pi resizes the
file system.

overscan: The overscan settings control how much of a border
should be used around the screen image and can be used to correct an
image that spills off the side of the monitor.

configure_keyboard: When you press Enter, there is a short pause,
and then a menu opens for you to select the keyboard you’re using.
Press Enter to confirm your choice.

change_pass: This option enables you to change the password for the
default user on your Raspberry Pi, which is the user called pi.

change_locale: This setting is used to choose your language and its
associated character set.

change_timezone: This option used to tell your Raspberry Pi what time zone
you’re in when you first set it up.

memory_split: You can improve your
Raspberry Pi’s performance by giving more of the memory to the GPU with this option.

overclock: Overclocking is making a computer work faster than the
manufacturer recommends by changing some of its settings

ssh: SSH is a way of setting up a secure connection between computers,
usually so you can control one computer from another computer. The
settings let you enable or disable this, but unless you know you need to
use it, you can ignore this setting.

boot_behaviour: This setting is used to make your Raspberry Pi go
straight into the desktop environment.

update: Use this setting to install an update to Raspi-config if one is
available. 
You can use Raspi-config at any time. To start it, enter the following at the
Linux command line:
sudo raspi-config


Logging In
When you switch on the Raspberry Pi, you might be asked for a username
and password. The default username and password differ depending on which
version of Linux you are using, but for the Raspbian Wheezy distribution,
the username is pi and the password is raspberry. Both of these are case-
sensitive. Image result for Raspberry Pi logging inYou receive no feedback on the
screen as you enter the password. It not hides your password and
doesn’t show you that a key press happened, which is a bit unsettling the first
time. You are shown the command line prompt followed by a
blinking line after a successful  logging in :
pi@raspberrypi ~ $
Image result for Raspberry Pi logging in
This means your Raspberry Pi is ready for you to use and you can enter
Linux commands now to manage your files and programs.


Desktop Environment
Image result for Raspberry Pi environment

Before you leave, do me a favor and answer me this question:
What’s your opinion of Bitcoin
~Is it here to stay — permanently — or is it just another passing fad?

Leave your comment below  (Please! Don’t forget to use the social sharing buttons, either)!