Angstrom and Linux

This post is regarding some things I picked up while playing around with the Beaglebone but is not documented so clearly or easily in the Beaglebone setup. And I suggest using linux as you don’t need any drivers at all. And as I haven’t even tried playing with it in Windows, I won’t be covering it here but I believe you can use telnet or a basic serial terminal like putty.

As soon as you plug the brand-new beaglebone into the USB, it powers on and it will mount a partition on your computer as a mass storage device. This contains some pdf documentation including the datasheet and other files. It also has the documentation for the cloud9 IDE. It is a built-in IDE for the Beaglebone based on Javascript which aims to provide an interface to the Beaglebone similar to arduino. This is not yet complete. It is easy to do simple GPIO and LED blinking but in my opinion, I would much rather use the more powerful Linux backend since it’s already there and Cloud9 is merely running on the Linux backend. In any case, if you want to use Cloud9, copy the documentation to your computer and eject the mass storage device. It will then automatically configure a network interface between your PC and your board through USB and you can access cloud9 through any web browser. Just follow the documentation. The network that is automatically setup maps my computer to 192.168.7.1 and the Bone to 192.168.7.2

Note that this connection is in addition to your WiFi/Ethernet connection. I believe that it may be possible to use this interface to connect the bone to the internet through USB by using NAT but I have not yet accomplished this.

Since you now have a network interface to the Bone, that means you can ssh into it or use a serial terminal… Or both. The serial terminal is more fundamental as it shows all the boot up and shutdown process while the ssh of course doesn’t.

Before starting, I recommend that you add your user account to the linux group dialout by doing:

sudo adduser <username> dialout

or

su -c ‘adduser <username> dialout’

where <username> is replaced with your username

Log out and log back in. This allows you to run the serial terminal without having root access.

Now make sure you have screen installed by doing:

sudo apt-get install screen

or

sudo yum install screen

You can use minicom or putty but I started using screen first so it has been a force of habit. Generally, the beaglebone maps to /dev/ttyUSB0 and /dev/ttyUSB1. Just check ls /dev/ttyUSB* before and after plugging in the device.

You need to connect to the second one. Usually, it is /dev/ttyUSB1 and you need to specify the baud rate which is 115200. Connect by executing:

screen /dev/ttyUSB1 115200

If it is still booting, you will see the boot sequence. Otherwise, it will ask for the login. Login as root. There is no password so just hit enter when it asks for it. And ta da! You’re in!

Just remember that the network is only setup after you eject the USB storage device. You need to do this each time. SSH is installed and started on the beaglebone by default and you can access it either through a terminal or through nautilus, the GNOME file browser. For shell access, just ssh://root@192.168.7.2. If you want to access the folder structure, go to the location bar in the file browser (Ctrl-L for short) and type in: sftp://192.168.7.2 Enter root as username and leave the password blank.

If you want to set a root password, type is passwd after login though I don’t really see a point. If someone wanted access, they can just mount the sdcard and copy the data or put a new version of Angstrom on it.

And speaking of new versions, you can get the latest version of Angstrom from http://downloads.angstrom-distribution.org/demo/beaglebone/

They’ve given the directions to load up the new image. WARNING: It will format all existing data so take backups. You can back up the entire sdcard including the original distro by executing the following command (Assuming the sdcard is at /dev/sdb):

mkdir beaglebone

cd beaglebone

sudo dd if=/dev/sdb of=unmarked_sd

tar zcvf unmarked_sd.tar.gz

sudo rm unmarked_sd

Make sure you’re using an sdcard reader for all this backup and restore. To restore, use an SD card of the same size or larger and execute:

sudo su

tar Ozxf unmarked_sd.tar.gz | dd of=/dev/sdb

The backup and restore portion has been adapted (Which is a subtle way of saying copying 😉 from http://taylanayken.wordpress.com/2012/03/27/getting-started-with-beaglebone/

Do take a look there. He shows how to compile a new kernel for the beaglebone. Pretty cool stuff.

That’s it for now. I’ll be adding more about this as I learn more about it. Don’t forget adding yourself to the dialout group! That’s what made me write this post in the first place because of its usefulness.

Ozxf unmarked_sd.tar.gz | dd of=/dev/sdb

Advertisements

About ajaykumarkannan

I am a final year student pursuing my Bachelor's degree in Electronics and Communications Engineering at IIT Guwahati. I am currently on semester break. View all posts by ajaykumarkannan

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: