CSC231 Customizing Ubuntu LiveCD to connect to Arduino stamp
--D. Thiebaut 18:53, 31 October 2008 (UTC)
Contents
Process
The process is fairly simple:
- get the ISO of the current Ubuntu liveCD [1]
- Follow the directions from the very nice customization page here
- Boot with the liveCD
- copy the liveCD to a new directory on a hard disk with enough free space (~ 5-10 GB)
- unpack liveCD
- chroot to the unpacked version
- add sun-java5-jre (this takes a lot of steps using dpkg -f install commands to update all dependencies)
- add the libRxTx library (http://mirrors.kernel.org/ubuntu/pool/universe/r/rxtx/librxtx-java_2.1.7-2_i386.deb). This is a set of drivers that allow communication over the USB port. This is the reason a LiveCD is a good solution, because otherwise all computers already setup and locked would have to be modified to have these drivers installed.
- get the Arduino software and copy it to a convenient location in the chrooted environment
- copy the SimpleMessageSystem software to arduino library folder
- copy nasm, gcc, emacs22 to chrooted environment
- come out of chroot
- create new ISO file version of liveCD
- reboot as regular Linux machine
- burn ISO version to DVD with k3b (because the new installed package make ISO larger than max size of CDRom)
Detailed notes can be found here
Testing Customization, Version 1
- Reboot from the newly customized LiveDVD.
- Find Arduino folder in /root and start Arduino app (Ubuntu will offer serveral options: choose run from Terminal)
- Make sure board and connection are set in tools menu.
- Load examples/digital/blink sketchbook
- Download it to Arduino.
- Reset Arduino
- LED should blink
Testing Customization, Version 2
- Open sketchbook library.simpleMessageSystem.example1
- Uploaded it to board
- Copy driver.c, asm_io.inc, asm_io.asm, and ledOn.asm from Assembly Program section above
- Compile and run the application as follows:
nasm -f elf -d ELF_TYPE asm_io.asm nasm -f elf -d ELF_TYPE ledOn.asm gcc -o ledOn driver.c ledOn.o asm_io.o ./ledOn
- Led should turn on. Feel free to create ledOff.asm to turn it off ;-)
Using a USB drive/mem-stick
Instead of installing Arduino on the liveCD, one could use a USB memory stick to keep a live version of Arduino and of the sketchbook. In this case the approach would be to
- Create a new distro of Ubuntu as above, but skip installation of Arduino software
- Plug a USB drive in a USB port and wait until Ubuntu recognizes it
- The icon for the new drive should appear on the Ubuntu Desktop
- Install Arduino software on new USB drive (get arduino-0011-linux.tgz or current version from http://www.arduino.cc/files)
- Installed SimpleMessageSystem package in Arduino library