Pages

Sunday, January 30, 2011

Camera capture using OpenCV

I had a Logitech C120 camera lying around and found that Angstrom had drivers for it. It was about 1:00am and I couldn't wait till I captured an image.

OpenCV is a popular library for image processing. I found this post which got me started with OpenCV. But you must also install opencv-dev to get the header files or the program will not compile.

To get OpenCV:

opkg update
opkg install task-native-sdk cpp gccmakedep
opkg install python-distutils python-compile python-compiler python-devel
opkg install ffmpeg-dev
opkg install opencv
opkg install opencv-dev
My wireless connection was not very good, so I got several package download failures with "wget returned 1". I just switched to USB Ethernet and it went smooth.

Also, if you get "But that file is already provided by package xxx" errors while installing opencv-dev, just uninstall opencv and try again from step 5. I am not sure what the problem was, but it worked the second time.

Finally, around 3:00am I captured the first images. I went to bed both satisfied and eager to get back to my desk and track a ball or something!

Sunday, January 9, 2011

Development using Netbeans

Angstrom comes with DropBear SSH a lightweight SSH. But it is recommended to use OpenSSH instead.

To install openssh:
opkg -force-removal-of-dependent-packages remove dropbear
opkg install openssh openssh-sftp-server
Tim Pitman has a neat article that explains how to setup Netbeans for remote development on a MAC.

To share the rootfs on Windows:
  1. Configure samba (/etc/samba/smb.conf) to allow access to the rootfs. You can do this by adding the following in the "Share Definitions" section.
    [public]
    path = /
    public = yes
    writable = yes
    printable = no

  2. Map \\BEAGLEBOARD\public as a network drive in Windows.

Sunday, January 2, 2011

BeagleBoard Networking

Wired networking
The BeagleBoard-xM has an in built Ethernet port. But I used a Linksys USB300M with my C4 version. Angstrom has drivers for the ASIX chip in the USB300M and it installs automatically as eth0 and defaults to DHCP. On Win7, I bridged this with my wireless connection to get internet access for my board.

I assigned a static IP to eth0 by adding this information to /etc/network/interfaces file:
#Bring up the interface automatically. 
#Otherwise, must use "ifup eth0" or "ifconfig eth0 up" everytime.
auto eth0
#iface eth0 inet dhcp
iface eth0 inet static
address 192.168.1.105 netmask 255.255.255.0 gateway 192.168.1.1

Wireless Networking
For WiFi, this table shows the supported chipsets and vendors. I use a Netgear WG111v3 adapter which has the rtl8187 chipset.
auto wlan0
iface wlan0 inet static
wireless-essid xxxxYourESSIDxxx wireless-key xxxx wireless-ap xx:xx:xx:xx:xx:xx address 192.168.1.10 netmask 255.255.255.0 gateway 192.168.1.1

Bringing up the Beagle

One of the important things to have for development on the BeagleBoard is another Linux machine. I have a Windows 7 PC, so I installed an Ubuntu virtual machine using Sun Virtual Box. Using the virtual machine additions, you can share USB devices and folders with the virtual machine.

I managed to get Angstrom up and running on a 2GB SD card following instructions from the beginner's tutorial here.

Once you log into the beagleboard, change the root password using the passwd command. This is a must for SSH-ing into the board.