You are on page 1of 50

Raspberry Pi

Its Inception And Innovation

James Fahl
Table of Contents

Introduction……………………………………………………………………………………………...
Chapter One: What Is Raspberry Pi?………………….………………….………………….
………….
Chapter Two: Uses Of Raspberry Pi………………….………………….………………….
………….
Chapter Three: Capabilities Overview………………….………………….
…………………………….
Chapter Four: Raspberry Pi Specifications And Connecting Equipment
Explanation……………………..
Chapter Five: How To Install Apps and Backup SD Card………………….………………….
…………
Chapter Six: Things To Know For First Time Pi Users………………….
………………………………..
Chapter Seven: Programming And Raspberry Pi………………….………………….
………………….
Chapter Eight: Python For Raspberry Pi………………….………………….
…………………………..
Chapter Nine: Beginners Projects For Raspberry Pi………………….
………………………………….
Conclusion………………….………………….………………….………………….
………………….
© Copyright 2017 by …… - All rights reserved.
It is not legal to reproduce, duplicate, or transmit any part of this
document in either electronic means or in printed format. Recording of this
publication is strictly prohibited.
Introduction
Congratulations on downloading Raspberry Pi: Its Inception And
Innovation! If you are looking at this book, it means you are not only curious
about the Raspberry Pi and its capabilities, but are looking for basic
instructions on how to format and begin utilizing your Raspberry Pi device.
This book not only provides step-by-step coding instructions to some of the
basic ideas a Raspberry Pi owner will need, it gives suggestions for wonderful
coding languages to learn and projects to take on!
These projects found within the pages of this book will open your mind
to new possibilities you did not even believe possible, from building your own
touchscreen pad device all the way to flying your own drone! This book, along
with its contents, will provide those who are beginning as well as those who
are advanced information they can utilize as they continue to explore the world
built into their Raspberry Pi. I can promise you that once you purchase this
book and begin to read, your mind will be open to a world unbeknownst to the
average technological human being, and you will begin learning not just about
this credit-card sized device and its capabilities, but also learning about the
future of technology that will drive the next generations to come.
Do not wait one more second to purchase this book. The future of
technology has arrived. Don’t let it mow you down in its path!
Chapter One: What Is Raspberry Pi?

The Raspberry Pi is a computer the size of a credit card that plugs into a
television and keyboard. It can be used in electronics projects and houses the
capability to complete functions a computer already harbors, such as word
processing, browsing the internet, spreadsheets, and playing games. It can play
high-definition videos, and it can even aid in various individuals wanting to
learn how to make digital products and study programming.
Raspberry Pi is a conglomeration of small, single-board computers. It
was developed in the United Kingdom by the Raspberry Pi Foundation, and its
original purpose was to promote teaching computer science to students in
schools housed in developing countries. It was a way to reach untapped
individuals and broaden their horizons for how they saw their future. But, it
became greatly popular outside its intended original market, and people who
were fluent in robotics began purchasing this device. When purchasing a
Raspberry Pi, add-ons such as mice, keyboards, and cases are not included,
but you can sometimes find places where “bundle” packages are offered that
house all of these items together.
Since its inception, over 20 million have been sold, making it the single
most popular British computer to ever hit the market. Not only did it go on to
serve its intended purpose in a compact way, it served to open a completely
new market within developed countries for those who were hungry to broaden
their electronic and technical horizons, but lacked the available funds to do so.
Many different generations of Raspberry Pi have been released since its
inception, and each one becomes more popular than the last. The first
generation was released in February 2012, which soon saw the release of a
more affordable model, entitled Model A. In 2014, they released a second
generation, entitled Model B+, that had an improved board design.
These small boards became the standard for how future generations of
this product would look, and in April 2014 a computing model was released
solely for the purpose of embedded applications. Because of this model’s
popularity, Raspberry Pi Zero was released in November 2015, which was
even smaller in size and has reduced general purpose input/output capabilities.
This model was sold for a mere $5.00.
Earlier that year, however, in February 2015, Raspberry Pi 3 was
released, and this simply added more RAM (data computer storage). A year
later, in February 2016, Raspberry Pi 3 Model B was released, and this model
added on-board WiFi capabilities, USB boot capabilities, and Bluetooth
capabilities. This years two Raspberry Pi systems, released in January and
February, are the newest developments for this product and are priced
anywhere between $5.00 and $35.00.
All of these current models have many things in common: they have an
SoC (system on a chip) that houses a CPU and a graphics processing unit. They
also have an on-board memory range from 256MB to 1GB RAM as well as SD
cards that can be used to store the operating system and program memory. Both
regular and micro-sized SD cards are compatible with these latest models.
Alongside those components are USB slots, composite video and HDMI
output, and a phone jack for audio. The B-models even have ethernet port
capabilities!
The main programming languages that Raspberry Pi utilizes are Python
and Scratch (though it can support many other languages, if necessary), and the
operating systems that the original foundation provides for download are
Windows 10 IOT Core, Ubuntu, and Raspbian (which is Linux-based). The
default firmware that comes with the product when first ordered is closed
source, but an unofficial open source is available through certain outlets.
Newer versions of this firmware that is installed have the option to
choose between five different overclocking presents that have the ability to
maximize the SoC without damaging the overall lifetime of the board. What
happens is this: monitoring of the core temperature of the chip, clock speeds,
core voltage, and CPU load are all tracked within the system as the
overclocking is taking place. Then, automatic switches happen as necessary
with the chosen overclocking preset, and performance is temporarily enhanced
by as much as 1 GHz. All of this depends on the board being utilized and the
overclock preset that is activated, but overclocking at various intervals and
speeds with different Raspberry Pi models is possible, so much so that it is
written into the overall program.
The CPU chips in the first and second generation models didn’t require
cooling unless it was overclocking, but the Raspberry Pi 2 SoC requires more
cooling than usual under standard overclocking settings. Most of these devices,
however, can be overclocked all the way to 800MHz. Some can even go as
high as 1000 MHz. There are some people who have had success in
overclocking the Raspberry Pi 2 all the way to 1500 MHz, but that is while
discarding every safety feature and voltage limitations, and it is not
recommended. In the Raspbian operating system, it is possible that
overclocking can happen automatically on boot while running a specific
software command without voiding the warranty, but in these cases Pi will
automatically turn off if the chip reaches 185 °F.
Public acceptance of Raspberry Pi has been exponentially positive. Glyn
Moody, a prominent technology author, described the initial project as a
supplementation to PC compatible machines. Stephen Pritchard stated in
ITPRO something similar, and Alex Hope (co-author of the NextGen report)
said that many were hopeful that this device could open up a new world and
engage children on the excitement of programming on a level that had yet to be
reached.
Even Chris Williams wrote in The Register that he saw this overall
inclusion of children into the world of programming languages as a good start
to give kids access to learning the skills necessary for their future. The Centre
for Computing History strongly supported this idea and believed that it could
“usher in a new era” that linked kids positively to electronics on more than a
mere entertainment level.
Raspberry Pi one T3’s Innovation of the Year award in October 2012,
and Mark Pesce admitted that this device was his inspiration for the project
MooresCloud. Even the British Computer Society wanted to get in on the
action, reacting by stating that this was something they definitely wanted to
“sink their teeth into.”
Raspberry Pi hasn’t come without its downsides, however. In February
2015, a switched-mode power supply chip had a distinct vulnerability to
flashes of light. From xenon camera flashes to laser pointers, the flashes of
direct light would cause a spontaneous reboot or shutdown of the chip itself.
Many users began to speculate the possibility of the electromagnetic pulse
from the xenon flash tube causing interference by interrupting the computer’s
innate digital programming and circuitry. However, many tests ultimately ruled
that out. They found that light aimed at the other side of the Raspberry Pi
caused no issues, and set forth to looking for other explanations.
It was eventually found that the solution required the covering of the
main processing chip with a compound called Blu-Tack. It’s a poster-mounting
compound that is incredibly opaque and blocks all light from passing through
it. Light was the sole culprit and not the electromagnetic pulses, as found by
tests run once this main processing chip was covered. Now, a bare silicon
covers this chip in newer models that, when necessary, block all light from
penetrating its barrier.
Other tests performed, however, are certainly laughable. Tests with the
EMP pulses and light exposure were performed by wrapping a chip in
electrical tape, aluminum foil, and even balls of bread. The reason why this
issue was not caught before its initial release is because, while standard
practice tests issues with radio interference, it is not standard to test for optical
interference.
Raspberry Pi has undergone many transformations since its inception
with the original model a few years ago. Ironically, its intended purpose has
yet to be measured in other developing countries as its target focus has shifted
from education to implementation in robotics and the building and creation of
other computational devices. While it is still slower than the modern laptop or
desktop computer, it is a fully-functioning computer.
Chapter Two: Uses Of Raspberry Pi
There are many creative things that Raspberry Pi can be used for.
Raspberry Pi enables all basic computer functions at a much lower energy
consumption level, and it a much cheaper option for those that do not have the
funds to spend on a laptop or desktop computer. There are many practical
applications of Raspberry Pi, as well as some fun ones, all of which will be
addressed.
Practical uses for Raspberry Pi stem from what it can do in its compact
state. It can run functions such as spreadsheets and word processing programs,
as well as enable embedded and off-sight installation of applications that serve
various functions, from banking to gaming. However, the ideas many have
found where Raspberry Pi can be implemented stem beyond these basic
computer-based functions.
The good thing about Raspberry Pi is that it’s easy enough for the general
public to use given the basic technology information the average user has. One
of the purposes that has blossomed from the use of Raspberry Pi is the ability
to have a living-room multimedia experience without the bulkiness of a
computer tower. Utilizing Raspberry Pi in this fashion is easy as long as the
necessary components are in play: Raspberry Pi (obviously), an SD card, a
power adaptor, a micro USB cable, and internet connection for possible
updates. Then, you download the required software, uncompress the necessary
files, and start running the program.
Then, since the Raspberry Pi is already hooked up to the television, the
user can enact the browser on their television and have a fully-functioning
living room PC. Simply download onto Raspberry Pi the internet browser of
choice, and it will utilize the television screen as the main browsing screen.
You can even make this an entire media center, capable of playing videos,
movies, pictures, and music. The only thing necessary to make this a full-
fledged media center is the Raspberry Pi and Kodi software.
If any is a fan of retro games, then Raspberry Pi is your solution to the
craving. Raspberry Pi enables the emulating of dozens of old consoles, like the
original Nintendo, SNES, and Mega Drive. It’s not a quick install and takes
quite a toll on the Raspberry Pi to get it fully downloaded, but once it is
acquired it can open up a world of retro gaming that you can have right on your
television because you have already taken the steps to hook it up there.
However, if you are not into retro games but still want to play them with a
Raspberry Pi, have no fear: Minecraft is available for the Raspberry Pi.
Going retro even allows you to run retro operating systems. Be wary,
however: because these operating systems are completely out-of-date with
updates and firmware requirements, these systems have a tendency to freeze up
Raspberry Pi. But, it’s cool to see them in action should that be something you
want. It requires a lot of downloading, unlocking, and uncompressing files, but
it is easily possible nonetheless.
Yet another retro device it can bring back to life are the clunky USB
printers. You need a power source for each gadget as well as a USB
connection between both of the devices but, once set up, it can take that bulky
printer and transform it into a wireless network printer that anyone in the
vicinity of it can utilize.
Raspberry Pi has also founds its way heavily into robotics, and many
videos are out there that have fully-operating robotic arms and legs that are
plugged into nothing else than this credit-card sized device. This takes a full-
on knowledge of how robotics operates, but Raspberry Pi is quickly
blossoming into this category.
Of course, Raspberry Pi can be utilized for its original purpose: learning
and understanding programming languages. It is the perfect, and inexpensive,
programming platform that can enable the learning of several languages with
easy-to-use applications. Everything from downloadable applications created
as games to programs that enable the creation of completely new projects are
available to help the consumer educate themselves on several different
programming languages that Raspberry Pi can handle.
The beginnings of using Raspberry Pi to fly drone-like quadcopters is
beginning to emerge as well. Entitled RPi UAV, these drone-like figures are
being powered by Raspberry Pi, which would enable the price of drones to
plummet back down from the rafters because the introduction of an affordable
component would greatly reduce prices.
Raspberry Pi can also be utilized to create a touchscreen Pi pad, given
the right components. Many different distributors sell kits that come with all
the parts necessary to hook up the Raspberry Pi into the empty touchscreen
case, but once put together, the touch screen comes alive, powered by minimal
energy consumption in the process.
In that same respect, someone can also purchase the cheaper end of
products necessary to build a low-cost desktop computer. A keyboard, a
mouse, and an empty desktop monitor are a few of the things necessary to get
the journey started, but once Raspberry Pi is fully hooked into everything, a
functioning desktop is available for a fraction of the price.
Raspberry Pi can also be utilized to create your own cloud storage, like
Dropbox. The software ownCloud is necessary, but once you have it installed
and setup, you have access to your own private cloud storage, which is rare
nowadays. But, if you really enjoy privacy, Raspberry Pi can be utilized to set
up a VPN (virtual private network) that you can use at home or out in public.
Raspberry Pi opens up an entire world of possibilities. It is affordable
and can be implemented on many different levels, from personal cloud storage
all the way to drone function and flying. It’s small components enable a
desktop and laptop computer to be broken down into its basic components and
allows even the technologically-deficient to be able to understand the basics of
what is going on. However, its uses are also rooted in practical, every day
functions and not just the “cool” applications and interpretations.
In January 2012, the United Kingdom overall education board received
five times as much interest in the implementation of Raspberry Pi into their
educational curriculum than any other teaching software to date. Not only that,
but private schooling and education sectors were clamoring for it as well.
Their hope was that businesses would sponsor and donate money towards the
purchasing of this educational tool for implementation in less-advantaged
school system in the U.K., and the CEO of Premier Farnell has stated that many
governments of countries in the Middle East have expressed incredible interest
in providing Raspberry Pi to every single schoolgirl they have under their
wing in order to promote the advancement of women and their acquisition of
knowledge within their cultures.
The Raspberry Pi Foundation, in 2014, hired several community
members (which included ex-teachers and software developers) to create and
bring to market a bulk set of free learning resources for their main website.
The resources put up would be freely licensed under Creative Commons, and
contributions as well as collaborations would be highly encouraged on a
social coding platform entitled GitHub. They also started a teacher training
course called Picademy. It’s aim was to help educators of all shapes and sizes
prepare for teaching with this new computing curriculum that housed a
Raspberry Pi foundation within the classroom. This course was also free to
teachers.
It’s implementation education-wise has strayed away from its original
intention, but has found other modes and uses within the system of education, at
least in the U.K.
Yet another practical application exists within the developing technology
of home automation. With the rise of applications that enable someone to
control their home’s temperature while they are away in Europe comes the
question of whether Raspberry Pi has a stake in the game. And it does. Many
developers of applications are leveraging Raspberry Pi for this type of home
automation, from setting temperatures while miles away to looking in on home-
monitoring cameras. What they are trying to do is implement a cost-effective
way to bring home automation to the mass consumer market while harnessing
Raspberry Pi’s low energy consumption to also keep energy costs low after
mass home implementation. It is growing in popularity, and many have already
self-implemented the concept in their own homes.
Not only that, but the automation world has seen progress with this rising
technology as well. TECHBASE, a Polish widespread automation
manufacturer, designed the first ever industrial computer that was based solely
on Raspberry Pi Compute Mode. This device, called ModBerry, was created
in June 2014 and housed numerous different interfaces that could utilize all of
the ports, inputs, and outputs the automation industry needs in order to function.
This fully-functioning computer that could withstand the harsh environment of
industrialization officially took Raspberry Pi from a home and science project
world and integrated it into the manufacturing world
The implementation of Raspberry Pi no longer knows any boundaries, but even
the brightest of minds have to be versed in its basic component breakdown in
order to understand how it can be implemented for higher functions and
purposes.
Chapter Three: Capabilities Overview

The Raspberry Pi is capable of many things, depending on how it is set


up and the components that come with it. For example, the Raspberry Pi 2
utilizes a 32-bit 900 MHz quad-core processor. With each generation, this type
of processor differed, but it all gave rise to different functions that were
possible as generations developed, improved, and debuted.
In the first generation, the Broadcom BCM2835 SoC was equivalent to
the chip that was used in first generation smartphones. It included a 700 MHz
processor, a decent graphics processing unit, as well as RAM. How the
Raspberry Pi continued to improve seemed to be in-line with how smartphones
improved all the way up through the Raspberry Pi 2, where the caching level
and processing speed was the highest the device had ever seen. Then, the
Raspberry Pi 3 outdid all of its predecessors by harboring a 64-bit quad-core
processor that harnessed 512KB of level 2 cache.
With all of these innovations, many described the Raspberry Pi two as
eight to ten times the performance of the original generation, and it received
standing ovations at many technology conventions and meetings. The reason
behind this incredible jump between generations was because of the threading
and instruction set use that was being utilized. Because of this, the Raspberry
Pi 3 was 80 percent faster than its generation before it when measured with
parallel tasks.
The Raspberry Pi 2 had a quad-core that ran at 900 MHz with 1 GB of
RAM. Computational speed tests and parallel task testing put it anywhere
between four and six times more powerful than its predecessor, even with its
graphics processing unit being identical to the original. In other benchmarks,
the Raspberry Pi 2 was an astounding 14 times faster than the Raspberry Pi 1
Model B+.
The truth of the matter is that the first generation Raspberry Pi gave real-
world performance with a rough equivalency of 0.041 GFLOPS (Giga Floating
Operations Per Second, the standard measurement of computing power). In
other words, comparing the original Raspberry Pi to a CPU would put this on
the same level as a 300MHz Pentium II that came out somewhere between
1997 and 1999. It’s GPU provided 1 Gpixel per second with 24 GFLOPS of
computing performance for general purpose. In terms of relating its graphics
capabilities, it would be something akin to the Xbox of 2001.
The older beta Model B boards had 128MB allocated to the GPU by
default, which left 128 MB for the CPU and all of its functions. With the first
release of the Model B, it had 256MB available with three different splits that
were possible. Every single one of the generations had a default split, and for
these it was 192MB for the RAM and the CPU (this would have been sufficient
for standalone 1080p video or simple 3D, but not both), 224MB for Linux only
(which would have failed for videos and 3D graphics), and 128MB for heavy
3D capabilities. Comparing these splits and capabilities would be like
comparing it to the Nokia 701.
However, when the new Model B came out, it housed 512 RAM which
boasted of new standard splits that aided in performance and overall function
of the Raspberry Pi, making it more like a standard computer than ever before.
Now, the Raspberry Pi 2 and Raspberry Pi 3 have 1 GB of RAM, and the
Raspberry Pie Zero and Zero W have 512MB of RAM.
In terms of networking, the Model A, A+, and Pi Zero have absolutely no
Ethernet circuitry or capabilities whatsoever. They are commonly connecting
to a surrounding network, or a network it creates, by utilizing USB WiFi
adapter or Ethernet that is user-supplied. With the Model B and B+, an
Ethernet port is finally provided as a built-in functioning adapter. But, it soon
moved to keep up with the times in the Raspberry Pi 3 and Raspberry Pie Zero,
because those models have wireless capabilities that come with 150 Mbits per
second. Not only that, but they house Bluetooth capabilities as well. But, no
worries, the Raspberry Pi 3 still has the trusty Ethernet port.
In terms of the utilization of peripherals, or accessories, the Raspberry
Pi can be operated with most generic keyboards and mice that house USB ports
you can plug into computer towers. The user can also utilize USB storage as
well as USB to MIDI converters, which houses various potential in what can
be used with a Raspberry Pi. Any device or component with USB capabilities
can be used with this device, and any other accessory that requires hook-up but
houses no USB hookup can be attached via various pins and connections on top
of the surface of the device.
The video compatibility on the Raspberry Pi versions kept up with the
standard TV resolutions of the times they were produced within, housing HD
and Full HD capabilities. The user can toggle between higher monitor and
lower monitor resolutions as well as create older standard resolutions (such as
resolution from televisions in the early 90s). Higher resolutions than the
modern standard, such as 2048x1152, could theoretically work as long as a
lower framerate was used. The higher resolutions, however, should not bring
about the assumption that the graphics processing unit (GPU) can decode video
formats at these times of resolutions. In fact, Raspberry Pis have been known
to not work at all for many videos at higher resolutions.
The Raspberry Pi 3 does not harbor decoding hardware, but its CPU is
more powerful than the generations before it. This means it has the potential to
quickly decode H.265-encoded videos within its software. The GPU within the
Raspberry Pi 3 can run at much higher clock frequencies than its preceding
generations, with the clock frequency being anywhere between 300 and
400MHz as compared with 250MHz.
But, with all of this modernized technology comes the ability to return to
the more “retro” styles of interface, and this means the Raspberry Pi can also
generate older composite video signals that mimic the feel, look, and display
of CRT TV screens. They can utilize standard connections, either a 3.5 mm
phone jack or an RCA, depending on the model involved.
However, there is something that all of the Raspberry Pi models are
lacking, and that is some sort of built-in real-time clock. Therefore, this means
they “don’t know” the time of day. But, many people have found different
workarounds, from running a program on their Raspberry Pi so they can pull a
network time from a broad server all the way down to user input at the time of
boot up. In order for the Pi to keep up with all of this input of information it is
unfamiliar with, it automatically saves the time it has in its system on
shutdown, then re-installs that particular time at the next boot up. It’s not
perfect, but it is the beginning stages of implementing that particular function.
Other accessories and equipment that can be utilized with Raspberry Pis
are numerous. For example, the foundation, along with other distributors,
launched a Raspberry Pi camera board with firmware that was up to date in
order to accommodate it. This board can be shipped separately with the cables
necessary to hook it up to the Raspberry Pi, and it gives this device a fully-
functioning camera. The cost of this camera board is around $30.00, and it can
produce videos up to 1080p as well as take pictures with an 8 megapixel
camera (as of May 2016). Alongside the camera functions is the promise of an
infrared camera, which the foundation announced in October 2013 it would
begin working on.
Another device created by the Foundation is a sanctioned device entitled
a Gertboard. This was wholly designed for purely educational purposes, and it
expands upon the Raspberry Pi's GPIO pins in order to allow the interface of
and control of certain switches. These switches, from LEDs to analog signals,
control the device in specific ways and enables the controller of the device to
learn with a hands-on approach. Not only that, but this Gertboard also includes
an optional add-on: an Arduino-compatible controller that has a specific
interface with the Raspberry Pi.
There are also HAT expansions, or hardware attached on top, boards.
These were inspired by the Arduino shield boards and, together with the
Model B+, can utilize the interface in order to expand outside the Raspberry
Pi. HAT and its interface with the Raspberry Pi was also designed and
sanctioned by the Foundation, and it gives the individual user expansion
capabilities that can harness the Raspberry Pis functions on a larger level.
With all of these tools, expansions, and add-ons comes the thought that
the more the Raspberry Pi grows, the more it rises to the same level as a
desktop computer or laptop device. And that isn’t too far off from the truth.
But, while all of these cool features are accessible, it takes a great deal of
knowledge in order to get started, and sometimes individual users just wish for
a startup manual on how to connect it to everything the very first time.
Luckily, this book has that covered.
Chapter Four: Raspberry Pi Specifications And
Connecting Equipment Explanation

The newest model, the Raspberry Pi Zero with wireless capabilities,


was launched in February 2017. It’s target price is $10.00, and the architecture
has a basis of an ARMv6Z that houses 32-bit. The SoC is made up of a
Broadcom BCM2835, and the CPU is a 1 GHz single-core ARM1176JZF-S.
The GPU has a Broadcom VideoCore IV that works at 400 MHz as well as a
high-profiler decoder and encoder, and the SDRAM (memory) houses 512 MB
that is shared with the GPU. It has 1 micro-USB port, a MIPI camera interface,
mini-HDMI composite video outputs that can handle 1080p resolution, stereo
audio capabilities, and a MicroSDHC to house onboard storage. It not only has
wireless capabilities, but Bluetooth as well, can house all peripherals, and it
still one of the smallest generations to be put forth in the consumer market.
If a user is new to the game, it can be confusing connecting it up for the
first time. However, there are a few things that are necessary before looking
into hooking up the Raspberry Pi properly:
● A Raspberry Pi (while the specifications above are given for
the latest generation, these steps can be utilized for all
generations).
● A monitor or HDMI-input television (this is what the user
will connect the Raspberry Pi to in order to have a display
monitor. The point is that it needs to be an HDMI-enabled screen.
There are many different displays to choose from, so feel free to
shop around and find one that suits you).
● A USB-based keyboard and mouse (controlling the Raspberry
Pi requires these components, and all that matters is that they are
USB-based).
● A MicroSD card and card reader, at least 8GB (because of
the Raspberry Pi's small size, the user installs the operating system
for the Pi on this instead of a hard drive. At least 8GB will be
necessary for this download, and if the Raspberry Pi you have
purchased doesn’t have a card reader, one can be easily purchased
and hooked up to the board for only $7.00).
● Some sort of power supply (the Pi is powered by a micro
USB, sort of like the one used for a smartphone. The best type of
power supply is one that can provide 2.5A of juice for you to work
with.)
Once all of these components are purchased and gathered, it is time to
start the initial hookup process. The first thing the user has to do is put
Raspbian onto an SD card. This is the operating system mentioned above, and
this means that the user needs to download it onto another computer and
transfer it to the SD card using the SD card reader. There are two different
ways this can be handled: the user can install Raspbian manually, which will
require command line knowledge and external software, or the user can
download and install New Out of Box Software (NOOBs). The latter is a much
simpler process, so this is the one that will be broken down:
● Put the CD card into the computer or SD card reader.
● Download NOOBs and pick the “offline and network install”
option. This is the version that includes Raspbian within the
download itself.
● If the first download doesn’t take, try formatting the SD card as
FAT
○ To do this, simply right-click on the SD card icon, choose
Format, and click FAT32.
● Once you have the file onto the SD card, extract the ZIP file and
copy its entire contents onto the SD card itself.
● Once this entire process is complete, simply eject safely the SD
card and insert it into the Raspberry Pi.
That’s it. The rest will happen on the Raspberry Pi, which means that the
hooking up of the monitor has come.
Connecting is the easy part, but everything needs to be done in a specific
order so there is no chance of confusion or becoming bogged down with the
process. Plus, this helps the Raspberry Pi to easily recognize all of the devices
upon boot up.
First, connect the HDMI cable to the Raspberry Pi and whichever
monitor has been picked out. Then, connect the USB devices (such as the
keyboard and mouse). Make sure to do it in this order, and this order only. If
the user is utilized an ethernet cable in order to connect the router to the
Raspberry Pi, then connect it after the USB peripherals have been properly
hooked up.
Then, once everything is connection, the user can go ahead and plug in
the power adapter. Raspberry Pis do not have a power switch, so once the
power adapter is attached and plugged in, it will power on itself.
With the first boot up, NOOBs will take a couple of minutes to correctly
format the inserted SD card and automatically set up a few things. This part
simply requires patience (and gives you a chance to read ahead). But, the user
will eventually see a screen asking to have an operating system installed, and
the process becoming easy from here:
● Choose the preferred language and keyboard layout at the
bottom of the screen.
● Click the checkbox next to Raspbian.
● Click Install.
Then, NOOBs will run the installation process, and this can take 10 to
20 minutes to complete. However, when it is finally done, the Raspberry Pi
will automatically restart. When it all boots back up, it will send you right to
the Raspbian desktop where you can configure everything else to your personal
specifications, or simply tinker around with your new device.
With the desktop display, there is a start menu where applications can be
selected, a file browser can be opened, and the user will find that it functions
just like any other operating system. However, this is where setting up some
sort of internet connection comes into play if the user is not using an Ethernet
cable.
In terms of connecting to a network, it works the same as it does in
several modern operating systems:
● Click the network icon (the one in the top right corner that has
two computers in it).
● Select the appropriate WiFi network name and enter the
password.
That’s it. Now the user has WiFi capabilities. This works both in
graphical interface as well as within the command line, so setting it once is all
the user needs to do. If an older generation of Raspberry Pi is being utilized, a
WiFi adapter can be purchased to add on to the device, giving it this same
capability that follows these same instructions.
If the version of Raspberry Pi the user owns has Bluetooth capabilities,
this is the time that this will be set up as well. This requires pairing the device
with the Pi, and it varies a little bit depending on the actual device being used.
But, if the user has ever paired Bluetooth items before, the process is virtually
the same:
● Click the Bluetooth icon in the upper right-hand corner.
● Click “Add Device.”
● Find the device name that you want to pair with the Pi.
● Click the device’s name and follow the prompted instructions
on-screen to pair it with the Pi.
That’s it. Easy as Pi. Now, the user can begin really playing around with
Raspbian. The user can click and open whatever they wish, and they can begin
toggling certain default designs and functions in order to tailor it to their
personal specifications. The good thing about downloading Raspbian the way
it was outlined is because that download is permanent, meaning that if the user
does something that permanently compromises Raspbian, they can simply
follow the instructions above to reinstall it onto their Pi.
Now, some people might be intrigued by the idea of the Raspberry Pi
costing just $35.00, and the shelling out of money to purchase a monitor, USB
keyboard, and mouse makes them cringe. Luckily, there is a solution to that:
connecting the Pi remotely. This idea is very useful, especially if there is only
a laptop within the home, or simply no access to a monitor.
The user has the possibility to connect their Raspberry Pi’s command
line using SSH from any computer available. There won’t be graphic interface,
but any type of command from the terminal application can be run on the other
computer, and it will be executed on the Raspberry Pi. This is especially
useful if the user is working on a project that doesn’t require a screen.
Another way to bypass the needs of a monitor, mouse, and keyboard is to
use the VNC within the user’s home to utilize the home computer as a remote
screen. What this means is that if the user does need the graphical interface,
they can use the virtual network computing to get it. It enables the user to see
the desktop of their Raspberry Pi in a window on a desktop computer, and it
can be controlled as if someone is sitting in front of the Pi itself. If the user has
only a laptop or all-in-one desktop, this is one specific way to use the Pi
remotely. It’s slow, and not great for everyday use, but if the user just wants
basic setup without having to purchase any peripheral products, VNC is a way
to do that. However, this process requires much more tech-savvy knowledge,
so the best way for beginners is to follow the outline set up above until more
knowledge is acquired.
Chapter Five: How To Install Apps and Backup SD Card

Once the user has everything up and running, the next thing they need to
do is promptly backup their SD card. The user has put some sensitive
information on it, and if something gets compromised on the original SD card,
a copy needs to be somewhere. All of these techniques require knowledge of
the command line and terminal center of both Raspberry Pi and wherever the
user is backing it up to, so if you have limited knowledge on the subject, be
sure to follow these sets of instructions step-by-step.
One of the better ways to backup an SD card, as well as aid in the
restoration of one, is to use WIN32 Disk Imager. It can be downloaded from
SourceForge and installed, but before you start the software, the SD card has
to be inserted into the SD reader on the PC involved. Do not be alarmed about
a window popping up to show you the contents. Also, do not be alarmed at the
limited available content the file has. This is just the information the PC can
read, the rest is not readable by the PC, and that is fine.
Now, once Win32 Disk Imager is open, there is a blue folder icon to be
chosen. Click on it to choose the location of the backup, and name the backup
whatever you wish. Then, choose the drive letter for the SD card. From there,
all you do is click the “read” button, and the card will start backing up to the
PC of choice.
Then, if something happens to the original SD card and it becomes
unreadable or corrupted for any reason, simply go to the PC where the backup
is held, choose the file created in the backup process, insert the SD card into
the SD card reader slot, then click “write” to download the backup back onto
the SD card. If you do not want to use the card that has been corrupted, you can
use a completely different SD card, and it will give you the same outcome.
However, this process cannot be utilized if the user is using Mac
software. This one is a little more difficult, but it is possible. The process goes
as such:
● Insert the SD card into the SD card reader on the Mac
computer.
● Open “Terminal” and enter this command: diskutil list
○ This helps locate the SD card on the Mac operating
system.
■ Once this happens, a list of disks will pop up.
● Look for the SD card by searching for it’s name. In this
example, the SD card name is “/dev/disk1”
● Navigate back to “Terminal” and enter: sudo dd if=/dev/disk1
if=~/SDCardBackup.dmg
○ This creates a disk image (.dmg) of the SD card in the
Mac’s home directory.
■ The “/dev/disk1” is simply the card name. In this
area, enter the name of YOUR SD card.
● Then, it is time to wait. The SD card has to be completely read.
There is no time bar that pops up to count down time, so be patient
and wait until a command prompt reappears in the terminal
window.
If you use a Mac and the SD card becomes unreadable or corrupted,
simply follow the steps outlined above to find the copy. But, before the writing
process can occur onto the SD card, there is a process called “unmounting”
that has to occur. Simply put, this process disables the operating system from
writing the copy the same time the SD card is.
The following process works as such:
● Insert the SD card into the card reader.
● Open the terminal and enter: diskutil unmountDisk /dev/disk1
○ Again, replace “/dev/disk1” with whatever card name is
chosen for your SD card.
● Then, use this command line of code to write the image back to
the chosen SD card: sudo dd if=~/SDCardBackup/dmg
if=/dev/disk1
○ Once again, replace “/dev/disk1” with whatever the
name of the current SD card be utilized is.
● Once the copying has finished, remove it using this command
line: sudo diskutil eject /dev/rdisk3
Once the user comfortably has a backup or two of their SD card, the next
thing is all about fun: installing applications onto the Raspberry Pi.
There are several different ways to download applications, and the most
popular way is via the Raspberry App Store that the Raspberry Foundation
created. In order to get this, the Raspberry Pi has to be utilized in the way it
was intended for: the user has to broaden their knowledge of how command
lines work within their own product they have purchased.
● Open the command line with your Raspberry Pi and enter this:
sudo apt-get update && sudo apt-get instal pistore
● Once installed, a new icon not present before will be seen on
the main desktop of Raspberry Pi. Double-click it in order to open
it and it will be set up similarly to many other application stores.
From here, the user can search and download applications onto
their Raspberry Pi, as well as find screenshots and basic
information about applications available to them.
○ Only one application at a time can be installed, so make
sure to carve out time in your schedule if you want to
download multiple applications onto the Raspberry Pi.
The only issue many have with the Raspberry Pi App store the
Foundation created is the fact that this store houses only a fraction of what is
truly available for the Raspberry Pi. This is why there are other methods to
obtain applications, or “packages.”
Another way to download applications to the Raspberry Pi goes as such:
● Log into the Raspberry Pi, but do not fully enter the desktop
environment.
○ If you are already in the desktop environment, simply
double-click on the LXTerminal icon present in order to
open what is called a “shell session.”
● First, the repository has to be updated. So, enter this command:
sudo apt-get update
● This apt cache houses a large index of every single software
package available, and it is searchable to find what you want. In
order to narrow down the search by genre, simply use this
command line: sudo apt-cache search game | less
○ Replace “game” with any genre of application you wish
to search.
● Then, find a package you want to install. Each line has the
official name of the package, then a hyphen, and after that hyphen
is a brief description of the package and what it contains.
○ You can use the up and down cursor keys in order to
move through the vast list of files, and when you are done
browsing, Press the Q key.
● When you are ready to install, enter this command line: sudo
apt-get install penguinspuzzle
○ The last part, “penguinspuzzle” is a filler for the words
that will be before the hyphen of the requested file. For
example, if a file is named “titletitletitle -
allthethingsimaginable”, then replace “penguinspuzzle” with
“titletitletitle”
● Wait for the installation process to complete, and the
application is yours!
Yet another way to install applications is to download another user
interface called Synaptic.
● Make sure you are in Desktop mode on the Raspberry Pi. If it is
not started for whatever reason, enter startx in the terminal
window
● Open the terminal window and enter this command line: sudo
apt-get install synaptic
● Answer “yes” to all of the questions that will be prompted
during the installation process
● Once installed, Synaptic will be located in the Preferences
menu on the desktop
● When it is clicked on from the Preferences menu, you will be
prompted to enter a password for the root username “pi”. The
default password is “raspberry”.
● Now, a list of application packages will pop up, but it needs to
be updated to the latest ones. To do this, press “CTRL” and “R” at
the same time.
○ This will take a while once the reload begins, so be
patient.
● Once reloaded, the packages will be split into their assigned
sections that can be searched through in order to find what you
want to install,
● When ready to begin installing, simply click on a package and
select the button that says “Mark for Installation.”
○ Make sure to keep an eye out for any dependency
packages that might be required. These are packages that are
required in order to run the one you are selecting, so make
sure that if the package has any, to click on “Mark” beside
each of them so they will download as well.
● Once you have all of the selected application packages you
want to install, click the “Apply” button at the top of the program.
○ This will prompt a succinct summary of what you have
chosen to install.
● Click on “Apply” once again, and the packages will begin
downloading.
Some suggested packages in order to help the Raspberry Pi become
more like a laptop or desktop computer are gimp (a photoshop-esque photo
package manipulation program), chromium (the Chrome browser), calibre (a
library manager as well as an eBook converter), and libreoffice (a suite sort of
like Microsoft Word that houses a spreadsheet application, presentation
package, and word processor).
The Raspberry Pi was made to teach, so if the user has a lack of
knowledge on command lines and terminal windows, then this is a great way to
become familiar with them. As the Raspberry Pi is navigated, more innate
knowledge of the system will become easier to understand and navigate. Do
not let this deter you. Just take the steps slow, and research on a desktop
computer or laptop when necessary. The Raspberry Pi was created to educate.
Let it do what it was meant to do while harnessing the power of the Raspberry
Pi.
Chapter Six: Things To Know For First Time Pi Users

First time Raspberry Pi users can sometimes become incredibly


overwhelmed with the amount of lingo and knowledge that is required in order
to understand this system. Many people become intrigued because they hear
“computer” and “$35” and they go off and purchase it thinking they will be sent
a fully-functioning computer for a very cheap price. Yes, the Raspberry Pi is a
wonderful capable miniature computer that can fit in the palm of your hand, but
it is, first and foremost, a piece of educational equipment. This means that it
takes some background knowledge in order to get it to work.
The steps within this book are to help anyone install whatever they need,
but for some, the mere presence of lingo and abbreviations are an issue. The
best advice is to have a way of searching information available, whether that is
a desktop computer, a laptop, or a smartphone. Do not let the daunting
information present deter you from educating yourself. If successful, this will
not only allow you to unlock incredible potential from this small device, it will
prepare you for future technological evolutions that are coming in the next
decade.
The basics of the Raspberry Pi include a processor (the electronic
circuitry that carries out the basic functions asked of it), RAM (computer
memory that can be accessed randomly), a graphics chip (aids in the creation
of images), USB ports (the slot that the Raspberry Pi peripherals will connect
into), an Ethernet port (the cable plug-in internet fed directly from the router,
which is what feeds internet into the home), and an HDMI output (the
audio/video interface). Do not let all of this overwhelm you, these are all
different slots and chips that come installed into the Raspberry Pi. If you are
beginning to slowly plug things in, match the female part (the insertion tips on
the end of the cables) with the male outline (the ports on the Raspberry Pi).
Raspberry Pi can essentially be utilized to do anything a low-powered
computer can do. Watching a movie, playing basic video games, writing a
document, and even browsing a low-definition version of the internet. The only
thing that stops the Raspberry Pi from doing something is someone’s own
imagination: as long as you can imagine it, you can achieve it in one way or
another with this product. In a few chapters, we will discuss the different types
of projects that can be undertaken by the Raspberry Pi, as well as outline the
most popular and most useful and how to execute them.
Once your knowledge of the Raspberry Pi begins to grow (which will
come with tinkering around and closely following instructions), the GPIO
(general purpose input/output) pins located along one side of the Raspberry Pi
will enable a host of other possibilities. These pins on the board serve as
additional “hookups,” so things such as alternative buttons, sensors, and even
LED lights can be hooked up to these pins and enabled to function from the
Raspberry Pi board itself.
The beauty of this device is that it can be used on a large-range scale: it
can be used as a simple media streamer all the way to the operating center for
a drone. But, all of the possibilities hinge on not only the education of
command lines, terminal windows, and basic functions of the Raspberry Pi, but
it hinges on the learning of programming languages. Purchasing a Raspberry Pi
is a wonderful start, and the optional accessories will aid the user in their
journey to unlock its full potential. There are some decent tips that come from
seasoned professional Pi users that beginners would benefit from, and they
cover all topics from which Raspberry Pi is more versatile all the way to
simply being patient.
One of the top tips from the professional and seasoned users is to
implement various security methods on your Raspberry Pi. One of those
methods is to remove the default “pi” user that comes installed on it. Take note,
however, removing the “pi” user this way removes its basic home folder as
well. So, if you have anything important in the home folder of the username
“pi,” make sure to copy it over somewhere so it does not get deleted in the
process.
Follow these steps to initiate the delete:
● Login to the default “pi” user.
● Open the terminal window and enter this code: sudo adduser
jelly
○ In this case, “jelly” is whatever you want the new
username to be. Replace the “jelly” with whatever you want.
● When prompted to enter a new password, enter whatever you
wish, then hit the “enter” button and type it in again when
prompted.
○ It will then ask you if this information is correct, and if it
is, hit the “Y” button.
● Now, logout and log back into the new user preset, then reopen
the terminal window and type in this command line: sudo userdel
-r pi
If, for whatever the reason, the removal of the default user “pi” is not
what you wish to do, then change the default password for the username. This
is how you do that:
● Login to the Raspberry Pi under the “pi” username.
● Open a terminal window and input this command line: passwd
● It will ask you for the current password of the username, so go
ahead and type it in.
● Then, it will ask for the new password. Enter a new, and
secure, password.
● When it is updated successfully, this command line with
appear: passwd: password updated successfully
○ This effect will take place immediately.
If you are the type of person that wishes to take the security one step
further, there is a way to ban forceful attempts to access your Raspberry Pi
from the outside. Fail2Ban is easy to install and setup, and it will improve
drastically the security component on the Raspberry Pi. It monitors logs for
failures and, depending on how you set it up, it will ban and/or timeout any IP
address that fails to login to the server.
Here is how to install it:
● Open a terminal window and type in this command line: sudo
apt-get update
● Then, in the line below it, enter this: sudo apt-get install
fail2ban
○ If typed in correctly, two lines of code should appear
before anything is run.
● Press enter and allow Fail2Ban to install onto the Raspberry Pi
in question.
○ Once downloaded, the default settings for the application
can be found at “/etc/fail2ban/jail.conf”
● Once you find this file, open it up by typing this: sudo nano
/etc/fail2ban/jail.local
○ Don’t be alarmed when the file opens, because it should
be empty.
● Once the empty file is opened, input these settings:
1 [ssh]
2
3 enabled = true
4 port = ssh
5 filter = sshd
6 logpath = /var/log/auth.log
7 bantime = 900
8 banaction = iptables-allports
9 findtime = 900
10 maxretry = 3
● Once this is in, restart the application by using this command
line: sudo service fail2ban restart
What this all does is it configured the server you utilize from brute-force
attacks by automatically banning any IP address that fails to login to your
Raspberry Pi three times. But, understand that all bans and timeouts are
cleared upon either rebooting the server or restarting Fail2Ban. So, if you end
up locking yourself out of your own Pi device, simply restart it and you will be
just fine.
For the beginning Raspberry Pi user, there are two things that are
necessary: patience and curiosity. If you become frustrated, walk away from it
and find another tutorial. There are several out there, both from individual
users and from the Foundation itself, that will help in first-time users and
flourishing beginners to learn what they need to unlock the Raspberry Pi’s full
potential. But, the one thing it was created for was learning and utilizing
programming languages, and there is nothing more imperative for the
flourishing technological guru to understand.
Luckily, the Raspberry Pi can help.
Chapter Seven: Programming And Raspberry Pi

The Raspberry Pi’s essential function was to teach. It was supposed to


be a learning device for developing countries that aided children, especially
young girls, to help them find a possible dream within technology. The plan
was to get this type of technology into the hands of an untapped group that
could help forward the technological era for their generation after all of us are
long gone. But, this device no bigger than a deck of cards took off in ways that
were not even imaginable by the Raspberry Pi Foundation, and today the world
is seeing the likes of it being implemented into mass automation industries as
durable computers in workhouses.
But, this does not mean that the Raspberry Pi is no longer capable of its
original function. Many different coding languages can be harnessed and
utilized on the Raspberry Pi, such as HTML5, Scratch, Python, and C++. Not
only that, but Raspbian comes bundled with many different programs the user
can access or download from various places that aid in the education of these
programming languages.
The purpose of the Raspberry Pi was never to do many of the things it
can now do. This means that for those who want to utilize the Pi for its original
intentions, there are many different options that can be taken.
If part of the Raspberry Pi is its community aspect, then Eclipse is the
program you want. It starts, for most, with an IDE (integrated development
environment) optimized for the Java language programming. However, you can
also obtain IDEs for C++ and PHP. Think of it as a sort of online space maker.
That concept begins to touch the idea of what Eclipse truly is. This is one
available program that will enable the tinkering around of code and
programming while having a community of those willing to help at the user’s
disposal. But, if the user would rather learn programming alone, it is best to
leave Eclipse for another day.
Biicode is another program that aids in learning programming languages,
and this one is centered around one of the major issues encountered with C and
C++. One of its challenging sides is to keep track of the bite-sized chunks of
code in and outside of the main program. These chunks of code do many useful
things that are necessary to keep this programming language working, so
Biicode helps you keep track of them. They are called dependencies, and the
more modern your programming skills become, the more imperative a program
like this is going to be.
This program manages those dependencies and does so in a way that
keeps you focused on the broader aspect of a project instead of always having
to chase down small bite-sized chunks of information that might be wrong. It is
not a full IDE, but it can run side-by-side other environments in place. This
program is essential for turning any command and source codes into
functioning pieces of software.
One of the big deals within the world of Raspberry Pi is Adafruit. This
is an embedded controller IDE that enables someone to create very intricate
code on the minimal system of Raspberry Pi. If you are just beginning to learn,
the implementation of this might not be necessary. But, for someone who has
their programming chops, this program is a godsend. It will let you write and
edit code in a web interface, and then download directly into the storage tanks
of the Raspberry Pi. For many, this is the only IDE necessary on their
Raspberry Pi, though it does still have some bugs within it. This is the type of
program that can get someone started in the right direction in beginning to write
and execute small programming tasks to test your skills you have acquired.
Coder is a program that centers around the basis of a learning system.
This system aids in the creation of a web-based IDE that helps make
programming in Javascript as well as HTML very easy. It’s base setup is the
storage idea of “projects.” These “projects” are housed in an inner library
within the program that can be pulled up, modified, and tinkered with in any
way. It enables the user to experiment with little to no repercussions, and gives
the user a guilt-free environment to show off their skills and possibly create
new ones in the process.
Many businesses have utilized Coder as a way to get their employees
started on the basics of programming, and many parents are beginning to tap
into its potential with their own children. Coder and its projects are a
wonderful way for anyone who is curious about coding to begin. This program,
however, is not for a seasoned professional. It will not execute complex
Raspberry Pi projects.
Yet another program is VirtualBox. It is a system that enables OS
virtualization with the combined aspect of open source software. It started as
an Oracle project and built from there, and it turned into a fully open source
under GPL version 2.0. Now, Raspberry Pi can have its own emulation. But,
for those just beginning to dip their toes into this world, there are many
emulations to choose from that can be downloaded first.
With this idea of emulation and virtualization comes the need for QEMU.
Because VirtualBox can emulate Raspberry Pi at a software level, it requires
the processor to function in a different capacity depending on the emulation.
Virtualizing the hardware becomes QEMUs responsibility. It can emulate
anything from ARM up to S390, and this enables resolution of issues such as
fine-grained function and timing that are simply not understood by the
Raspberry Pi’s base operating system. In other words, the person tinkering
around has to be comfortable in knowing that the hardware will respond
properly to the code they are inputting, and QEMU makes sure of that.
This is yet another open source project that is available to anyone, and it
is also looking for new contributors. While these types of emulators are not the
normal for the world of Raspberry Pi and its development, it is possible that
they will become more and more popular as they continue onward and
forward.
WinSCP is another program available to those wishing to learn anything
and everything about the coding and programming languages of Raspberry Pi,
and this particular program aids in the toggling of code. WinSCP offers many
different interface options to the user, as well as multiple spoken language
options. It also has the ability to interface with a variety of transfer targets.
Something like WinSCP is essential for moving code around that you have
worked so very hard on, and it aims to keep the functionality of that code intact
as it is being toggled and moved around. Keep in mind, however, that WinSCP
is only usable with a Windows development platform.
These are all programs that aid those who are already pretty versed in
programming languages. What about those who are simply beginning? Are
there programs and applications to help those simply learn the basics? Yes,
and there are plenty of them.
BlueJ is an IDE for Java, and it runs on multiple operating systems. What
a user can do with this program is interact with specific objects and run them
through certain tests. The user can pick one or create their own and run it
through various properties, such as inspecting their value, passing them as
parameters, calling specific methods on them, and invoking Java expressions
without ever having to compile them onto one another. In other words: if
someone asked you to dump out some legos and build them a tower, you would
have the ability to pick up a singular block, inspect its color, look at its shape,
count its holes, perform experiments on it to see if it is durable, and then set it
back down and move on to a different piece without ever actually building a
tower.
That is what this program is for Java.
Geany is another program, and it is an IDE for just about any
programming language. This program enables coding in dozens of different
languages, including (but not limited to) PHP, Python, Pascal, C, and Java. Not
only that, but it runs on every operating system and every computer or laptop,
including the Raspberry Pi. It was originally developed as a very small and
very fast IDE that did not come with many dependencies on other packages
(like VirtualBox and QEMU). Another, yet separate, goal of this was that they
wanted this program to be as independent as possible from specialized desktop
environments. And the succeeded, because the only requirement necessary to
run Geany is the GTK2 runtime libraries. This program provides valuable
information and insight into code folding, syntax highlighting, call tips, symbol
lists, symbol name auto-completion, and a host of other programming and
coding subjects. Not only that, but this program comes equipped with its own
inner system that the user can access to compile, text, and execute their own
code built for simple project management as the user’s skills progress.
It is truly a one-stop shop for a beginner.
But there are so many other applications available. Greenfoot is another
IDE for Java, and it includes many common tools known to most IDEs, such as
project management and syntax highlighting. It allows the user to publish their
work both online and offline, and the interface is built with beginners in mind.
It only harnesses the power and language of Java, but it is a fully-
institutionalized beginners guide to Java, complete with a safe environment to
tinker around in. This would be the type of environment that a beginner to
utilize before transferring to an environment such as BlueJ.
The world of programming and coding has never been broken down
better than within the world of Raspberry Pi, and it only stands to reason it
would be that way since its beginning purpose was to be utilized as a learning
device. Do not let the worldwide implementations of this device intimidate
you, this device is perfect for beginning wanting to delve into the world of
computer programming and encoding languages.
However, the most popular one when it comes to Raspberry Pi just so
happens to be Python.
Chapter Eight: Python For Raspberry Pi

Many programmers believe that Scratch is wonderful for learning the


basics of programming. Scratch is a programming language created simply
with beginners in mind, and it truly is the perfect tool for those starting with
absolutely no background knowledge or exposure to programming. However,
even a beginner will soon run into its limitations, and that is where Python
comes in.
The first big difference is that, while Scratch is a mixture of text-and-
image-based programming, Python is all text-based. This does not mean that
the user cannot create images, it simply means that the “drag-and-drop” blocks
within Scratch are not found within Python. Try to think of those drag-and-drop
blocks as chunks of text, and those chunks of text have to be put in the correct
order so they can be executed. That is the relation between the two languages
from a boiled-down standpoint.
Python is a wonderfully useful programming language, especially for
those starting out. It has easy to read syntax, uses fewer lines of code as
compared to languages like Java and C in order to execute the same functions,
and it comes already installed on the Raspberry Pi. Python began as a scripting
language for Linux, and is similar to shell programs because the files contained
within the program house a series of commands that are executed from top to
bottom. Python does not require compilation before running and executing
programs, and it can be programmed to automate tasks, such as moving large
amounts of files to necessary places and batch renaming.
But, outside of these functions, Python has more useful programming
things. It can create desktop applications, utilities, web applications, small
databases, special GUIs, and even 2D games! Python also has a massive
collection of libraries, and this speeds up its overall development process.
Libraries from GUI interfaces to web frameworks to game programming all
exist, and they are all useful to Python learners and scourers of any age and
capability.
However, the one downside is that many systems need a Python
interpreter in order to run files executed on a computer. But, in order to remedy
this, programs such as Pyinstaller and Py2exe have been created that enable the
packaging of the created Python code into stand-alone programs that can be
executed and read by whatever system it is being created upon.
It is true that many things you can do with Python you can also do in C,
and many wonder why individuals don’t utilize C to program. While it takes
more lines of programming to execute the same type of function, C is much
faster at computations than Python. What draws people, especially beginners,
to Python is the ease of its use. Python is the ideal programming language for
prototyping and designing programs and applications that are not
computationally intensive. Plus, the programmer can get it finished quicker
because fewer lines of code are necessary.
One of the first things someone needs to know how to do is how to
update the version of Python installed onto the Raspberry Pi. The only thing it
requires is opening a terminal window and entering this command line: sudo
apt-get install python3. Of course, if Python 3 is not what you are using,
simply replace the version of Python you are using with the “python3” in the
command line.
One of the best programs that can be used with Python is called IDLE,
and this program allows you to input certain commands. But, along with this
inputting of commands comes certain things that help the user to refine their
programming skills. IDLE houses its own text editor that has color-coded
syntax errors as well as the automatic placing of indents where one is
necessary. Not only that, but it includes a handy help command that can help the
user with their syntax to begin with if they are unsure where to go from there.
Another benefit to utilizing Python is the fact that, because it is
completely text-based, the user can employ the use of any text editor to create a
program. The one that comes with the Raspberry Pi by default is Leafpad.
However, Geany is another popular choice with those who are new to Python
and its programming language. Just make sure to understand the difference
between a text editor and a word processor. A word processor has built-in
formatting corrections that will mess with the base formatting of what the user
is attempting to input, and it will not translate well into Python, even if fixed.
IDLE was built with the intention of being simple for those who are
simply beginning, and has become the number one program for those starting
out in learning Python. If the operating system installed on the Raspberry Pi is
Raspbian, then it comes with both Python version 3 as well as 4 already
installed, which is another reason why beginners who have delved into the
world of the Raspberry Pi begin to utilize it first: because it is already present.
When accessing IDLE in order to begin poking around in the world of
the Python programming language, the user has probably entered some issues
with their keyboard. If not, fantastic. If so, this means the user is figuring out
that the Raspberry Pi comes preprogrammed with a U.K. English keyboard
layout. If this needs to be changed, there are the following steps to take:
● Open a terminal window and run: sudo raspi-config
● Find the menu option that looks like this: configure_keyboard
● Under that menu option, choose “Other”, then “English (US)”,
then “English (US) again to confirm
○ Another useful thing is that some individuals prefer
utilizing the Caps Lock key as Ctrl. If this is a preference,
then run this command: setxkbmap -option “ctrl:nocaps”
● Then, a reboot is necessary to make sure everything is in order,
so reboot by running this command line: sudo reboot.
Once everything is in place and as the user likes it, finding and running
IDLE is simple because of both Python 3 and 4 coming preinstalled with the
Raspbian operating system. If there is not an IDLE desktop icon on the
homescreen, then the user can access it from the applications menu. Be wary,
IDLE might take a few seconds to load, but once it does a text editor screen
will pop up. When it first appears, the triple chevron text (>>>) is denoting the
interactive prompt, meaning that the present interpreter is waiting on the user to
input something.
If the user wants to open multiple script windows at once, for whatever
reason, simply select “File,” then “New Window,” and a new window will be
created.
From here, the user can take the programming language anywhere. The
best way to learn Python is by learning any new language, and that is to jump
right in. As the user maneuvers around, they will find their own way of
recalling, remembering, and scripting things that Python will allow, and
eventually the experimenting will evolve into creating. Python is a wonderful
start for many beginners because of the truncated need for lines of text and
because of the incredibly helpful programs that already come installed with the
Raspberry Pi and its Raspbian operating system.
Then, once the user masters this programming language, or at least has an
intermediate understanding of it, they can begin to branch out into
experimenting and learning other programming languages as well as coming up
with fun at-home projects to create that harness those programming skills.
Projects such as flying homemade drones all the way to playing retro games
requires some sort of programming knowledge, and an entire world is opened
up to the user once that knowledge is acquired.
Chapter Nine: Beginners Projects For Raspberry Pi

Understanding the coding languages of the Raspberry Pi opens of a host


of projects available to the user to navigate and establish. People have created
home surveillance systems, constant (and free) internet radio streaming, housed
their own multi-gigabyte eBook library, and even made their own touchscreen
pads! However, the two biggest and most popular projects are creating a way
to fly your own drone and making your own retro console… And both projects
will be outlined in this chapter.
For the retro console, over 50 different retro consoles can be adapted
and recreated utilizing this method. Here is what you will need to get started:
● A Raspberry Pi (the Raspberry Pi 3 is recommended because
of its WiFi capabilities, but other Pi’s will work as well).
● A micro-USB power supply of some sort.
● An 8GB micro-SD card (at least).
● A USB controller (optional, but lots of fun in the process).
● A USB keyboard (only for the initial setup, though).
● Some sort of monitor.
● Required cables to hook up the Raspberry Pi to the monitor.
● A computer in order to setup the SD card and transfer the
ROMs.
First, RetroPie has to be installed onto the SD card. Doing it this way
and utilizing RetroPie gives you access to all of the emulators instead of just
one, and simplifies the process a great deal. Here is what you do:
● Insert the SD card into the computer being utilized for setup.
● Download the RetroPie Project SD card image for the version
of your personal Raspberry Pi being used for the project.
○ Be prepared for a wait time, this can take a while to
download.
● Once it is done, extract the image to the SD card the same way
you would have done with Raspbian.
● When the extraction process is complete, remove the SD card
safely and replant it into your Raspberry Pi.
Now, you need to boot up your Raspberry Pi with the newly-extracted
SD card implanted into it in order to set up the emulators. On the first boot,
there will be several on-screen prompts to complete, and you will be able to
do these with the USB controller you have hooked up. If you are utilizing a
Bluetooth-connected controller, hook it up to a USB input and do it this way
for the setup. You can utilize the Bluetooth feature once you are actually
playing.
Once this initial setup process is complete, you will have the ability to
navigate through RetroPie simply with the controller. If you are using a
Bluetooth-enabled controller, this is where you can unhook it from the USB
and begin experimenting. If you see less emulators than you thought, do not
worry! As you begin to download games, they will pop up. They are simply
hidden until games are installed in order to create a seamless transition on-
screen.
This is it! You now are the proud owner of as many retro games and
consoles as you please! There are many kits packaged for sale that provide fun
cases for your Raspberry Pi. If you want to feel even more retro, consider
obtaining one that makes your Raspberry Pi look like your favorite retro
console!
The other popular project is the newest one to come onto the scene, and
that is drone flying. While the project above is for beginners, this project is for
those who are much more advanced in their usage of Raspberry Pi and their
knowledge of robotics. However, if you are simply beginning, this might be a
project to aspire to!
The parts you need are as such:
● Erle Robotics PFXmini
● Raspberry Pi Zero
● HobbyKing Spec FPV250
● Erle Robotics PXFmini compatible power module
● Soldering iron
● Tape
● Screwdriver
● APM flight stack
● Debian-based Linux file system for drones
First, the drone kit has to be assembled:
● Put the frame together and mount the motors.
● Mount the ESCs (electronic speed controllers) to the frame
using just some tape and then connect them to the mounted motors.
● Assemble the red-power and black-ground ends of all the ESCs
into the individual cable. This cable will eventually connect into
the battery.
○ Then, you can make everything look neat.
● Then, solder the power module connectors to the battery ones.
This will easily enable the connecting and disconnecting of battery
and power module to the drone.
○ You can either cut the connectors and solder the battery
and power module together (be mindful of short circuiting
things), or you can cut the other end of the power module
and resolder the previously cut battery connector to that
newly-opened location.
● Then, place the battery pack underneath and attach it using some
sort of velcro or tape.
Then, you have to ready the autopilot:
● Connect the PFXmini shield on top of the Raspberry Pi being
utilized for the project.
● Then, getting the correct software for the Raspberry Pi onto it is
necessary. Many kits already come with this kind of thing already
installed onto the flight stack. This just means that getting the
software onto the Raspberry Pi requires fetching the correct
images and flashing them onto the micro-SD card that is being used
with the Raspberry Pi for the project.
Now, it is time to mount the autopilot:
● The autopilot is the combination of the Raspberry Pi and the
PFXmini. Pick where and how you want to mount it, and then
connect the JST GH cable from the mounted power module to the
PFXmini.
● Then, get the ESC cables and connect ESC 1 to PWM 1, and
continue that process until all four ESCs from the four motors are
hooked up into the power module.
Last, it is time to mount these propellers and get to flying! In order to do
this:
● Understand that two of the propellers need to turn clockwise,
and the other two counterclockwise.
● The two clockwise-turning propellers go on motors 3 and 4,
and the counterclockwise-turning propellers go on motors 1 and 2.
○ THIS IS VERY IMPORTANT!
● Then, it is just a simple matter of picking how you want to
control your drone.
○ You can control it using the WiFi and a gamepad, the Wifi
and an ROS, or a traditional RC. Once you choose, it is
simply a matter of hooking it up to the drone.
The drone project is not for the faint of heart, and there are many kits out
there that will aid in this venture. Creating one of your own without purchasing
a kit requires an exponential amount of skill and knowledge of the hardware
and how to pair it, but it is not impossible is that is a goal you want to obtain.
The retro gaming console for beginners and the drone-flying for experts
are the two most popular projects for the Raspberry Pi. However, they are not
the only projects. Use your imagination! Find tutorials online! Your Raspberry
Pi is capable of many things, from personal possession protection all the way
down to a simple media streaming device. Get creative and implant your own
personal desires within your Raspberry Pi device. It is a world unto itself that
is lending its mastery to the world of mass industrial production, and is only
just beginning to make the waves that will result in the tsunami of uses that the
Raspberry Pi will see in the future.
Do not get left behind in its wake.
Conclusion

The Raspberry Pi began as an education tool, and has branched into a


technological world all its own. Its educational uses make it the perfect
instrument for beginners, and its practical applications make it imperative for
technological intermediaries and experts. The world that the Raspberry Pi
produces is nothing short of revolutionary, and its modern applications in the
world of industrial creation and marketing is beginning to make waves in the
consumer market industry. Many people enjoy it simply for the affordable cost
that gives them a basic computer, and still many others enjoy it for the projects
they can tackle and the easy way the Raspberry Pi has of expanding its reach
and its power.
This device that fits in the palm of the hand is capable of everything from
basic word processing to building projects equivalent to massive home
surveillance. It can strengthen and broaden the reach of a WiFi system, it can
house dozens of programming languages at once, it can aid in the building of
one’s own coding systems, and it can even be expanded upon to help in bigger
projects with more computing power.
The technological age we are living in is not unreachable for those who
lack in technological knowledge. While the Raspberry Pi has spread its wings
and found itself venturing into other worlds, do not neglect what the Raspberry
Pi was first created for: education. It is currently implemented in some school
systems around the world, and many teachers who need to learn the basics of
programming seek its teaching tools in order to keep up and educate
themselves when necessary. The Raspberry Pi does not just reach those who
are already knowledgeable because it was created for those who are not.
The Raspberry Pi is a revolutionary device that has not even begun to
scratch the surface of what it is capable of within this society. Many believe it
will quickly branch out and find its way into many Fortune 500 companies
within the next decade, and some technological theorists believe that, as it
continues to evolve, it will soon overtake desktop and laptop computers
altogether. It’s short lifespan and evolution tactics have seen some of the most
drastic innovations, and people believe that if it keeps progressing the way it
has in the past, it will surpass all modern technology we currently have
available to us.
And it will all stay at a very affordable price.
The Raspberry Pi has changed the face of the game in affordable
technology. The only thing that stands in between someone and this
revolutionary device is the ability to code, and the Raspberry Pi was built to
teach just that.
Utilize it for its intended purpose, and unlock a world you never
dreamed of experiencing.

You might also like