Getting Started with the Beagle Bone

Intro

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

Connection

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.

  1. 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.

  2. You can avoid the problem by prefixing all commands that access the BeagleBone with ‘sudo’.
  3. 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.

Terminal Access

Screen

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

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:

 minicom beagleserial

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:

U-Boot#

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:

root@beaglebone:~#

Web Access

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>/js_term.html – A JavaScript Shell
  • http://<bbone_address>/shell.html – A Bash Shell

 

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.

One Comment

  1. Paul Boulay February 20, 2015 2:02 am / Reply

    Dude,
    Saw the interview on the Tormach channel. Good stuff.
    But your catchpa is soo freakin’ hard!!
    You must get almost no mail.
    Regards,
    Paul

Post a Comment

Your email address will not be published. Required fields are marked *

*

Please type the characters of this captcha image in the input box

Please type the characters of this captcha image in the input box