Book Image

Raspberry Pi Zero W Wireless Projects

By : Vasilis Tzivaras
Book Image

Raspberry Pi Zero W Wireless Projects

By: Vasilis Tzivaras

Overview of this book

The Raspberry Pi has always been the go–to, lightweight ARM-based computer. The recent launch of the Pi Zero W has not disappointed its audience with its $10 release. "W" here stands for Wireless, denoting that the Raspberry Pi is solely focused on the recent trends for wireless tools and the relevant use cases. This is where our book—Raspberry Pi Zero W Wireless Projects—comes into its own. Each chapter will help you design and build a few DIY projects using the Raspberry Pi Zero W board. First, you will learn how to create a wireless decentralized chat service (client-client) using the Raspberry Pi's features?. Then you will make a simple two-wheel mobile robot and control it via your Android device over your local Wi-Fi network. Further, you will use the board to design a home bot that can be connected to plenty of devices in your home. The next two projects build a simple web streaming security layer using a web camera and portable speakers that will adjust the playlist according to your mood. You will also build a home server to host files and websites using the board. Towards the end, you will create free Alexa voice recognition software and an FPV Pi Camera, which can be used to monitor a system, watch a movie, spy on something, remotely control a drone, and more. By the end of this book, you will have developed the skills required to build exciting and complex projects with Raspberry Pi Zero W.
Table of Contents (11 chapters)

Distributions

The official site https://www.raspberrypi.org/downloads/ contains several distributions for downloading. The two basic operating systems that we will analyze later are Raspbian and NOOBS. You can see what the desktop environment looks like in the next image. Both Raspbian and NOOBS allow you to choose from two versions. There is a full version of the operating system and a lite one. Obviously, the lite version does not contain everything that you might use, so if you intend to use your Raspberry with a desktop environment, choose and download the full version.

On the other hand, if you intend to just SSH and do some basic stuff, pick the lite one. It's really up to you, and of course, you can easily download anything you like and rewrite your microSD card.

The NOOBS distribution

Download NOOBS from https://www.raspberrypi.org/downloads/noobs/. The NOOBS distribution is for new users who do not possess much knowledge about Linux systems and Raspberry Pi boards. As the official page says, it is really, "New Out Of Box Software." There are also preinstalled NOOBS SD cards that you can purchase from many retailers, such as Pimoroni, Adafruit, and The Pi Hut, and of course, you can download NOOBS and write your own microSD card. If you are having trouble with a specific distribution, take a look at the following links:

The NOOBS operating system contains Raspbian, and it provides various other operating systems available to download.

The Raspbian distribution

Download Raspbian from the official page https://www.raspberrypi.org/downloads/raspbian/. Raspbian is the officially supported operating system. It can be installed through NOOBS or by downloading the image file from the following link and going through the guide on the official website.

Image file can be downloaded from: https://www.raspberrypi.org/documentation/installation/installing-images/README.md

It has plenty of preinstalled software such as Python, Scratch, Sonic Pi, Java, and Mathematica.

Furthermore, more distributions, such as Ubuntu MATE, Windows 10 IoT Core, or Weather Station are meant to be installed for more specific projects such as IoT or weather stations. To conclude, the right distribution to install actually depends on your project and your expertise in Linux systems administration.

Raspberry Pi Zero W needs a MicroSD card for hosting any operating system. You will be able to write Raspbian, Noobs, Ubuntu MATE, or any other operating system you like. So, all you need to do is simply write your operating system to this MicroSD card. First of all, you have to download the image file from https://www.raspberrypi.org/downloads/, which usually comes as a .zip file. Once downloaded, unzip the zip file; the full image is about 4.5 gigabytes. Depending on your operating system, you can use different programs as follows:

  • 7-Zip for Windows
  • The Unarchiver for Mac
  • Unzip for Linux

Now, we are ready to write the image to the MicroSD card. You can easily write the .img file to the MicroSD card by following one of these guides, according to your system.

For Linux users, the dd tool is recommended. Before connecting your MicroSD card with your adapter to your computer, run the following command:

df -h

Now, connect your card and run the same command again. You will see some new records. For example, if the new device is called /dev/sdd1, keep in your mind that the card is /dev/sdd (without the 1).

The next step is to use the dd command and copy the .img file to the MicroSD card. We can do this using the following command:

    dd if=<path to your image> of=</dev/***>  

Where if is the input file (image file or distribution) and of is the output file (MicroSD card). Again, be careful here, and only use /dev/sdd or whatever yours is without any numbers. If you are having trouble with this, use the full manual by referring to the link https://www.raspberrypi.org/documentation/installation/installing-images/linux.md. A good tool that can help you out for this job is GParted. If it is not installed on your system, you can easily install it with the following command:

    sudo apt-get install gparted 

Then, run sudo gparted to start the tool. It handles partitions very easily, and you can format, delete, or find information about all your mounted partitions.

More information about dd can be found at https://www.raspberrypi.org/documentation/installation/installing-images/linux.md.

There are several other ways to write an image file to a microSD card. So, if you face any problems when following the preceding guides, feel free to use any other guide available on the internet. Now, assuming that everything is okay and the image is ready, you can gently plug in the MicroSD card to your Raspberry Pi Zero W board.

Remember, you can always confirm that your download was successful with the sha1 code. In Linux systems, you can use sha1sum followed by the file name (the image) and print the sha1 code. This should and must be the same as it is at the end of the official page, where you downloaded the image.