Book Image

Raspberry Pi Robotic Projects - Third Edition

By : Richard Grimmett, Jon Witts
Book Image

Raspberry Pi Robotic Projects - Third Edition

By: Richard Grimmett, Jon Witts

Overview of this book

This book will allow you to take full advantage of Raspberry Pi Zero and Raspberry Pi 3 by building both simple and complex robotic projects. The book takes a mission-critical approach to show you how to build amazing robots and helps you decide which board to use for which type of robot. The book puts a special emphasis on designing mobile (or movable) robots using the Raspberry Pi Zero. The projects will show inexpensive, yet powerful, ways to take full advantage. It will teach you how to program Raspberry Pi, control the movement of your robot, and add features to your robots.
Table of Contents (13 chapters)
Raspberry Pi Robotic Projects - Third Edition
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface

Adding Internet access


Unlike the Raspberry Pi 3, the Raspberry Pi Zero does not have a LAN connection. To connect the Raspberry Pi Zero to the Internet, you have two choices. You can establish a wireless LAN connection, or you can connect by using a USB to LAN adapter if you want to connect to an actual LAN port. Let's look at both of these possibilities.

If you are going to connect wirelessly, make sure that you have a wireless access point available. You'll also need a wireless device. The official Raspberry Pi Foundation markets a device itself, but other brands also work.

See http://elinux.org/RPi_USB_Wi-Fi_Adapters to identify which wireless devices have been verified to work with the Raspberry Pi Zero. Here is one that is available at many online electronics outlets:

You'll also need to connect a powered USB hub for this process so that you can access both the keyboard and mouse, as well as the USB wireless LAN device. Now, connect the device to the powered hub.

Boot the system and then edit the wpa_supplicant.conf file by typing sudo nano /etc/wpa_supplicant/wpa_supplicant.conf. You need to change it to look like the following:

The wpa-ssid and wpa-psk values here must, of course, match what your wireless access point requires. Reboot and your device should be connected to your wireless network. You'll know if it is connected by looking in the upper right-hand corner of the screen, where you should see the following:

You can now download any additional functionality you want to install from the Internet.

If you want to connect to an actual LAN cabled connection, you need a device that goes from USB to LAN. This site, http://elinux.org/RPi_USB_Ethernet_adapters, lists a number of different possibilities. The following is an image of one such device:

Connecting the Raspberry Pi Zero in this way is actually amazingly easy. Simply plug the USB to LAN adapter into the powered USB hub, connect an active LAN cable, and you should have Internet access. You can then follow the same instructions as for the Raspberry Pi 3 to access your Raspberry Pi from your host PC.

Now that you know how to use ssh, tightvncserver, and scp, you can access your Raspberry Pi remotely without having a display, keyboard, or mouse connected to it! If you are connecting via a WLAN connection, your system will now look like the following:

Now you can access your Raspberry Pi Zero remotely. As with the Raspberry Pi 3, you can use either the ifconfig command or Advanced IP Scanner to get the IP address of your Raspberry Pi Zero.