-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Raspberry Pi Sensors
By :

Following your recent purchase of the RasPi, you now have to make it ready to work for you. In this section, we are going to install an operating system on which our RasPi will run. The most popular, stable, and widely used operating system for RasPi is the Wheezy-Raspbian.
The Raspbian runs on an open platform, Debian Linux. Why are we going to use Raspbian instead of directly using Linux and other flavors of Linux? Simply because Raspbian has all device drivers written for the RasPi. In brief, the device driver is a program that gives the details of the hardware to the running operating system and supports the user interface to take/give commands from/to the hardware. As our RasPi has different hardware than a personal computer or general-purpose computer, the modified operating system is needed to completely use all resources on the hardware. It is best for those who want to follow the default standards.
You can download the Wheezy-Raspbian install file (known as an image file) from the Raspberry Pi foundation's website at http://downloads.raspberrypi.org/raspbian_latest. If you want to install the GUI-free flavor of Linux (Direct CLI), you can try Arch Linux. It can be downloaded from the ArchLinuxArm web page at http://archlinuxarm.org/os/ArchLinuxARM-rpi-latest.tar.gz.
We need some essential components to successfully start up the RasPi. Note that this subsection is for those users who are using the RasPi for the first time and have not purchased the preloaded SD card. If you have installed the operating system on your SD card, then you can skip this section, or just look at the procedure to help your friend who has just brought a new RasPi.
When you buy a RasPi module, it may or may not be sold with an SD card. If your RasPi did not come with an SD card, then the minimum size you should get is 4 GB. RasPi doesn't have any on-board memory, so purchasing an SD card is the only way to get data storage as well as an operating system. I have an 8 GB SD card for my RasPi, and it works well and is sufficient for doing almost all projects.
For server applications, if you require more space, then an SD card with higher space will be useful.
Once you have an SD card, you are ready for this step. These steps are broadly explained in my personal blog too, which you can visit at http://rushigajjar.blogspot.in/2014/03/setting-up-raspberry-pi-for-first-time.html.
Let's see the procedure for different operating systems.
These things need to be kept in mind while working on Windows:
The following things need to be kept in mind while working on Mac OS X:
These things need to be kept in mind while working on Linux:
download
folder and unzip the OS by right-clicking on Extract Here.Now, it's time to start the RasPi for the first time. After the process of writing an OS on the SD card, insert the SD card into the slot available on the RasPi. Connect the display (or TV) through an RCA or HDMI connection, and power up the RasPi by connecting a power supply to the micro USB connector. You will be able to see the configuration screen. Directly select the expand_rootfs option (from the keyboard connected through the USB of the RasPi) and wait for some time to complete the background process. When you write the image on the SD card, everything is in a compact bundle, where it needs to be expanded for the RasPi's complete operation. Expanding the root filesystem (expand_rootfs
) resizes the partitions in the SD card and allows us to utilize the memory space in it. By this point, you should restart your RasPi.
Before powering up the RasPi using the micro USB cable, the SD card must be inserted and the HDMI cable must be attached. RasPi reads the signals coming through HDMI to check the display connection. If the display is not available at the first point of startup, it disables the HDMI interface and streaming to optimize performance.
When the RasPi restarts, you will be able to see many pieces of code running on the screen. Don't panic! It's a normal process that goes on in the RasPi. When it becomes stable, it will prompt you to enter the username and password. By default, the username and password are pi
and raspberry
respectively.
Note that while you are writing your password, you will not be able to see anything coming on the screen; don't worry. Welcome to the Linux world!
Once you've entered the correct password, you will be able to see the CLI with pi@raspberrypi~$
on your screen, monitor, or TV, which is now ready to take commands from you. Aye, aye, captain!
Enter the startx
command as pi@raspberrypi~$startx
and press Enter. Now you have a white screen with the Raspberry Pi logo and a GUI that looks similar to our personal desktop computers. Take a bite!
So, we saw an easy and compact guide for setting up the RasPi for the first time. We'll now add more functionality to our RasPi by providing an Internet connection for it. A computer is incomplete without an Internet connection, and so is our RasPi. This is something we need to solve, especially as we can directly download useful libraries and applications on the RasPi through the internet.
Change the font size
Change margin width
Change background colour