Beagleboard + Ubuntu 10.10…Sweet!

Things are just falling into place with this Beagleboard.  The Ubuntu distro, although slow on installing packages is pretty damn robust.  I have installed a bunch of packages without a hiccup.  X11VNC works without any issues, and can access with ultraVNC without much screen lag.  My UVC webcam (which can be seen in motion in earlier posts) works perfectly due to great kernel library and UVC driver that was already in distro.  I added extras like “gUVCView“, which is an awesome webcam app.  I have installed “motion” and “UVCCapture” as well.  The goal is getting OpenCV on here and getting some video recognition algorithms going.  From what I have seen with Beagleboard, I have no worries.  The video pipeline on this board is pretty spectacular.  There is even a camera header installed on board for those ‘board cams’ which have 15-18 wires connecting them.  I will be boning up on my Python and then OpenCV will be a big chunk of my robot ‘to do’ list.

You can see below the beagleboard and the future enclosure body (torso) with the camera head aimed at the keyboard.  It actually defaults to 640×480 and I reduced the size in the .guvcviewrc file (found in user directory) to 320×200. For my testing and vision processing experiments, this quarter-vga format will be fine to cut my teeth on.

Ubuntu on Beagleboard-XM

Posted under Operating Systems,Robotics

New Tangent – Vortex86SX is History!

OK.  Why spend so much time on a frankly, underpowered system board.  Chalk it up to learning experience I guess.  That Vortex86 may have been the cat’s pajamas (pulled that from nowhere) about 5-10 years ago with 300Mhz, but the lack of FPU or math coprocessor cripples it nowadays.  Less operating systems will use it, and the workarounds for Linux and extra compiling are not worth it for a base system to hang other applications and projects on.  Now there are still many SOC and processor evaluation boards out there that do not have FPU capability, but the processing power (speed, memory) and community support make up for that.  Case in point: Beagleboard

I picked up a revision B XM version of one of these little nuggets and I am quite impressed.  What kept me from getting one years ago was the lack of VGA output.  All the other boards I tried at least had that.  This has s-video (usually crappy at best) and HDMI out.  I got back one of my old monitors which has a DVI input, and then I made the plunge for the Beagleboard.  Glad I waited, as the XM unit has a 1Ghz processor (TI Omap 37XX) and 512M RAM.  Pretty awesome for a board that is 3 inches by 3 inches (smaller than PC104 form factor by a smidge).  Here’s the bonus:  it comes with a 4-port USB Host connector (a hub, technically) soldered to the board, as well as a RJ-45 ethernet connector (smsc95XX), and the serial port is now soldered on as well (DB-9).  It comes with a 4G microSD card which is always recognized as an MMCblk0 device.  Many headers are also part of the board now, so no crazy tight-space soldering if you want to attach a daughtercard!

Beagleboard-XM

These ports and connectors make it very easy to work with.  Pretty much plug-and-go!  Important to get a 5V adapter, as this board is flackey if relying on power from USB OTG port.  Still, this 5V supply can power many devices on the onboard USB ports like (in image above) a mouse, keyboard, and 2G thumb drive!  And it still consumes less than 2 watts of juice.  I see a great future with this little board.

MAKING IT USEABLE

The SD card that came with it had a demo image for testing right on it.  This shows that it can boot up.  It is not, however, setup for a working system.  It comes with a recent Angstrom build which worked completely in ramdisk.  The only partition formatted was the 80M bootable fat.  The rest of the card was unpartitioned.  I copied the the contents of fat partition to a safe folder on Vista machine fat32 hard drive (USB) and proceeded to boot up one of my Linux live distros – can’t remember which one, but it was probably Puppy 5.1 or Debian Lenny.  Then I setup the Beagle SD card with Gparted.  I made a bootable fat at 90M, EXT3 at about 3G, and an EXT2 storage for the rest.  I suppose I could have put back the saved MLO and u-boot.bin, but I ended up going to a Texas Instruments site and used the MLO and u-boot.bin from their Android Froyo site.  Yes, I installed Froyo, and it worked, but it was pretty lame on a machine with no touchscreen and a mouse/keyboard.  If I got a touchpanel daughtercard, then perhaps.  Anyway, the packages and layering of the operating system is different (OK for phones, but not so much for a development robot system).  So, I kept the bootloader files and proceeded to test other systems.  I installed Angstrom and it worked great, except the package ‘universe’ was not that large.  i hit brick walls when trying to get things I thought I might need – like luvcview or uvcview.  Sure I could compile them for my kernel, but I was too impatient.  I tried Debian netinstall, but my kernal did not match my rootfs, because there was only one netinstall rootfs on debian ARM site and it was for 2.36.29 kernel, and I had 2.36.34……  You would think it would work (yes it booted and all, but installing modules for devices or adding packages kept spitting out ‘invalid format’ errors).

I ended up with Ubuntu 10.10 (Maverick I guess).  With help of Robert Nelson images, I manually installed the boot images with mkimage in Debian, and the rootfs on the second partition (untarred it).  Anyway, after altering the boot.scr a little and saving with mkimage, the Beagleboard boots right up.  If the serial port is connect to PC with a terminal program running (PuTTY for Windows, picocom for Linux) at 115200-n-8, it displays on both terminal and DVI output (LCD monitor).

Beagleboard DVI

Xserver didnt work after install because the distro image was a ‘minimal’ one – perfect!  I would like to be responsible for my own application bloat anyway.  So I proceeded to install X Windows server (apt-get install xorg) and windows manager – fluxbox (apt-get install fluxbox).

One note:  the ethernet did not work right away, which was really a setup issue.  For some strange reason, the ethernet installed on USB1 instead of USB0 like it always did before.  This might be because I had a thumb drive in the port.  Ethernet is really a USB ethernet.  So using ‘ifconfig’, I set a static ip, and used ‘route add’ to set gateway.  Pinging outside site confirmed working ethernet.  Very next step after that was to update package list (apt-get update), which had to be done before installing anything else like X windows mentioned above.  At last count, on this little board, I had 22,800 files and directories installed (from apt-get feedback).

PERFORMANCE

One mention on performance.  Ubuntu 10.10 is not a speed demon on this board.  Angstrom is much faster.  It is due to a combination of things – sheer file number and system footprint, SD card capability and format, and the fact that the kernel command to restrict CPU speed to 800 from 1000 (this will be fixed in a later update).  But I sacrifice speed for functionality at this point.  Afterall, I was going to be setting up a 300Mhz system before – so this is still like heaven.

Helpful Links:

Posted under Operating Systems,Robotics

Back to Linux

It has been awhile sinced I posted on this.  My wife and I have been travelling and other projects have been sandwiched in between (like a whole diversion into circuit building and green energy, etc.).  Anyway, I am back to hacking processor boards for robot integration. I am blogging about this because it may help others who may have hit stumbling blocks with a certain board for something seemingly simple as getting it to boot a fairly recent Linux kernel.  In the end, and looking back, it might have been easier to use another board afterall!  The board I am referring to is the Vortex86SX.  On paper, it sounds like a packed board, and indeed the DX version is already marketed as a “roboard” for robot building.  But, sometimes the fun is in the challenge and learning experience.  I also picked up the board on EBay for about $70.  It has all kinds of I/O and a regular VGA port and 2 hi-speed USB ports and runs only on 5v.  The problem…….no math coprocessor.  Pretty much cripples it with most OSs.  You can forget WinXP (even embedded version).  Win2K is just too old for getting current drivers.  It looks like Linux is the only way to go here.

It came with X-Linux which works, but the kernel is just old enough so most drivers are not rolled into it.  It seems to have lacked good ceveloper following.  For basic operation and if you want to brew your own drivers, it should be fine.  I wanted a little more main streamso I can get current apps and drivers.  First I started with SliTaz, which works great on my other 386 PC104 board, but it panics because of no FPU.  Then I really wanted Puppy Linux, but recompiling the kernel was tedious and threw all kinds of errors in my multiple attempts, just to get it going with no FPU.  I read another forum where someone had tried for weeks and got it to boot, but then had multiple failures to get a GUI working like X-Windows.  But I found another blog which solved my issues (http://choompon.exteen.com/20100128/howto-compile-debian-for-e-box-2300-sx).

My steps:

  • Downloaded the image (USB flash), which is way faster than recompiling on my own
  • using Puppy Live on my PC (or any other Linux variant)  I dd’ed the img file to a 256M thumb drive
  • using gparted, I set the boot flag of thumb drive
  • tested drive by booting to Linux on PC
  • put that thumb drive and CFlash IDE board (with 512M flash) onto Vortex board
  • booted Vortex board to USB thumb Linux
  • dd’ed partition of thumb to CFlash partition ( sda1 to hda1)
  • rebooted without thumb (Linux debian ‘Lenny’ comes up)

All is good!  I have a working PC104 board with lots of I/O, and the main reason……I plugged in my webcam (seen on previous posts moving with servors), and it recognized it.  It showed the sound portion of cam, which is a good start.  The next major thing I had to do was get the system to be ‘not live’, as the flash drive is essentially emulating a live cd system where the flash drive is like the cd.   I wanted to have apps and settings remain persistent.  This was accomplished by getting a bigger CFlash card (4G) and setting up partitions with gparted.  Partition 1 was 256M Fat32, 1 was 900M Ext3, and rest was Ext2.  I set boot flag to first partition and made it bootable with ‘syslinux’, which I think is way easier than Grub (no hd0’s vs hd1’s to worry about).  Made syslinux.cfg to boot with ‘rw root=/dev/hda2’ which made the second partition function as normal system.  Then I mounted the ‘live’ root system image as a new drive on /media directory, using “-o loop” at end.  Then while logged in as ‘root’, I cp’ed all the directories to the second partition (many are emtpy like /proc).  So now I had a huge user space with standard boot from fat32.

After putting new CFlash drive in board and rebooting, I had Debian system running on a writable partition and ready for app/driver installs.  By the way, the LAN port worked with kernel image, so using apt-get worked great after tweaking source tree and adding a few more like the archived builds from debian.org.  I had to setup network by editing the “interfaces” file – I used “auto eth0 inet dhcp” to get me going, then did network reset.

Posted under Robotics