but, anyway, i got mine. also got one of those pl2303 usb-ttl serial cables, a pi box and a ribbon cable. and i finally got some time to play with it. i stuck a piece of header into the end of the ribbon cable and plugged the pl2303 into the appropriate place, then downloaded occidentalis v0.2, logged in via the console, enabled ssh, plugged in to my lan, and wondered what to do next.
well, it would be nice to have a screen on the thing, so i figured i'd get vnc going.
turned out to be pretty easy.
Code: Select all
sudo apt-get install tightvncserver
tightvncserver
vncserver :1 -geometry 1280x720 -depth 16
the second line configures the package which involves prompting you for two passwords. the first password is for a regular interactive vnc connection. the second is the password to use if you want a view only session without control of the keyboard and mouse on the pi.
the third line starts the vnc server on the pi. ":1" specifies the screen number. "-geometry 1280x720" specifies the screen geometry for the virtual console and "-depth 16" specifies the color depth of the display.
cool. now i'm able to run the gui on the pi from other computers on my lan.
what now?
arduino, of course. the problem with installing arduino on the pi is that the arduino team hasn't distributed any packages with binaries for arm. still, the first thing to do is download the arduino package, then uncompress it, then delete the x86 versions of the compiler, avrdude and a host of other useful by incompatible tools.
actually, the first thing to do is update the package lists on the pi.
Code: Select all
sudo apt-get update
wget http://arduino.googlecode.com/files/arduino-1.0.1-linux.tgz
tar zxvf arduino-1.0.1-linux.tgz
mv arduino-1.0.1/hardware/tools arduino-1.0.1/hardware/foo
the second line retrieves the arduino ide from google code. it is compressed into a what's know as a tarball, named after the program we'll use to uncompress it.
the third line uses a utility called tar to uncompress the tarball. the ar in tar is for "archiving." after this step we've got a pretty standard looking arduino installation in a directory called ~/arduino-1.0.1. the problem is that although the arduino ide itself is written in java which is cross platform, there are several binaries in the package that were compiled to a 32bit x86 linux machine.
the fourth line hides all of those binaries, by renaming the directory in which they are stored. fortunately, if arduino cannot find these programs within its own directory structure, it will search for them in their normal locations on the system.
so it's up to us to put them there.
Code: Select all
sudo apt-get install avr-libc
sudo apt-get install libftdi1
sudo apt-get install avrdude
the second line installs a library that allows programs on the pi to talk to the ftdi chips on some older arduinos.
the third line installs a program called avrdude, which arduino uses to upload your program to your arduino board once it is compiled.
alas, there remaina couple of things to do. as i mentioned before, the arduino ide, itself, is written in java. the occidentalis distribution i'm running does not have a java virtual machine, so that must be installed. there is also a platform dependent library that arduino relies on for serial communication called librxtxjava, that we must install and then copy into the correct location in the arduino's directories.
Code: Select all
sudo apt-get install openjdk-6-jre
sudo apt-get install librxtx-java
cp /usr/lib/jni/librxtxSerial.so ~/arduino-1.0.1/lib/
cp /usr/share/java/RXTXcomm.jar ~/arduino-1.0.1/lib/
the second line installs librxtx.
the third and fourth lines copy the rxtx system and java libraries into the arduino directory tree.
that's it. i can now fire up a virtual network connection on any computer on my home network and start working on code on an arduino connected to my raspberry pi.
i like it. i learned some stuff. looks like i've got my 8Gb sd card about 31% full.
here are the commands i used all in one place. you can probably roll them all up in a file, run chmod to make it executable and just run it as a shell script. tightvncserver is the only thing that requires any input from the user.
Code: Select all
sudo apt-get install tightvncserver
tightvncserver
vncserver :1 -geometry 1280x720 -depth 16
sudo apt-get update
wget http://arduino.googlecode.com/files/arduino-1.0.1-linux.tgz
tar zxvf arduino-1.0.1-linux.tgz
mv arduino-1.0.1/hardware/tools arduino-1.0.1/hardware/foo
sudo apt-get install avr-libc
sudo apt-get install libftdi1
sudo apt-get install avrdude
sudo apt-get install openjdk-6-jre
sudo apt-get install librxtx-java
cp /usr/lib/jni/librxtxSerial.so ~/arduino-1.0.1/lib/
cp /usr/share/java/RXTXcomm.jar ~/arduino-1.0.1/lib/