One thing which is very useful on embedded systems is to setup a zeroconf hostname so that you can access your BBB using SSH without actually knowing its IP address which may change from boot to boot. So how does this work?
- Install avahi-daemon on BBB:
$ sudo apt-get install avahi-daemon
After installing it, Ubuntu automatically starts it and enables it so that it gets launched on every boot.
- Change the hostname of BBB (default was arm for this Ubuntu image) to something meaningful like beaglebone by editing the file /etc/hostname. You can now reboot your BBB and it will be accessible on the network as beaglebone.local!
- Make sure you have nss-mdns installed on your host computer and mdns host lookup is enabled in /etc/nsswitch.conf. On Fedora, you have to install the package called nss-mdns from the repositories and change the hosts line in your /etc/nsswitch.conf file to look like below:
hosts: files myhostname mdns_minimal [NOTFOUND=return] dns
Now you should finally be able to ssh into your BBB with:
$ ssh email@example.com
I have been playing with the BeagleBone Black (BBB) for a week and I am quite happy but I noticed that the preloaded Angstrom distribution has some major limitations/issues for me:
- The package management tool opkg is constantly failing to fetch package updates
- SciPy, BLAS, ATLAS does not exist in Angstrom repositories. If you intend to build them manually from sources, you’ll see that you need a fortran compiler which is unfortunately not provided by Angstrom.
- Many tools are actually busybox binaries which are kinda stripped.
- git was sometimes failing to clone github repositories because of some SSL errors.
- pip was sometimes stalling while download Python packages because of some SSL errors/timeouts.
- No man pages.
- and so on…
So I decided to switch to Ubuntu 13.10. The bad news is that the installer scripts that are around are not currently supporting to directly flash the onboard eMMC from your host computer. So I bought a Toshiba Class 10 8GB microSD card to install Ubuntu separately on the microSD card. Here are the steps:
- Put your microSD card in microSD-SD adapter if your computer does not have a microSD reader. Plug the adapter to your computer directly or using some SD-USB adapter
- Download the latest 13.10 saucy rootfs from Robert C. Nelson’s website: https://rcn-ee.net/deb/rootfs/saucy/
- Unpack the tarball and cd into it:
$ tar xvf ubuntu-13.10-console-armhf-2013-11-09.tar.xz./ubuntu-13.10-console-armhf-2013-11-09/
$ cd ubuntu-13.10-console-armhf-2013-11-09
- Now you have to find out the device name for the microSD card. There is a script in the folder called setup_sdcard.sh, launch it using –probe-mmc parameter. Since I don’t remember the exact output of the command, I replaced the bytes and sectors with dots, but the point is that you have to determine which one of the storages correspond to your microSD card from the list:
$ sudo ./setup_sdcard.sh --probe-mmc
Are you sure? I Don't see [/dev/idontknow], here is what I do see...
Disk /dev/sda: 500.1 GB, 500107862016 bytes, 976773168 sectors
Disk /dev/sdb: 7,9 GB, .... bytes, .... sectors
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 465,8G 0 disk
├─sda1 8:1 0 156,9M 0 part
├─sda2 8:2 0 750M 0 part
└─sda3 8:3 0 464,9G 0 part
sdb 8:16 0 7,9G 0 disk
├─sdb1 8:17 0 7,8G 0 part
- Since I don’t have any storage with ~8GB capacity apart from the microSD, I understand that the card is assigned the block device sdb. Since the card was formatted, it also had a primary partition sdb1 but we don’t care about it. The point is that our microSD can be accessed using the device node /dev/sdb.
- Now we’re really running the script to prepare the microSD card. Note that if your host distribution don’t have the necessary tools installed (like git, uboot-tools, dosfstools, etc.) the script will quit and tell you how/what to install the missing packages:
$ sudo ./setup_sdcard.sh --mmc /dev/sdb --uboot bone
- The above script will take some time to complete. (Note that the –uboot parameter defines the target board. You can run setup_sdcard.sh with –help to see other options and parameters.)
After the script terminates, you can unplug your microSD card, insert it to your BBB and power on the device to boot into Ubuntu! (As far as I understand, if microSD card is bootable, the bootloader gives priority to it and you end up with Ubuntu running without any other intervention.)
If you power the BBB using the USB client port, you can ssh into BBB using the local ethernet interface which has the IP 192.168.7.2 assigned to it (I am not sure if this is a static/permanent assignment).
The default username@password for the image is: ubuntu@temppwd