BeagleBone Black Setup: the lost packages

I have recently had the pleasure of playing around with the BeagleBone Black (aka BBB) from Texas Instruments. As I have been playing around with mine I have come across numerous tips and tricks that make everything better. What follows is my attempt at collating them all together in one place, for both my benefit and yours.

First off though I would like to say that the BeagleBone Black is an awesome piece of hardware. It is essentially a fully fledged linux computer that fits in an Altoids tin. For it’s price (45$USD) it’s rather unbelievable. The biggest improvement over the previous BeagleBone is the inclusion of built in HDMI, which means no more ssh’ing in or expensive display addon’s unless you really want to. Also there is a really awesome built in web based IDE that makes programming the board a silky smooth experience. I really like mine, it has great potential, but it is severely lacking in several areas. For instance it lacks sudo by default, it also lacks an extensive repository to install by default. These are easily remedied though, as are most issue’s I’ve had with the board. Below you can find brief synopsis of the most common fixes and links to the source text.

Update OS image (Mac / Linux)

The first thing to do is update the operating system image on your BBB’s internal memory. This involves downloading the latest img.xz, extracting it a microSD card, and then flashing it to the internal EMMC on the BBB. The process for windows is documented on the Getting Started Page, but the process for Mac / Linux is woefully neglected. Thankfully nunoalves.com has a wonderful writeup for mac which also applies to Linux. (use xz to write image to SD card)

Load latest image onto the beagle bone using Mac / Linux (http://www.nunoalves.com/open_source/?p=90) or Windows (detailed on Getting Started Page)

Update Clock Time (abstracted from here)

Setting the date on your BBB is important, if the time is not set correctly you get package mismatches when you try to install, and then all hell breaks loose. To check your time use the date command. (i.e. type date into the command line). If you get back something that resembles the current date you’re good to go. If the date is no where near correct then you will need to use the following commands to install ntpd (network time protocol daemon).

//Install the package

$ opkg install ntp ntpdate

//Optional: set your time zone

//Stop the package

$ systemctl stop ntpd

//Run manual Update

$ ntpdate pool.ntp.org

//Restart the package

$ systemctl start ntpd

Missing Packages (abstracted from here)

Lets face it, the Angstrom image the BBB ships with is missing some tools, like sudo and subversion. If you’ve tried using ‘opkg install sudo’ it returns an error. This is because it doesn’t have a reference to a repository that contains sudo. To fix this add the armv7a branch to opkg via the following commands:

$ echo ‘src/gz angstrom-base http://www.angstrom-distribution.org/feeds/unstable/ipk/glibc/armv7a/base’ > /etc/opkg/angstrom-base.conf

$ opkg update

After these commands have been run you can use opkg to install a whole lot of packages that are missing. I suggest installing sudo at a bare minimum.

How to add users to sudo (abstracted from here)

So now you have sudo installed, great, but it doesnt work. Thats because you have to add users to the sudo list. This can be done either at the time you create a user by adding them to the sudo group, or by editing the sudoer’s file via ‘sudo visudo’.

To create a new user account and add them to the sudo list:

new user: $sudo adduser username sudo

To add existing users:

$sudo visudo

Now vim is open, you need to add the following line to the file (The editor is vim, press ‘i’ to enter insert text mode so you can add text like a normal editor, when done press ‘esc’ to exit to command mode, then type ‘:wq’ to use the command, write, quit. this should return you to the command line)

username ALL=(ALL) ALL

Other things you may want to do: (Go here for full HowTo)

-add sudo user

-disable root default login : I would highly recommend doing this!

-creating user

-connecting from windows

-Changing host name

-Using Static IP address

-Windows File Share

How to run something at Startup (abstracted from here)

So now you have everything up and running, awesome, but you want to trigger something to happen at startup, like say run a script that pings home or updates a dynamic IP or gives you a random quote from the internet. You do this by creating a new .service file in /lib/systemd/system/name.service . This file will then be run at startup.

How to remove something from Startup

Now that you have something running at startup you may want to disable it.

To turn it off you simply call the following (it will run at next restart if nothing else is done):

$ systemctl stop unwanted.service

To disable it at startup you must call the following after turning the service off:

$ systemctl disable unwanted.service

How to Access your Beagle Bone Black from anywhere in the world

I thought it would be cool to be able to access my BBB from work, from school, on the road, or really just anywhere I happen to be. To do this I need to know its IP address at any given time. The problem is I have a residential internet connection; which means my IP changes every so often with no warning. So I need a way to figure out my IP every so often and then keep a reference updated somewhere. Thankfully there already exists a service to do this, it is called Dynamic IP.

There are a number of companies that offer Dynamic IP, some charge, some don’t. I chose to use no-ip.org because they give you a free account that is limited to 5 addresses at no-ip.org. So while it doesn’t look pretty it is easy to remember, effective, and most importantly free (also, if you choose to expand later on they make it dead simple to do so). The gist of the install process is you register with no-ip.org, download the ‘dynamic update client’ from no-ip.org, add it to the list of items to run at startup (should be done automatically), login with your no-ip credentials, and set it off to do it’s thing. It will redirect any requests from the address you choose to your beagle bone. I for example have a git server, a ssh server, and a web server running on my beagle bone. They are exposed to the internet via the DMZ on my router and pointed to by three seperate addresses at no-ip.org. (ie gitServer.no-ip.org, sshServer.no-ip.org, and webServer.no-ip.org) It requires some configuration, but for the most part can be figured out using the documentation on the no-ip website at http://www.noip.com/support/knowledgebase/installing-the-linux-dynamic-update-client/

 

One Comment