From 2256851be26fed2742470df5f8e89e8db85ecfe7 Mon Sep 17 00:00:00 2001 From: dakkar Date: Tue, 1 Sep 2009 20:03:04 +0200 Subject: documents about the cupcake --- .../arduino-on-gentoo/document.en.rest.txt | 130 +++++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 src/HW/makerbot/arduino-on-gentoo/document.en.rest.txt (limited to 'src/HW/makerbot/arduino-on-gentoo/document.en.rest.txt') diff --git a/src/HW/makerbot/arduino-on-gentoo/document.en.rest.txt b/src/HW/makerbot/arduino-on-gentoo/document.en.rest.txt new file mode 100644 index 0000000..908bb10 --- /dev/null +++ b/src/HW/makerbot/arduino-on-gentoo/document.en.rest.txt @@ -0,0 +1,130 @@ +================================================= + Building the Arduino / Sanguino on Gentoo amd64 +================================================= +:CreationDate: 2009-09-01 17:27:01 +:Id: HW/makerbot/arduino-on-gentoo +:tags: - hardware + - software + - 3dPrint + +Ok, so I had this nice CupCake_ kit. It comes with pre-built +electronics, and pre-installed firmware. But I like being able to do +upgrades, especially since the whole thing is still maturing. + +So, the `MakerBot instructions`_ say "get the Arduino_ env, apply the +Sanguino_ patch, and you're done". Easy, right? + +I start by downloading the sources for the Arduino_ software. You see, +I run a 64-bit machine, and the pre-built Linux binaries are 32 +bits. Not good enough. + +Then, following the `Arduino instructions`_, I say:: + + ~/arduino-src/build/linux$ ./make.sh + +and it goes:: + + The Java bundle that is included with Processing supports only i686 by default. + To build the code, you will need to install the Java 1.5.0_15 JDK (not a JRE, + and not any other version), and create a symlink to the directory where it is + installed. Create the symlink in the "work" directory, and named it "java": + ln -s /path/to/jdk1.5.0_15 /home/dakkar/arduino-src/build/linux/work/java" + +Ok, I'll do it. By having mis-read the notice, I actually symlink the +``icedtea6`` JDK. It didn't seem to mind. + +Now it builds, but it won't run: there are 32-bit libraries! Who built +them?? + +Looking at Portage (yes, I run Gentoo) I see that there is an ebuild +for an (older) Arduino version, and it declares dependency on exactly +the library that is giving me problems. So:: + + emerge -av dev-java/rxtx uisp + +and I have the right library. Of course the Arduino program won't use +it (it's not in the default ``CLASSPATH``), so I symlink it over the +bundled version:: + + rm work/lib/RXTXcomm.jar work/lib/librxtxSerial.so + ln -s /usr/share/rxtx-2/lib/RXTXcomm.jar work/lib/ + ln -s /usr/lib/rxtx-2/librxtxSerial.so work/lib/ + +It runs! + +Of course, no Sanguino_ support, and the CupCake_ main board is a +Sanguino_. + +The `Sanguino instructions`_ say to add a couple of directories, +overwrite a few files, add some lines to a file, and it should be +enough. Well, not so fast. It didn't work for me. + +After a bit of ``find``, I see that the ``boards.txt`` file (the one +that needs to have data added to) has been copied from it "source" +location (``/home/dakkar/arduino-src/hardware/boards.txt``) to the +"work" location +(``/home/dakkar/arduino-src/build/linux/work/hardware/boards.txt``). Ok, +I should have read *all* the instructions: it said to rebuild the +Arduino environment every time a change is made. + +By this point I'm sick and tired of re-doing all the work-arounds, so +I just change the ``make.sh`` script:: + + =================================================================== + --- make.sh (revision 756) + +++ make.sh (working copy) + @@ -34,25 +34,7 @@ + + install -m 755 dist/arduino work/arduino + + - ARCH=`uname -m` + - if [ $ARCH = "i686" ] + - then + - echo Extracting JRE... + - tar --extract --file=jre.tgz --ungzip --directory=work + - else + -# echo This is not my beautiful house. + -# if [ $ARCH = "x86_64" ] + -# then + -# echo You gots the 64. + -# fi + - echo " + -The Java bundle that is included with Processing supports only i686 by default. + -To build the code, you will need to install the Java 1.5.0_15 JDK (not a JRE, + -and not any other version), and create a symlink to the directory where it is + -installed. Create the symlink in the \"work\" directory, and named it \"java\": + -ln -s /path/to/jdk1.5.0_15 `pwd`/work/java" + - exit + - fi + + ln -s "$(java-config -O)" work/java + fi + + cd ../.. + @@ -91,6 +73,11 @@ + rm -rf ../build/linux/work/classes + mkdir ../build/linux/work/classes + + +rm ../build/linux/work/lib/RXTXcomm.jar + +rm ../build/linux/work/lib/librxtxSerial.so + +ln -s /usr/share/rxtx-2/lib/RXTXcomm.jar ../build/linux/work/lib/ + +ln -s /usr/lib/rxtx-2/librxtxSerial.so ../build/linux/work/lib/ + + + ../build/linux/work/java/bin/java \ + -cp ../build/linux/work/java/lib/tools.jar \ + com.sun.tools.javac.Main \ + +Now:: + + rm -rf work/ + ./make.sh + ./run.sh + +and I have the environment working! Well, at least it starts and lists +the appropriate boards. We'll see if it actually works. + +.. _CupCake: http://wiki.makerbot.com/cupcake +.. _`MakerBot instructions`: http://wiki.makerbot.com/cupcake-motherboard-firmware-update +.. _Arduino: http://arduino.cc/ +.. _`Arduino instructions`: http://code.google.com/p/arduino/wiki/BuildingArduino +.. _Sanguino: http://sanguino.cc/ +.. _`Sanguino instructions`: http://sanguino.cc/softwareforlinux -- cgit v1.2.3