Saturday, September 17, 2011

Milo Bot, Installing Angstrom

Note: I'm running all these commands and setting up the beagleboard on ubuntu 11.04 and I'm using the Beagleboard-xM


Step 1: Creating the Angstrom image

Angstrom provides a web interface for generating sdcard images.
http://narcissus.angstrom-distribution.org/

Base Settings:
- In the drop down for what machine we are building for, pick beagleboard.
- You can chose whatever you want for the image name but for the purposes of this tutorial I picked angstrom.
- Keep the complexity drop down at simple.

User environment selection:
To make things simple later on I selected X11, but if your only going to be interfacing with this through the serial cable then console will work fine.

X11 Desktop Environments:
- If you selected console in the option above this menu will not appear.
- For my project I selected GNOME, you can chose another flavor if you like but I will not cover the other environments.

Additional packages selection:
- Additional X11 packages

  • Firefox
  • GNOME Applications
  • GNOME Display Manger
  • GNOME gedit
  • X11 Control Tool(xdotool)

- Development packages

  • Toolchain
  • Native SDK
  • OpenCV headers and libs

- Additional console packages

  • All kernel modules
  • OpenCV
  • VIM

- Network related packages

  • Dropbear SSH server
  • Wireless-tools

- Java packages

  • None

- Platform specific packages

  • Bootloader Files (x-load/u-boot/scripts)
  • OMAP Display Sub System (DSS) Documentation


After all that is selected click Build me! And download the generated image to your ~/angstrom directory.



Step 2: Formatting the SDCard

Finding the location of the SDCard
First, we need to find out where your SDCard is mounted. Plug in a SDCard into your computer wait for it to mount. Then run the following command:
df -h

You will see something like this:
/dev/sda5            45G   3.0G   39G   8% / 
none                  1.5G  316K  1.5G   1% /dev 
none                  1.5G  724K  1.5G   1% /dev/shm 
none                  1.5G  336K  1.5G   1% /var/run 
none                  1.5G     0     1.5G   0% /var/lock 
/dev/sdb1            7.4G  17M   7.0G   1% /media/f91d45eb-67b2-4eeec-85fa-425299b232a1 

Look for a line that starts with /dev/sdXX in it; generally it will be mounted to the /media directory (on Ubuntu anyway). Make sure the size of the sd-card is right to verify. My SDCard is /dev/sdb. [/dev/sdb1 is the first partition of the /dev/sdb drive]. You will need that device directory later on.

Setting up the SDCard
Angstrom requires two partitions on the SDCard, a small boot partition, and the main ext3 partition to hold Angstrom. Thanks to Graeme Gregory there is a nice script to setup the SDCard. Remember that we made a folder in your home directory called angstrom. Execute the following commands, they will go to the angstrom directory, download Graeme's script and execute it. Make sure to substitue your SDCard device directory (from above) for /dev/sdX below.
cd ~/angstrom
wget http://cgit.openembedded.org/cgit.cgi/openembedded/plain/contrib/angstrom/omap3-mkcard.sh
chmod +x omap3-mkcard.sh
sudo ./omap3-mkcard.sh /dev/sdX 
sync

Remove the SDCard, wait two/three seconds, then plug it back in. Wait a few seconds for the SDCard to mount. To make sure it is properly formatted rerun the command:
df -h

Now you should have two new partitions:
/dev/sda5              45G  3.0G   39G   8% / 
none                  1.5G  316K  1.5G   1% /dev 
none                  1.5G  724K  1.5G   1% /dev/shm 
none                  1.5G  336K  1.5G   1% /var/run 
none                  1.5G     0  1.5G   0% /var/lock 
/dev/sdb1              70M   512   70M   1% /media/boot
/dev/sdb2             7.3G  145M  6.8G   3% /media/Angstrom

Loading files onto the partitions
There are only three files that are manditory for the boot partition. The following list of commands will extract the files from the download build and copy those to the boot partition on the SDCard.

tar --wildcards -zxvf angstrom-image-beagleboard.tar.gz ./boot/*
sudo cp boot/MLO-* /media/boot/MLO
sudo cp boot/uImage-* /media/boot/uImage
sudo cp boot/u-boot-beagleboard-* /media/boot/u-boot.bin

Load the root filesystem onto the Angstrom partition.
sudo tar -zxv -C /media/Angstrom -f angstrom-image-beagleboard.tar.gz
sync

Safely remove the SDCard by running these commands.
sync
umount /media/boot
umount /media/Angstrom

Step 3: Testing the SDCard
Insert the SDCard you just made into the Beagleboard and hookup the serial to usb adapter between the Beagleboard and the computer. Then apply power using the AC adaptor. From there we connect to the serial port using the following command.
screen /dev/ttyUSB0 115200

Then reset the board and if you get alot of output and then prompted with a login then Angstrom is up and running.

Milo Bot, Obtaining Hardware

This section is about the hardware I am using and how I obtained it.

Beagleboard-xM
https://specialcomp.com/beagleboard/xm.htm
Special computing had the best deal and included all the cabling nessisary to set it up.
Off their site I selected the following options:

  • Beagleboard xM Rev C Assembled in Acrylic Case
  • 8GB Micro SDHC Card
    • The beagle board does come with a 4gb microSD preloaded with Angstrom
  • USB MicroSD Reader
  • USB to DB9M RS-232 Cable
  • AC Power Adapter, 5VDC@2.5A 5.5mm Plug
  • HDMI Male to DVI-D Male Cable


Ardunio
http://www.sparkfun.com/products/9950

Ping Ultrasonic Sensor
http://www.parallax.com/tabid/768/ProductID/92/Default.aspx

WiFi Adapter, Alfa AWUS036H
http://www.amazon.com/Alfa-AWUS036H-802-11b-Wireless-network/dp/B002WCEWU8


Logitech Quickcam Pro 9000
http://www.amazon.com/Logitech-720p-Webcam-Pro-9000/dp/B002M78ECK

Motor Controller
NULL

Robotic Base
NULL

Milo Bot, Introduction

Idea: Make a robot base that is portable and powerful with a camera and ability for roborelm or openCV.


Parts List:
  • 1 beagleboard
  • 1 robotic base(havent picked one yet)
  • 1 arduino
  • 1 motor controller
  • 1 logitech quickcam pro 9000
  • 1 ultrasonic sensor
  • 1 usb wifi adapter

Thursday, September 15, 2011

Milo Bot, Fixing Screen Resolution

fix uboot
rebuild image

http://www.angstrom-distribution.org/building-angstrom


git clone git://git.angstrom-distribution.org/setup-scripts

MACHINE=beagleboard ./oebb.sh config beagleboard MACHINE=beagleboard ./oebb.sh update MACHINE=beagleboard ./oebb.sh bitbake virtual/kernel
sudo apt-get install texti2html cvs gawk chrpath texinfo subversion



By default the screen resilution is 640 by 480

connected via serial  it will ask to stop auto boot hit any key to stop

then type in the following:

setenv bootargs omapfb.mode=dvi:1280x720MR-16@60
saveenv

> setenv bootargs console=ttyS2,115200 root=/dev/mmcblk0p2 rw rootwait omapfb.mode=tv:1024x768MR-16@60 omapdss.def_disp=tv

running vnc 

x11vnc -display :0 &


Wednesday, September 14, 2011

Milo Bot, Fixing dynamic MAC adress

Note this is just a outline not final instructions


Patch file:
http://www.mediafire.com/?av2d278b6pdm4h2
http://www.electronsonradio.com/downloads/kernel-2.6.32-cli-mac-address.patch

copy to /media/Angstrom/usr/src/linux-2.6.32/

on beagleboard
cd /usr/src/linux-2.6.32
patch -p1 < smsc95xx-generate-random-MAC-address-once-not-every-ifup.patch

ifconfig usb0 down
ifconfig usb0 hw ether 00:11:22:33:44:55 up