RepRapLinuxSoftware

From RepRap
Revision as of 23:19, 5 June 2007 by ZachSmith (talk) (version migrated from twiki)
Jump to: navigation, search

Installing the RepRap software under Linux or Unix

RepRap uses a large number of open-source software packages for development, and quite a few when it runs. This page describes how to take a standard Ubuntu installation and prepare it for RepRap development. It then describes how to download and set up all the RepRap software. It should be easy to adapt the descriptions below for other Unix systems.

To do most of the following work it is useful to have two windows open on your computer:

  • A terminal window,
  • A web browser with this page displayed.

Note that for many of these installations you will need the superuser password for your machine. You can copy-and-paste the commands below into the terminal window. Be careful what you run as the superuser, especially if you are not a Unix expert - you can damage your system with an ill-judged command...

Java

RepRap's controlling software is written in Java, and also the Art of Illusion design package for three dimensional objects uses it, so next we need a Java development environment. The following method of getting one should be clean, in that it is easy to separate it from any Java that you already have on your system.

Java Runtime Environment (JRE)

Install and configure the sun-java6-jre package. Copy/paste the following commands into your terminal window:

sudo apt-get install sun-java6-jdk
sudo update-java-alternatives --set java-6-sun sudo update-alternatives --config java

Now you have the most recent Java version, ready to rock.

Java3D - 3D graphics in Java

The host RepRap software uses three-dimensional graphics to allow you to interact with the RepRap machine, so you need a copy of Java3D to permit that to work. Click on that link and download the appropraite file for your machine into your home directory; for Linux on a PC that file will be called something like java3d-1_4_0_01-linux-i586.bin. Note that, at the time of writing, Java3D version 1.5 does not work with the rest of the software, so you will need to click the previous versions link on the Sun site. Version 1.4.0.01 definitely works.

Then, as the superuser, move the file to your Java directory, cd to the Java run-time environment (JRE) directory, then run the downloaded file:

    # cd /usr/local/Java
    # mv ~your-id/java3d-1_4_0_01-linux-i586.bin .
    # chmod +x java3d-1_4_0_01-linux-i586.bin
    # cd j2re1.4.2_13 ### Your JRE directory
    # ../java3d-1_4_0_01-linux-i586.bin

This will add extra files to your Java lib directory where Eclipse will be able to find them. If you have problems, check the README in the download folder, and see WhereIsMyJRE.

Now you can run the RepRap software. As you, not the superuser, open Eclipse, open the RepRap project, go to src -> org.reprap and right-mouse-click on Main.java. Select Run as -> Java application. This should open a window that looks like this:

RXTX Serial Library - serial-port communications

The host computer (that is, the computer on which you're installing all this stuff) talks to the RepRap machine using either an RS232 serial port (/dev/ttyS0 or /dev/ttyS1 on most machines) or via a USB-to-serial converter (/dev/ttyUSB0). Most laptops and some desktop PCs don't have a serial interface, so - if you have one of those - you will need to buy such a converter; they normally only cost a few pounds. (RepRap 2.0 "Mendel" will be driven directly via USB.)

Java, therefore, needs to know how to talk to these interfaces. Fortunately, there is a Java API that implements this.

As of early June 2007, RepRap now uses the RXTX serial libraries. The current version of them being used is 2.1.7-r2. Check the RXTX site to see if there is a newer one at the time you read this, and download the appropriate Linux binary .zip file, currently [[1]]. Save this file in your home directory. Now unzip the three files you need from it:

$ unzip -j -o rxtx-2.1-7-bins.zip rxtx-2.1-7-bins-r2/RXTXcomm.jar rxtx-2.1-7-bins-r2/Linux/i686-unknown-linux-gnu/*.so

Now as root, copy those files underneath your JRE so Java will find them. In this example your JRE directory is /usr/lib/jvm/java-1.5.0-sun-1.5.0.11/jre. See WhereIsMyJRE.

$ JREDIR=/usr/lib/jvm/java-1.5.0-sun-1.5.0.11/jre # or your path... $ sudo cp -vp RXTXcomm.jar $JREDIR/lib/ext/ $ sudo cp -vp librxtx*.so $JREDIR/lib/i386/

Granting yourself permissions on your serial ports

Finally, ordinary users may not have access to the serial port(s) on your machine. So, add yourself to the dialout group (in Ubuntu), or take whatever other action you need to so you can access those devices.

{| border="1" |- $ sudo moduser -G `groups ||sed 's/ /,/g'`,dialout `whoami` |}

A more manual approach is to edit your groups database by hand, perhaps by $ sudo vigr -s

or similar. The moduser approach should work in both Debian and Ubuntu, and probably also in Red Hat based Linux distributions like Fedora and RHEL and CentOS. Serial port permissions are very distribution specific, so if you have issues with them, please read the documentation for your distribution carefully for clues.

RepRap Host Software

Now you are ready to download and run the RepRap Host software! Simply navigate to the SourceForge download page, and choose the most recent version (0.8 as or writing). Download that, and then unzip it wherever you like. The easiest way to run it, is to double click the 'reprap-host.sh' file and at the prompt, either select 'run in terminal (for debug text)' or 'run'.

Alternatively you could run this command from the directory that contains the host software:

./reprap-host.sh

After a short load period, you will see this intial screen:

RepRapLinuxSoftware-reprap-startup.png

This is a representation of the build-base of the RepRap machine. You will load objects to be made here, move them to where you want them built, then build them.

For the moment experiment with the tilt, zoom and pan controls (left, middle and right mouse buttons respectively).

Annoyingly, if you have an Nvidia graphics card on your system, a bug in the Nvidia drivers may become aparent here, and the software will give a Java exception rather than giving you graphics. To fix that, see here.

Congratulations!

You have now installed the RepRap Host software, and with the proper machinery, you are ready to get printing! This is just the surface of the software need to actually develop for the project. At this early stage, its unlikely that you will be able to get by with just the host software. Follow the instructions below to install and setup your complete development environment.

Developer Documentation

This is for the extra stuff that most people wont need. 3D modeling, circuit board layout/design, java compiling, firmware compiling, etc. Here there be dragons. ;)