Tags:
create new tag
, view all tags

Installation of Ubuntu (Natty 11.04) on the BeagleBoard

  1. Prepare the Micro SD card: Mount the formatted micro SD card on your PC (we assume a Linux PC) and note the name of your SD device with this command (if the device does not automount). sudo fdisk -l (in our system the name of the SD cart partition is: mmcblk0)
  2. Get the Ubuntu prebuilt image: wget http://rcn-ee.net/deb/rootfs/natty/ubuntu-11.04-r3-minimal-armel.tar.xz or use the mirror: wget http://ynezz.ibawizard.net/beagleboard/natty/ubuntu-11.04-r3-minimal-armel.tar.xz
  3. Verify the image: md5sum ubuntu-11.04-r3-minimal-armel.tar.xz. The command should generate an output like this 78bcd93acb37d6b63c90f68ff0f62976 ubuntu-11.04-r3-minimal-armel.tar.xz
  4. Unpack the image: tar xJf ubuntu-11.04-r3-minimal-armel.tar.xz
  5. Go to the directory: cd ubuntu-11.04-r3-minimal-armel
  6. Install the image: sudo ./setup_sdcard.sh --mmc /dev/mmcblk0 --uboot beagle (where mmcblk0 is the name of your SD device partition). After the installation you should have a SD card with two partitions, one (boot) contains essential files for booting ( x-load, u-boot.bin, uImage, boot.scr) and the other ( rootfs) where the OS is installed.
  7. You should now be able to unmount the SD card from you PC (if it is mounted), insert into your BeagleBoard, reboot for Ubuntu Natty to start.

Communicating with BeagleBoard through the serial interface

Note: The following is optional as the Beagleboard should work as a standalone computer like a "PC" after completing the Step 7 above. All you need is a DVI monitor (connected via DVI-HDMI cable) as well as USB mouse and keyboard.

At this stage Ubuntu does not have graphic interface. We will later install the packages for the full graphical user interface. First, Internet connection and serial interface between the BeagleBoard and your PC needs to be setup. To do achive this, install minicom onto your PC:

      sudo apt-get install minicom
      sudo minicom
Make the serial connection and run minicom before booting the beagleboard. You should see the messages on the minicom screen like below

boot.png

After the booting of the kernel you need to log in: omap login: ubuntu Password: temppwd

Internet configuration:

Plug network connection on the Ethernet port of the Beagleboard. The following is an example for the IP configurations using the .252 research subnet available in WSRNLab. Internet access is required for all package updates and getting code packages off the web; both essential to Beagleboard use.

View of connections:

   $ sudo ifconfig -a

config mac and ip address:

   $ sudo ifconfig eth0 hw ether aa:14:61:7e:01:c2
   $ sudo ifconfig eth0 130.194.252.5

then:

   $ sudo dhclient eth0 -v

Complete the installation:

   $ sudo apt-get update
   $ sudo apt-get upgrade

Essentials packages

   $ sudo apt-get install xserver-xorg-video-omap3 network-manager

Graphic interface installation

If you want gnome interface

   $ sudo apt-get install xfce4 gdm xubuntu-gdm-theme xubuntu-artwork

Or if you prefer LXDE a lightweight X11 desktop Environment

   $ sudo apt-get install lxde

These operations could take long time. Reboot and you should have a graphic interface.

   $ sudo shutdown -h now

screenshot_LXDE.png

OpenCV on Beagleboard

To install it using the terminal directly on the Beagleboard (you need to plug a mouse, a keyboard and a display) or you can continue to use minicom to type the following sequence of commands. Don’t forget that after the reboot you need to do the internet configuration again.

Essentials packages

Get the essentials packages with this command:

   $ sudo apt-get install build-essential libavformat-dev ffmpeg

OpenCV 2.1 installation

   $ sudo apt-get install libcv2.1 libcvaux2.1 libhighgui2.1 opencv-doc
   $ sudo apt-get install libcv-dev libhighgui-dev libcvaux-dev

ARToolKitPlus

This following sequence of commands is to install ARToolKitPlus, a library for the tracking of markers. You need to copy the ARToolKitPLus directorie on the beagleboard. To do that, shutdown the beagleboard and insert the SD cart into your laptop. Paste theARToolkitPlus directory to rootfs/home/ubuntu/Desktop. Then reboot the beagleboard with the SD cart and type the following commands.

Unpack with this command:

$ tar -xvf ARToolKitPlus-2.2.1.tar.bz2

Then install like that:

   $ cd Desktop/ARToolKitPlus
   $ mkdir build
   $ cd build
   $ cmake ..
   $ make
   $ sudo make install

You can also get ARToolKitPlus with this command:

$ wget http://launchpad.net/artoolkitplus/trunk/2.2.1/+download/ARToolKitPlus-2.2.1.tar.bz2

Kinect Drivers

Essentials packages

Get the essentials packages with this command:

   $ sudo apt-get install cmake libglut3-dev libxmu-dev libusb-1.0-0-dev pkg-config libxi-dev

Installation

First you need to copy libfreenect directory on the Beagleboard exactly like the ARToolkitPlus directory. Then go to the libfreenect directory and copy-paste instructions to get up-and-running instantly

   $ cd Desktop/libfreenect
   $ mkdir build
   $ cd build
   $ cmake ..
   $ make
   $ sudo make install

Use as normal user

To be able to access the Kinect without sudo permission you need to add yourself to the video group and change the permission on the created device.

Create the file: /etc/udev/rules.d/66-kinect.rules

   $ sudo gedit /etc/udev/rules.d/66-kinect.rules

For the lxde interface replace gedit by leafpad

And paste that:

   #Rules for Kinect ######################################################

   SYSFS{idVendor}=="045e", SYSFS{idProduct}=="02ae", MODE="0660",GROUP="video"

   SYSFS{idVendor}=="045e", SYSFS{idProduct}=="02ad", MODE="0660",GROUP="video"

   SYSFS{idVendor}=="045e", SYSFS{idProduct}=="02b0", MODE="0660",GROUP="video"

   ### END #############################################################

Save and close

Then add yourself (in this case ubuntu) to the video group:

   $ sudo adduser ubuntu video

Now you can plug the Kinect, the led should be blink in green.

Finally you can test Kinect drivers and OpenCv libraries with the sample cvdemo:

   $ cd libfreenet/build/bin
   $ sudo ./cvdemo

RGB_view.pngDepth_view.png

Optional:

Auto Login

Run "gdmsetup" from a terminal. Unlock with the password temppwd and select “Log in as Demo User (ubuntu) automatically”.

Set a mac and ip4 address

Type on a terminal:

   $ sudo gedit /etc/network/interfaces

and paste that:

---
auto eth0_
iface eth0 inet static
hwaddress ether aa:14:61:7e:01:c2
address 130.194.252.5
netmask 255.255.255.0
gateway 130.194.252.255
---

After that you just need to type the follow command to have an internet connection when you reboot:

   $ sudo dhclient eth0 -v

Add opencv program in startup applications

Go to

System/Preference/Startup Applications

or type

gnome-session-properties in a terminal: Press Add, then Browse... and select the kinect program.

SGX Video Acceleration

For an OpenGL utilisation, install the following packages:

   $ sudo apt-get install libegl1-sgx-omap3 libgles1-sgx-omap3 libgles2-sgx-omap3

Display resolution

To change the display resolution edit or create in the boot partition a files named boot.cmd Edit the file like that:

---
echo "Debug: Demo Image Install"
setenv dvimode 800x600MR-16@60
setenv vram 12MB
setenv bootcmd 'fatload mmc 0:1 0x80300000 uImage; fatload mmc 0:1 0x81600000 uInitrd; bootm 0x80300000 0x81600000'
setenv bootargs console=ttyO1,115200n8 console=tty0 root=/dev/mmcblk0p2 rootwait ro vram=${vram} omapfb.mode=dvi:${dvimode} fixrtc buddy=${buddy} mpurate=${mpurate}
boot
---

Put your resolution after “dvimode”. After to compile you need mkimage:

   $ sudo apt-get install uboot-mkimage

Go to your boot.cmd file directory and type:

   $ mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n "Ubuntu" -d ./boot.cmd ./boot.scr

Copy "boot.scr" created to the Boot Partition


GPIO control

To control a GPIO port (for example gpio 139) you need to log you as a root.

   $ sudo -i

Then go to the gpio file

   $ cd /sys/class/gpio

Toogle the pin

   $ echo 139 > export
   $ cd gpio139
   $ echo out > direction
   $ echo 0 > value
   $ echo 1 > value

OpenCv 2.3

Download OpenCV 2.3.0

_$ wget http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.3/OpenCV-2.3.0.tar.bz2_

Unpack archive and navigate to the newly created folder containing the OpenCV source:

   $ tar -xvf OpenCV-2.3.0.tar.bz2
   $ cd OpenCV-2.3.0/

Create a new folder and navigate to it (the build files generated by CMake will go into this folder):

   $ mkdir release
   $ cd release

Edit the CMake file to enable OPENNI drivers for kinect :

Compile and install OpenCV:

   $ sudo make install
Topic attachments
I Attachment Action Size Date Who Comment
Unknown file formatbz2 ARToolKitPlus-2.2.1.tar.bz2 manage 472.5 K 2011-08-26 - 03:29 AlexandreProust  
Unknown file formatbz2 libfreenect.tar.bz2 manage 2095.7 K 2011-08-26 - 03:29 AlexandreProust  
Topic revision: r6 - 2012-02-03 - AhmetSekercioglu
 
This site is powered by the TWiki collaboration platformCopyright © 2008-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback