Getting Started with the Beagle Bone
This article covers getting up and running with the BeagleBone on a Linux box. The specifics will be from Ubuntu 12.04 LTS, though these instructions should work on any modern distribution.
What this article will talk about:
- Physical Connection
- Device nodes (/dev/) used by the BeagleBone
- Getting access to a terminal
- Using Screen
- Using Minicom
- Web Access
Getting Started with the BeagleBone is relatively straightforward. Just attach the USB mini-B cable to a port on a _powered USB hub_ connected to your computer and you’re set to go. (A powered hub is contrasted with an unpowered hub or a direct connection to the computer, where the ‘Bone might not be able to source enough current to work.)
By default the BeagleBone will enumerate itself at /dev/ttyUSB0 and /dev/ttyUSB1 (more precisely: the next two availalbe USB ttys will be used. Check to see if there are any /dev/ttyUSB* nodes before you plug in the BeagleBone. If there are, you’ll just need to adjust the instructions here by adding.) The lower numbered port (ttyUSB0) is usually the programming port. You can ignore this one for now, we’ll come back to it in more advanced tutorials. The higher numbered port (ttyUSB1) has an actual serial terminal on it that we can use to communicate with the board.
Before we can communicate with the board the permissions on the device nodes have to be set correctly or we won’t be able to get a connection. There are a few ways to do this.
- The fastest way is to run:
sudo chmod 777 /dev/ttyUSB0 /dev/ttyUSB1
This isn’t very safe, strictly speaking, nor is it permanent. The change will need to be repeated every time you reboot the computer or unplug and reconnect the BeagleBone.
- You can avoid the problem by prefixing all commands that access the BeagleBone with ‘sudo’.
- You can install some udev rules that will automatically adjust the device permissions when you connect the device. You can grab a sample udev rule set plus an installation script by doing the following on your host machine:
git clone git://github.com/retrospectivelyobvious/beaglebone-basics.git cd beaglebone-basics/udev ./install-udev-rules.sh
(The script will ask for your password, as it needs privileges to install the rules)
These rules will work for recent Ubunutu systems. If you’re running another distro that uses udev, you might have to change the installation directory in the script, please consult google. Once the rules are installed, plug in the BeagleBone. In addition to the regular /dev/ttyUSB* nodes, the rules will also create /dev/beaglejtag (the programming port) and /dev/beagleserial (the serial terminal). We’ll refer to the nodes by these names through the rest of the tutorial, as they’re more consistent.
Screen is a handy terminal multiplexing program that also happens to be useful for talking to things with serial terminals. Make sure you’ve got scree installed (sudo apt-get install screen), then run:
screen /dev/beagleserial 115200
The first argument is the terminal to connect to, and the second argument is the baud rate. The default for the BeagleBone is 115200. To quit the program type: Ctrl-A (release), k (release), (a confirmation prompt will appear) y.
Minicom is a somewhat dilapidated old program designed for communicating with dial-up modems, that for some reason (unknown to me) is very popular for connecting to serial devices. It’s absolutely ill suited to this, but I’m including it here because it’s popular and some folks expect to see it. If you want to use this (you really don’t), make sure it’s installed (sudo apt-get install minicom), then copy the config files out of the beaglebone-basics git repo (see above for URI) by doing the following:
cd beaglebone-basics/minicom ./install-minicom-config
(you’ll be prompted for your password, as we need privilege to install
the configuration files)
Once the config files are installed, you can run minicom by:
Keep in mind that this requires you to have setup the udev rules mentioned earlier in the article. If you haven’t done that, you’ll need
to edit the config file (at /etc/minicom/minirc.beagleserial) so that the “pu port” directive matches whatever the serial tty for the device is.
To quit minicom type: Ctrl-A (release), q, (confirmation dialog appears) Enter
Once You’re Connected
You might see a prompt that looks like:
If so, just type ‘boot’ and press <Enter> to get the device running.
When prompted for a login, the default is
User: root Pass:
You should now have a prompt:
For web access to the device, your BeagleBone obviously has to be hooked up to a network. Once you’ve got an ethernet cable plugged in, you can poke around at some of the more interesting things setup on the BeagleBone. (For reference, I’m looking at a Revision A6, so your mileage might vary a little here.) To grab the IP address of the ‘Bone, open up the serial interface and run ‘ipconfig’. I’ll refer to the address assigned to the board as <bbone_address>, which you should be able to access from your host computer.
There’s some interesting stuff running on the default version of the BeagleBone, here’s the cliff notes version:
- http://<bbone_address>/ – A web-based slide show describing the BeagleBone project
- http://<bbone_address>:3000/ – The Cloud9 IDE
- http://<bbone_address>/shell.html – A Bash Shell
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.