Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
BeagleBone Robotic Projects
BeagleBone Robotic Projects

BeagleBone Robotic Projects: Developer or hobbyist, you'll love the way this book helps you turn the BeagleBone Black into a working robot. From listening and speaking to seeing and moving, we'll show you how – step by step.

eBook
€8.99 €28.99
Paperback
€37.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

BeagleBone Robotic Projects

Chapter 1. Getting Started with the BeagleBone Black

Ordering the hardware (HW) is the exciting part of any project. You have wonderful dreams of all that you might accomplish once this amazing piece of technology is delivered. Unfortunately, the frustration of the first few attempts at accessing the capabilities of the unit can leave many developers, especially those with little experience with this type of dedicated system, so discouraged that the board can end up on the shelf, gathering dust next to the pet rock and cassette tape recorder.

Mission briefing


There is rarely anything as exciting as ordering the latest new technology and anticipating its arrival. You daydream of the projects you'll build, the amazing things you can do, the accolades you'll receive from family, friends, and colleagues. However, reality rarely fulfills your fantasies. This project will hopefully help you avoid the pitfalls that normally accompany unboxing and configuring your BeagleBone Black. You'll step through the process, answer all kinds of clarifying questions, and help you understand what is going on. If you don't get through this project, then you'll not be successful at any of the others, so buckle up and get ready for an exciting ride.

The most challenging aspect of accomplishing this for me as your guide is trying to decide to what level I should describe each step. Some of you are beginners, some have limited experience, others will know significantly more than I in some of these areas. I'll try to keep it brief, but also try to be thorough, so that at least you'll know what steps to take in order to be successful. I'll also try to point out some of the different ways you can get help if you are encountering problems. So for this project, here are your objectives.

Your objectives

Your objectives are as follows:

  • Hooking up a keyboard, mouse, and display

  • Changing the operating system

  • Adding a graphical user interface

  • Accessing the board remotely

Tip

Downloading the example code and colored images

You can download the example code and colored images for this book you have purchased from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

Mission checklist

Here are the items you'll need for this project:

  • A BeagleBoard Black

  • The USB cable provided with the board

  • A display with the proper video input

  • A keyboard, mouse, and powered USB hub

  • A micro SD card of at least 4 GB

  • A micro SD card reader/writer that fits your computer

  • Another computer that is connected to the Internet

  • An Internet connection for the board

The unveiling!


The board has finally arrived. Here is what should come with the standard package:

Prepare for lift off

Before plugging anything in, inspect the board for any issues that might have occurred during shipping. This is normally not a problem, but it is always good to do a quick visual inspection. You should also acquaint yourself with the different connections on the board. Here they are, labeled for your information:

Engage thrusters

So let's get started. You need to power the board, but you also need to hook up a way to interact with the board and see the results of your interaction. The first thing you'll notice is that there is no cable that fits the 5V DC connector. What's with that? Am I already hung up without ever powering on the board? Well, fortunately no, but you do need to talk about power for a moment. There are two ways to power the board. The first is through the USB client connection. This is done by:

  • Connecting the micro-USB connector end of the cable to the board

  • Connecting the standard sized USB connector to either a PC or a compatible DC power source that has such a connection

If you are going to use a DC power source, make sure the unit can supply at least one ampere. This is not optional. Although the board might not always draw this much current, if it senses that the unit cannot supply the required current, it will shut down.

There is another option to power the board: simply supply 5V DC to the connector. Make sure that the plug is 5.5 x 2.1 mm (centre positive) and that the unit can supply at least one ampere. As mentioned earlier, this is not optional.

Even if you are going to choose a DC power source for your board, initially let's connect the board via the provided USB cable. Almost all of the different projects you work on here will need to supply power from a battery pack anyway, and if you supply the board through the USB port and micro-USB connector, you can use your external computer to communicate with the board and ensure that it is up and working.

Objective complete – mini debriefing

When you plug the board in, the PWR LED, located by the 5V input, should light blue on the board. Here is a close up of the LED locations, just so that you're certain which one to look for:

The other four indicators on the right-hand side of the LAN connection will eventually begin to flash blue. The one on the far right will eventually flash as a heartbeat indicator, letting you know that your processor is working by flashing twice quickly, approximately once per second.

Now you can use some computer software (SW) to make sure your board is operating correctly. When you first plug the board into a Windows PC, you'll see the indicator at the lower-right indicating that new HW is being installed. Eventually—and this may take a bit—you'll get the indication that your device is ready to use. If you are using Windows 7, you can view the device in your Devices and Printers display (select this from the Start menu). You should see this:

If you see this and the farthest right LED flashing in a heartbeat fashion, you've successfully connected your board. If you can't reach this point, see the following Classified intel section.

Once you've connected, you can actually communicate with your board via the USB connection. Open a Firefox or Chrome browser and type in the address 192.168.7.2. You should see the following in your browser:

If you've reached this point, congratulations! You are now communicating with your BeagleBone Black as the web pages are being served by the on-board web server. You're ready for the next step. Don't continue with directions on this page; you're going to take a different route in updating your BeagleBone Black. If you're having problems, the folks at beagleboard.org have a rich set of forums that can help you work through any of the problems you might be having unpacking the board.

Classified intel

Powering the board can be a bit challenging, since the board requires at least 500 mA of current, and many USB cables and ports are limited by design to less than 500 mA. When attempting to power up with these cables on a power supply that cannot supply enough current, the unit will begin to power on, the blue LEDs will begin to flash, and then everything will turn off. This was a more significant problem with early units than the units that are currently shipping.

Also, if you are struggling to connect to the board, you may need to download drivers. These are available on the beagleboard.org site.

Hooking up a keyboard, mouse, and display


The board is now powered on, and you have blinking LEDs. You have been able to access the basic functionality via the USB port. However, you want to do much more. This task will help you accomplish your goals.

Prepare for lift off

Now that you know that your board works and you've verified the connection via the provided USB cable to your computer, you're going to add the peripherals so that it can operate as a standalone computer system. This step is a bit optional, as in the future your projects will be in systems where you won't connect directly to the board with a keyboard, mouse, and display. However, this can be a great learning step and in the off chance, you need to do some debugging on the system. It is good to know how to connect directly to the board. You'll also use this configuration to verify the basic SW installation before you start your projects.

You'll need:

  • A USB mouse.

  • A keyboard.

  • A display device.

  • You may also need a USB hub, and if you don't have one, get a powered USB hub. This will be important later in your project work.

Many of you will have most of this stuff already, but if you don't, there are some things to consider before buying additional equipment. Let's start with the keyboard and mouse. Most mice and keyboards have separate USB connectors. You'll notice, however, that on your BeagleBone Black there is only one USB port; thus, there is a need for the USB hub.

Before deciding on the hub to connect to your board, you need to understand the difference between a powered USB hub, and one that gets its power from the USB port itself. Almost all USB hubs are not powered; that is, you don't plug in the USB hub separately. The reason for this is, almost all of these hubs are hooked up to computers with very large power supplies, and so powering USB devices from the computer is not a problem. This is not the case for your board. The USB port on your board has very limited power capabilities, so if you are going to hook up devices that require significant power—for instance, a WLAN adapter or Kinect sensor—you're going to need a powered USB hub, one that provides power to the devices through a separate power source.

If you already have a hub that is not powered and want to use it to connect your keyboard and mouse, feel free, it should work fine as these do not draw too much power. If you don't already have a keyboard and mouse, or are looking for a keyboard and mouse that you can dedicate to your board, I suggest choosing a keyboard with a mousepad. That way you only have one USB connection to the two devices.

To complete this step you'll also need a display. You need to investigate which display types can be used with the BeagleBone Black. The only video output on the board is a micro-HDMI connector. The easiest connection to create is to connect the board directly to a monitor or TV that has an HDMI input; however, you'll probably need to buy either a cable that has micro-HDMI on one end and regular HDMI on the other, or an adapter from micro-HDMI to regular HDMI. HDMI monitors are relatively new, but if you have a monitor that has a DVI input, you can buy adapters or HDMI to DVI cables relatively inexpensively that provide an interface between DVI and HDMI. The display I use has a DVI input.

Don't be fooled, however, by adapters that claim that they go from HDMI to VGA, or HDMI to s-video. These are two different kinds of signals: HDMI and DVI are digital standards, and VGA and s-video are analog standards. There are adapters that can do this, but they must contain circuitry and require power, so are significantly more expensive than any simple adapter, and they result in a lower quality output.

Engage thrusters

Now that you have your parts, connect the USB hub to the standard USB port, the keyboard and mouse to the USB hub, and the display to the micro-HDMI connector as shown here:

Once these are all connected, plug in the USB hub, the display, and finally the BeagleBone Black board. Since I am no longer going to use the USB connection to the computer, I am using a standard USB 5 volt power supply. Make sure you connect all your devices before you power on the unit. Most operating systems support hot-swap of devices, which means you are able to connect a device after the system has been powered, but this is a bit shaky in the embedded environment. You'll always cycle power when you connect a new HW.

Objective complete – mini debriefing

Once this is complete, the unit should power on; it will boot its default operating system from the internal eMMC space, which is a sort of internal memory card and the display will look like this:

So you should now be able to interact with your BeagleBone Black directly. This is an important step, although for most of your projects you'll use a remote computer to program and control your device. Keep the components you have gathered around for debug purposes, you may need them later, as there is at least a possibility that things might go wrong and you'll need to find out how to fix them.

Classified intel

Just a couple of notes about this task. First, if you have problems powering the system, check to make sure your power supply can supply enough current. Don't even consider powering the system with less than 1 amp. Also, if you are using a power supply with a USB connector, make sure you use the cable that came with the unit to connect between the USB and the unit. Some cables also limit the current, and the unit will sense this and not power on correctly.

Also, a note on connecting to the display: the board's HDMI connector is micro-HDMI, which almost begs for an adapter. The display I chose to use is an inexpensive monitor with DVI input, so I purchased a cable that went from standard HDMI to DVI. Then I purchased a micro-HDMI to standard HDMI adapter. For some reason, I had problems with this configuration, and chalked it up to a bad HDMI adapter. I now prefer a cable that has a micro-HDMI connector on one end, and a standard HDMI connector on the other, and then a standard HDMI to DVI adapter. This seems to be the most reliable and, if I choose, I can quickly change and use my HDTV as the display. One of the challenges in choosing the components for your system is trying to anticipate how it might be used in the future.

Changing the operating system


Now that you have your system all up and working, you're going to do something that seems a bit counterintuitive; instead of using the system you've got, you're going to install a new operating system on card so your board will boot and run this different operating system. The reason will become clear in the next section.

Prepare for lift off

The default operating system on the internal memory is a version of Linux called Ångström. Now Linux, unlike Windows, Android or iOS, is not tightly controlled by a single company. It is a group effort, mostly open source, and while it is available for free, it grows and develops a bit more chaotically.

Thus a number of "distributions" have emerged, each built on a similar kernel, or core set of capabilities. These core capabilities are all based on the Linux specification. However, they are packaged slightly differently, and developed, supported, and packaged by different organizations. Ångström is one of these versions; Ubuntu is another. There are others as well, but these are the two main choices for the distribution that you will put on your card.

I choose to use the Ubuntu distribution of Linux on my BeagleBone Black for a couple of reasons. First, Ubuntu is arguably the most popular distribution of Linux, which makes it a good choice because of the community support it offers. Also, I personally like this distribution of Linux when I need to run Linux on my own personal computer. It provides a complete set of features, is well organized, and generally supports the latest sets of HW and SW. Having the same version on both my personal computer and my BeagleBone Black makes it easier for me to use both as they operate, at least to a certain degree, the same way. I can also try some things on my computer before trying them on the BeagleBone Black. I've also found that Ubuntu has excellent support for new HW, and this can be very important for your projects.

Others tend to favor the Ångström distribution, the support for this distribution is growing and it can sometimes be a bit simpler to access and work with. There are also other choices, such as Arch and there are some who are working on a distribution of Android for the BeagleBone Black. But for this book we are going to install and run a version of Ubuntu on your BeagleBone Black.

Engage thrusters

There are two approaches to getting Ubuntu onto your board. The board is getting popular enough that you can buy an SD card that already has Ubuntu installed, or you can download it onto your personal computer and then install it on the card. I'll assume you don't need any directions if you want to purchase a card—simply do an Internet search for companies selling such a product.

If you are going to download a distribution, you need to decide if you are going to use a Windows computer to download and create an SD card, or a Linux machine. I'll give brief directions for both here.

First, you'll need to download an image. This part of the process is similar for either Windows or Linux. Open a browser window. You can go to one of the several sites that have an image you can put on your card. My personal favorite is http://elinux.org/Beagleboard:Ubuntu_On_BeagleBone_Black. They keep pointers to a number of different images and directions on how to install them. My personal favorite is the 12.04 version of Ubuntu. It is new enough to support everything you need, but old enough to be stable. Select the image and download the file.

If you're using Windows, you'll need to unzip the file using an archiving program like 7-Zip. If you don't have this on your computer, follow the directions on the beaglebone.org Getting Started web page. This will leave you with a file that has the .img extension, a file that can be imaged on your card.

Now that you have the image, you need a program that can write the image to the card. I use the Image Writer for Windows program. Again, if you don't have this program, follow the directions on the beaglebone.org Getting Started web page. Plug your card into the PC, run this program, select the correct card and image, then select Write. This will take some time, but when completed eject the card from the PC.

If you are using Linux, you'll need to un-archive the file and then write it to the card. You can do this all with one command. However, you do need to find the /dev device label for your card. You can do this with the ls -la /dev/sd* command. If you run this before you plug in your card, you might see something like this:

After plugging in your card, you might see something like this:

Notice your card is at sdb. Now go to the directory where you downloaded the archived image file and issue the following command:

xz -cd ubuntu-precise-12.04.2-armhf-3.8.13-bone20.img.xz > /dev/sdX

where ubuntu-precise-12.04.2-armhf-3.8.13-bone20.img.xz will be replaced with the image file that you downloaded, and /dev/sdX will be replaced with your card ID, in this example /dev/sdb. Eject the card and you are ready to plug it into the board and boot.

Objective complete – mini debriefing

Make sure your BeagleBone Black is unplugged and install the micro SD card into the slot. Then apply power. After the boot, you should get a screen that looks like this:

You can now log in to the system. You'll need to use the username and password of the image you downloaded (unfortunately, they are not the same for all images, but you should be able to easily find these in the same place you found your image). For my distribution the default username is ubuntu and the password is also ubuntu. Note that the password will not show up while you type it in. Remember this username and password, you'll need to use it throughout the examples in this book. Entering those will bring you to this state:

You should now be logged in and ready to start issuing commands.

Classified intel

Now, two questions arise: do you need an external computer during the creation of your projects? and what sort of computer do you need? The answer to the first question is a resounding yes. Most of your projects are going to be self-contained robots with very limited communication capabilities. You will be using an external computer to issue commands and see what is going on inside your BeagleBone Black. The answer to the second is a bit more difficult. Because you are working in Linux, most notably Ubuntu on your BeagleBone Black, there are some advantages to having an Ubuntu system available as your remote system. You'll be able to try some things on your computer before trying them in your embedded system. You'll also be working with similar commands for both, which will help your learning curve.

However, bulk of the personal computers today run some sort of Windows operating system, so that is what will be normally available. You can do almost all that you need to do as far as issuing commands and displaying information with a Windows machine, so either way will work. I'll try to give examples for both, as long as it is practical.

There is one more choice, the choice I actually prefer. I have access to both systems on my PC. Previously this was done by a process called dual booting, where both systems were installed on the computer and the user chose which system they wanted to run during boot-up. Changing systems in this kind of configuration was time consuming, however, and it used up a lot of disk space. There is a better way.

On my Windows machine, I have a virtual Ubuntu machine running under a free program from Oracle called VirtualBox. This program lets me run a virtual Ubuntu machine hosted by my Windows operating system. That way I can try things in Ubuntu, yet keep all the functionality of my Windows machine. I'm not going to explain how to install this; there is plenty of help on the Web. Just search for Ubuntu and VirtualBox. There are several websites that offer easy, step-by-step instructions. One of my favorites is http://www.psychocats.net/ubuntu/.

Adding a graphical user interface


You now have your Ubuntu system up and working, and you can type in commands and see their result in the terminal window. However, you need to add some additional basic functionality before adding all the cool capabilities that will make your robots walk, talk, and interact. First, you need to connect to the Internet so that you can update your system and add additional functionality. Second, in many of your projects, you will be working with graphical programs, most notably when you connect webcams or other image sensors.

Prepare for lift off

You're going to need a graphical user interface (GUI), so let's tackle that problem.

Simply run a LAN cable from a router or switch to the BeagleBone board, plug it in the LAN connector, and restart the BeagleBone.

Now type ifconfig at the prompt. You should get a display like the following:

This tells you that you are connected to the Internet and have a valid Internet address. In this case the valid address is 157.201.194.187. This address has been assigned by your Internet router.

Tip

Generally there are two types of IP addresses that your board can be assigned: one is called static and the other dynamic. In the static case you will always be assigned the same address. In the dynamic case, the address may change each time the system boots, as it asks the system for an address, which it then uses for that session. Most systems are configured for the dynamic case; however, if your system isn't changing, you will most likely get the same address each time you power on and log in to the system. To learn more about DHCP, try http://www.teracomtraining.com/tutorials/teracom-tutorial-dynamic-IP-addresses-and-DHCP.htm.

Once you get here, you'll want to update your operating system. Type in sudo apt-get update. The system will prompt you for the [sudo] password, which is the same as the password you have already been using. Once you enter this, the system will automatically go out and find all the updates associated with the system and applications that you have installed. This may take a very long time, depending on how out-of-date your system has become.

Engage thrusters

Now that you are connected to the Internet and have updated your Ubuntu system, you need to install a graphical user interface. Ubuntu generally comes with a very full-featured windowing system. However, it uses a good deal of memory and can interfere with the performance you may need later. So you are going to install a "light" Windows system on top of your Ubuntu distribution. There are several choices; I like to use Xfce. It is stable, seems to work well, and offers a fairly complete set of capabilities while not overwhelming your system resources. To install this, type sudo apt-get install xfce4 in the command prompt. Again, the system will prompt you for your password and then start the install. This install will take a significant amount of time as it is installing not only the windowing system, but a number of packages the windowing system depends on.

Just a brief note about installing SW. You will be using apt-get to install SW throughout this book. This is the command that Ubuntu uses to go out and find SW and then install it on your machine. The nice thing about this is that it will also normally search and find dependencies and download them as well. Thus not only the package you want, but the packages that are needed for that package are installed as well. However, a bit of caution: this is not fool-proof! You will find times when the SW you have installed will not function because of a dependency that the system does not know about.

Objective complete – mini debriefing

Once the Xfce Windows system is installed, reboot your system by typing sudo reboot. The system will go down and then should come back to the log-in screen. Log in, then type startx at the prompt. After some time the Windows system will come alive. The first time you run the system you will get Welcome to the first start of the panel and a prompt, which will ask you which setup you want for the first setup. Choose the User default config selection.

Then you will see the following screen:

If you see the mouse, then you are successful!

Classified intel

You're probably asking yourself why you didn't copy your image to the internal eMMC memory card instead of just leaving your card in the system. There are two reasons, really. The first is space. The 2 GB that are available in the eMMC is not sufficient to build many, if not most, of the projects you're going to be working on, so you'll need a card anyway. Second, you will find occasions where you want to start over from scratch. Using a card makes this very easy; the eMMC process is a bit more permanent. There are several sites that can show you how to create your Ubuntu system on the eMMC internal memory space, but I'm not going to cover that here. Unfortunately, there are some downsides to not using the eMMC internal memory space, the system will boot slower and you have the additional cost of the external card, but in the long run it will be worth it.

Accessing the board remotely


You now have a very usable Ubuntu computer system. You can use it to access the Internet, write riveting novels, balance your accounts—just about anything you could do with a standard personal computer. However, that is not your purpose; you want to use your embedded system to power your delightfully inventive projects. In most cases you won't want to connect a keyboard, mouse, and display to your projects, as you will want to keep your robot sizes small and maneuverable. However, you still need to communicate with your device, program it, and have it tell you what is going on when things don't work right. You'll spend some time on this task establishing remote access to your device.

Prepare for lift off

To complete this task you'll need to have your external PC connected to the LAN, other than that, you are ready to go.

Engage thrusters

There are three ways you are going to access your system from your external PC:

  • The first is through a simple terminal interface using the SSH protocol.

  • The second way is using a program called vncserver, which will allow you to open a graphical "window" on your PC that will show you what the embedded system would be displaying on its display.

  • Finally, if you are using Microsoft Windows on your remote computer, I'll show how you can transfer files via a program called WinScp, which is custom made for this purpose.

So, first, make sure your basic system is up and working. Open a terminal window and check the IP address of your unit. You're going to need this no matter how you want to communicate with the system. You do this by issuing the ifconfig command. You should get something that looks like this:

You'll need that "inet address" to contact your board via the LAN connection. First, let's configure an SSH terminal from your remote computer. An SSH terminal is a Secure Shell Hypterminal connection, which simply means you'll be able to access your board and type in commands at the prompt, just like you have done without the Windows system. In order to do this, you need to have an SSH type application on your remote computer. If you are running Microsoft Windows, you can download such an application. My personal favorite is PuTTY. It is free and does a very good job of allowing you to save your configuration so that you don't have to type it in each time. Type putty in a search window, and you'll soon come to a page that supports a download, or you can go to www.putty.org.

Download PuTTY to your Microsoft Windows machine. Then run PuTTY by going to the directory where it has been placed and double-clicking on the file putty.exe. You should see a configuration window. It will look something like this:

Type the inet address from the previous page in the Host Name space and make sure the SSH selection is highlighted. I save this configuration under BeagleBone so that I can load it each time.

When you press Open, the system will try to open a terminal window onto your BeagleBone Black via the LAN connection. The first time you do this, you will get a warning about an RSA key, as the two computers don't "know" about each other, so Windows is complaining that a computer that it doesn't know is about to be connected in a fairly intimate way. Simply select OK, and you should get a terminal with a login prompt.

Now you can log in and issue commands to your BeagleBone Black. If you'd like to do this from a Linux machine, the process is even simpler. Bring up a terminal window and then type ssh ubuntu@157.201.194.187 –p 22. This will then bring you to the login screen of your BeagleBone Black, which should look similar to the preceding screenshot.

SSH is a really useful tool to communicate with your BeagleBone Black, and I use it extensively. However, sometimes you need a graphical look at your system, and you don't necessarily want to connect a monitor or a small LCD display. You can get this by using an application called vncserver. First, let's install a version of this on your BeagleBone Black by typing sudo apt-get install tightvncserver in a terminal window on your BeagleBone Black. This is a perfect opportunity to use SSH, by the way.

Tightvncserver is an application that will allow you to remotely view your complete windows system. Once you have it installed, you'll need to start the server by typing vncserver in a terminal window on the BeagleBone black. You will then be prompted for a password as shown in the following screenshot:

This can, and should be a different password than your password to access your BeagleBone Black. This will be the password your remote system will send to access the vncserver running on the board. Select a password—you don't need to set the password for the view only capability—and then your vncserver will be running.

You'll need a VNC viewer application for your remote computer. On my Windows system I use an application called Real VNC. When I start it up it gives me the following screen:

Enter the VNC Server address, which is the IP address of your BeagleBone Black, with a :1 after it, and select Connect. You will get this pop up:

Type in the password you just entered while starting the vncserver, and you should then get a graphics view of your BeagleBone Black. Hopefully that looks like this:

You can now access all the capabilities of your system, albeit they may be slower if you are doing graphics-intensive data transfers. You'll see this as you work through your projects.

There are ways to make your vncserver on your BeagleBone Black start automatically on boot. I have not used them; I choose to type the command vncserver from an SSH application when I want the application running. This keeps your running applications to a minimum and, more importantly, provides for fewer security risks. If you'd like to start your vncserver each time you boot, there are several places on the Internet that will show you how to configure this. Try http://www.havetheknowhow.com/Configure-the-server/Run-VNC-on-boot.html. You will only have to type the password the very first time you start vncserver—it will remember it after that. You also do not need to start Xfce using the startx command on your BeagleBone Black for it to come up in the VNC viewer to start its view onto the graphical interface.

Tip

Vncserver is also available via Linux.

The final piece of SW I like to use with my Windows system is a free application called WinSCP. To download and install this piece of SW, simply search the web for WinSCP and follow the instructions. Once installed, run the program. It will open the following dialogue box:

Select New, and you will get the following screen:

Here you fill in the IP address in the host name, ubuntu in the user name, and the BeagleBone Black password (not the vncserver password) in the password space. Press log-in and you should then see the application displayed:

Now you can drag-and-drop files from one system to the other.

Objective complete – mini debriefing

Once you've completed this step, you can now access your system fully remotely without connecting a display, keyboard, and mouse. Now your system will look like this:

You only need to connect the power and LAN. If you need to issue simple commands, you'll connect via SSH. If you need a more complete set of graphical functionality, you can access this via vncserver. Finally, if you are using a Windows system and want to transfer files back and forth, you have access to WinScp. Now you have the toolkit you need to build your first capabilities.

Classified intel

One of the challenges of accessing the system remotely is that you need to know the IP address of your board. If you have the board connected to a keyboard and display, you can always just run ifconfig to get this info. But you're going to use the board in many applications where you don't have this information. There is a way to discover this by using an ipscanner application. There are several available for free; simply download and use as they instruct. They can let you know what addresses are being used, and this should then let you find your BeagleBone Black address without typing ipconfig. From Linux you can use an application called nmap.

Mission accomplished


Congratulations! You've completed the first stage of your journey. You have your BeagleBone Black up and working. No gathering dust in the bin for this piece of HW. It is now ready to start connecting to all sorts of interesting devices in all sorts of interesting ways. One thing that is important to note: the system is not going to be nearly as stable as your PC or Mac. The HW and SW is new, and you're going to find yourselves coming back to this project from time to time to revive your board when it dies, because your SW has put it in some unrecoverable state.

Generally it is difficult to physically harm the board as long as you are only using the USB interface, so be brave, and remember, you often learn more from your failures than your successes.

A challenge


Your system has lots of capabilities. Feel free to play with the system—try to get an understanding of what is already there and what you'll want to add from a SW perspective. One advanced possibility is to connect the BeagleBone Black via a wireless LAN connection, so that you don't have to connect a HW connection when you want to communicate with it. There are several good tutorials on the Internet. Here is a place to start, http://elinux.org/Beagleboard:BeagleBoneBlack. If you have the desire, feel free to follow them to see if you can get a wireless LAN connection working.

Remember, there is limited power on your USB port, so make sure you have a powered USB hub before having a go. Usually you'll need a powered USB hub that can supply power greater than 1 amp.

Left arrow icon Right arrow icon

Key benefits

  • Get to grips with robotic systems.
  • Communicate with your robot and teach it to detect and respond to its environment.
  • Develop walking, rolling, swimming, and flying robots.

Description

Thanks to new, inexpensive microcontrollers, robotics has become far more accessible than it was in the past. These microcontrollers provide a whole new set of capabilities to allow even the most inexperienced users to make amazingly complicated projects. Beaglebone is effectively a small, light, cheap computer in a similar vein to Raspberry Pi and Arduino. It has all of the extensibility of today's desktop machines, but without the bulk, expense, or noise. This project guide provides step-by-step instructions to allow anyone to use this new, low cost platform in some fascinating robotics projects. By the time you are finished, your projects will be able to see, speak, listen, detect their surroundings, and move in a variety of amazing ways. The book begins with unpacking and powering up the components.This will include guidance on what to purchase and how to connect it all successfully–and a primer on programming the BeagleBone Black. Chapter by chapter, we will add additional software functionality available from the open source community, including how to make the system see using a webcam, how to hear using a microphone, and how to speak using a speaker. We then add hardware to make your robots move–including wheeled and legged examples–as well as covering how to add sonar sensors to avoid or find objects, plus wireless control to make your robot truly autonomous. Adding GPS allows the robot to find itself. Finally the book covers how to integrate all of this functionality so that it can all work together, before developing the most impressive robotics projects: those that can sail, fly, and explore underwater.

Who is this book for?

This book is for anyone who is curious about using new, low-cost hardware to create robotic projects that have previously been the domain of research labs, major universities or Defence departments. Some programming experience would be useful, but if you know how to use a personal computer, you can use this book to construct far more complex systems than you would have thought possible.

What you will learn

  • Unbox, power up, and configure the BeagleBone black with Ubuntu.
  • Install speech recognition software to issue voice commands to your projects.
  • Set up a webcam and a computer vision toolkit for distinguishing objects.
  • Communicate with external motors to enable you robotics projects to move in a variety of ways.
  • Process audio signals like music or other sounds.
  • Add GPS capability to your system so it will know where it is.
  • Use the building blocks you have learned to create complex robotic projects that can combine all of these features and more.

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Dec 26, 2013
Length: 244 pages
Edition : 1st
Language : English
ISBN-13 : 9781783559336
Category :
Tools :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Dec 26, 2013
Length: 244 pages
Edition : 1st
Language : English
ISBN-13 : 9781783559336
Category :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 99.97
Building a Home Security System with BeagleBone
€24.99
BeagleBone Robotic Projects
€37.99
Mastering Beaglebone Robotics
€36.99
Total 99.97 Stars icon
Banner background image

Table of Contents

11 Chapters
Getting Started with the BeagleBone Black Chevron down icon Chevron up icon
Programming the BeagleBone Black Chevron down icon Chevron up icon
Providing Speech Input and Output Chevron down icon Chevron up icon
Allowing the BeagleBone Black to See Chevron down icon Chevron up icon
Making the Unit Mobile – Controlling Wheeled Movement Chevron down icon Chevron up icon
Making the Unit Very Mobile – Controlling Legged Movement Chevron down icon Chevron up icon
Avoiding Obstacles Using Sensors Chevron down icon Chevron up icon
Going Truly Mobile – Remote Control of Your Robot Chevron down icon Chevron up icon
Using a GPS Receiver to Locate Your Robot Chevron down icon Chevron up icon
System Dynamics Chevron down icon Chevron up icon
By Land, Sea, and Air Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
(13 Ratings)
5 star 38.5%
4 star 30.8%
3 star 23.1%
2 star 7.7%
1 star 0%
Filter icon Filter
Top Reviews

Filter reviews by




Tom Hall Jan 26, 2014
Full star icon Full star icon Full star icon Full star icon Full star icon 5
"This book is designed for the informed beginner." is a quote from the author. I think it pretty accurately describes where I am with the Beaglebone Black. Actually, it is not too far from where I am with Linux as well.The book title suggests that it is for those who have an interest in robotics. I didn't have any interest in robotics when I started, but I do now. I just ordered a Sparkfun 2 wheeled robot platform and a couple of Pololu motor controllers with the intend of building a few of the projects that i didn't have the parts for.The Beaglebone Black can be frustrating - an Arduino clone it is not. But, it is a complete Linux 1Ghz computer with a lot of I/O. The default Angstrom distribution is not as close to being as stable as the Debian Wheezy distruibution supplied with the Raspberry Pi. (As of the time of this review the BBB is likely to get a default Debian distribution very soon.) Mr. Grimmett overcomes this by having you load an Ubuntu distribution on a sd card and boot from it instead. I used a 16GB card and have room to spare after reading the instructions on how to reclaim the unused space on page 89.I liked this book. It was almost a perfect fit for me. I knew the BBB could do lots of things but never really had any luck with some of the online tutorials that I tried. Because of the book I got my USB camera to work, showing video via OpenCV. With one of those cheapie USB sound cards and a Logitech headset I was able to record and play sounds via the ALSA library. I even tried a little speech recognition. This book is very good at showcasing the BBB's built in capabilities and actually getting them to work. If you are really interested, Mr. Grimmett will also show you how you can operate your Beaglebone Black by land, by air or by sea(above and beneath).The book covers programming with Python but is by no means a tutorial on the subject. That statement is pretty much true for robotics as well. Most of the robotics are made of simple to use USB type controllers for motors and servos and other sensors. Simple to use doesn't mean cheap! There is no doubt other ways of skinning this cat but I believe the author would have caused himself no end of grief by trying to describe a cheaper, more "solder it yourself" type of construction. To be honest, I had no idea you could build a robot by plugging in a bunch of controllers into a powered USB hub.So, should you buy this book? Well, if you're an "informed beginner", by all means. I found it a lot of fun - not only getting my Beaglebone Black to do something but giving me more much needed confidence with Linux. I am also looking forward to the day my robot parts arrive. There is a lot to get from this book.
Amazon Verified review Amazon
Mbelalco Dec 31, 2014
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Good
Amazon Verified review Amazon
Joseph G Hafner May 03, 2014
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Most robotics books stop at the point of hooking up sensors and servos on a wheeled platform, and demonstrate obstacle avoidance. With power of the BeagleBone Black available, this book starts with teaching your platform to speak, hear, and see, then become mobile. Then we explore multiple types of platforms including aerial and waterborne. What fun! Very nicely done.
Amazon Verified review Amazon
CNC guy Feb 03, 2014
Full star icon Full star icon Full star icon Full star icon Full star icon 5
First ImpressionsDisclaimer: I recognized the author of this book as a frequent participant in the BeagleBoard mailing list. Packt Publishing provided me with a copy of this book so that I could do this book review.I liked this book almost immediately. The mission oriented chapter organization is good. Explanations are clear and concise. Good references are given for most topics if you want to get more in depth than what is covered in the book.What the book coversThe book is organized in 11 chapters. The first chapter has a nice getting started with the BeagleBone Black (BBB). Chapter 2 briefly covers programming the BBB in Python with an even shorter intro to C++. In the third chapter things start to get good with an introduction to adding speech and speech recognition to the BBB.The fourth chapter tells you how to connect a USB camera to the BBB. It also covers using the OpenCV framework for pattern recognition and object tracking. Chapters 5 and 6 let you take your BBB mobile by adding wheels, tracks, and legs.Chapter 7 covers adding sensors to keep your robots out of trouble. The eighth chapter concerns remote control of your robots. Chapter 9 is about letting your BBB find itself with GPS guidance.Chapter 10 tries to bring all the pieces together with a discussion of system dynamics. The final chapter discusses air and water vehicles for those not content to stay on the ground.My favorite partsI liked seeing the use of a full editor, emacs in the opening chapter. It seems that everyone is using a light editor like nano for books and presentations. This book covers many aspects that must be considered in any real world robotics project. For some reason, I thought the sailboat presented in the last chapter was particularly neat. It is also good to see people really making use of the BBB hardware and not just blinking LEDs.The part I'm on the fence aboutThe book uses USB devices exclusively. On the one hand, this allows you to easily connect devices without doing any real wiring. It also allows you to focus on the functionality and less on the interface. On the other hand, this requires the use of a powered USB hub. The BBB has 92 pins on its expansion headers. It seems a shame to let all this I/O go to waste while funneling all the traffic through USB.My wish listAs I said, I really liked this book. There are two things I would have liked to see in this book. While the exclusive use of USB devices is probably OK for the book. It would have been nice to have some coverage of using the BBB expansion headers as well. This would help readers who want to take things to the next level after reading the book.My second item would be a complete robot project. I realize this is a tall order. All the pieces you need to build a robot are in the book. A complete robot might encourage readers to actually build something instead of just reading about it.[...]
Amazon Verified review Amazon
DS Jan 27, 2014
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Truly a gem for anyone interested in robotics projects using BeagleBone. This book has saved me uncountable hours of research into common challenges for robotics projects using this SBC. I highly recommend it.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.