This is my first go at getting Arduino software running under FreeBSD 6.1.
FreeBSD is a UNIX-like operating system that's very customizable. It'll work on almost any hardware, and it's up to you how to use it. So FreeBSD and a microcontroller seem like a pretty good match.
First a word about how software installation works on FreeBSD. To install software on FreeBSD, you have three main options:
To help keep things neat and clean on the machine, I'm going to be using the ports system as much as possible.
For more information on general software installation on FreeBSD, see the (excellent) documentation at http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/
As with the other Unix like systems, you'll need to decide whether you want to install the complete Arduino software (runs under Java), or to run command line tools only.
My plan is to try both and sort of see what happens.
Java installation: I'm told that the arduino software requires Java. Java and FreeBSD have some weird relationships with one another, but it's totally possible to get Java running on FreeBSD, nonetheless.
Googling for "freebsd Java," I found out there are several ports and packages for Java on FreeBSD. The only one that worked for me was the one at http://www.freebsdfoundation.org/downloads/java.shtml
You will need to download these files manually because of some weird Sun licensing mumbo jumbo.
The files you need depend on which version of FreeBSD you're using. The one that worked for me was the one ending in "b01" that was for my version of the operating system (6.1).
Just download the file from the site, put it in /usr/ports/distfiles, then head on over to /usr/ports/java/diablo-jdk-1.5
Next, type make install at the prompt, and you should be well on your way.
The port might tell you to download some patches from a different site, if so, go ahead and follow the instructions, placing the patch files in /usr/ports/distfiles, and type make install again from /usr/ports/java/diablo-jdk-1.5.
The command prompt will perk along a while. If you have experience compiling software, or with the ports system on FreeBSD, this all will look familiar.
To get the JRE working on Firefox (which is the browser I use on FreeBSD), I followed the instructions at this page http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/desktop-browsers.html.
I have a feeling we'll need the ports at /usr/ports/devel/avr-gcc, and /usr/ports/devel/avr-libc, and /usr/ports/devel/avrdude, /usr/ports/comms/rxtx, and /usr/ports/java/jikes so let's install each one by cd'ing into the right directories, and doing a make install (or make install clean, if you prefer) from each one.
Next, just like the Linux folks, we'll need to provide the software the right path to find the Java junk we've installed. To do so, set the CLASSPATH and AVR environment variables. In my case it was like: export CLASSPATH=/usr/local/diablo-jdk1.5.0/bin:/usr/local/diablo-jdk1.5.0/jre/lib/rt.jar export DIRAVR=/usr/local/avr
you can double check your work by doing echo $CLASSPATH or echo $DIRAVR on the command line.
To retain these settings after you reboot, you'll want to set them somewhere handy, I'm thinking in the shell rc file (/home/yourlogonname/.bashrc or /home/yourlogonname/.zshrc or same thing in root, depending on how you're logging on.)
Well, folks, that's as far as I've gotten so far.
Oh, and another thing; you should be able to get away with installing the Java runtime edition (JRE) instead of the SDK.
I'll check back in after the other ports install, and as I get the source downloaded from the Arduino site.
edit: OK I'm checking back, and I've hit trouble. the make.sh script throws several errors, one of which caused the whole script to die (i.e. that examples.zip wasn't found.) not sure why it's looking for that - there is no examples.zip in the sourcefiles I have.
So I figured maybe that was normal behavior. After getting rid of examples.zip from make.sh, now it seems to run.
So next, I try run.sh, but no luck so far. It looks like the CLASSPATH is being set by the arduino shellscript (what run.sh is running). I tried setting classpath manually, then running what the "arduino" shellscript (in the "work" subdirectory) runs. It looks like I have to set all paths manually in the "arduino" shellscript. It's unclear from the shellscript comments where processing.app.Base is, and how the shellscript's supposed to be finding it, and what it's doing next. Arg, all this Java class junk is giving me brain-aches.
I found some more info from this site: http://processing.org/discourse/yabb/YaBB.cgi?board=general;action=display;num=1042496741
There's also this http://processing.org/discourse/yabb_beta/YaBB.cgi?board=Integrate;action=display;num=1155112507
In the meantime, here's a quick description of the stuff you've installed so far:
| name | descr | category |
|---|---|---|
| avrdude | AVR Downloader/UploaDEr - is a program for updating the flash, eeprom, and fuse bit memories of Atmel AVR microcontrollers | Arduino |
| avr-gcc | gcc-4.x for Atmel AVR cross-development | Arduino |
| avr-libc | a C and math library for the Atmel AVR controller family | Arduino |
| diablo java sdk (or jre) | permits running java apps on FreeBSD. | Java |
| jikes | a java source to byte-code compiler | Java |
| subversion | lets you get the sourcecode using the fetch.sh script | General |
Scott (scuppers)(at)(hotmail)(dot)(com)