Arduino IDE on 64bit openSUSE

Arduino BoardArduino is a tool for making computers that can sense and control more of the physical world than your desktop computer. It’s an open-source physical computing platform based on a simple microcontroller board, and a development environment for writing software for the board.

Unfortunately the serial port communication driver (RXTX) which comes with the arduino download is not 64 bit compatible. I will describe here how I successfully compiled & installed the driver to get the Arduino IDE running on a 64 bit openSUSE installation. Most of the instructions should be pretty straight forward to be replicated on an other rpm based distribution. For ubuntu/debain based distributions, you can find the instructions provided by Tero Karvinen useful.

Packages Required for Arduino IDE

The following packages are required to run the Arduino IDE:

  • java-1_5_0-sun
  • cross-avr-gcc
  • cross-avr-binutils
  • avr-libc

Linux USB Serial Converter Driver

Besides the above software, you will also need a compatible kernel. This means version 2.6.x or at least 2.4.30. For example, it needs USB serial support with the FTDI driver. After connecting an Arduino board to your computer via an AB USB cable, it should load the ftdi modules automatically. Ensure ftdi_sio and usbserial modules are loaded by executing:

lsmod | grep ftdi

It should return output similar to whats shown below:

ftdi_sio               54280  0
usbserial              52688  1 ftdi_sio
usbcore               156456  6 ftdi_sio,usbserial,usbhid,ohci_hcd,ehci_hcd

If not, as root, run:

modprobe ftdi_sio

If there are no errors from the above command, then the module is loaded successfully.

System Requirements

The Arduino IDE is java based and RXTX [2] is a native java library providing serial and parallel communication for the Java Development Toolkit. The RXTX lib uses lock files by default. So Before you use lock files you need to do one of two things:

  1. Be the root or uucp user on your machine whenever you use rxtx
  2. Or add the specific user that needs to use rxtx to the group uucp. (preferred)

Add your user account to the uucp group by going to yast2 > Security and Users > User Management. Once you have added yourself to the group, you will need to restart your session to make it affective. Once you are in the new session, verify that your account belongs to the uucp group by executing “groups” on the shell. It should give return you a list of groups your account belongs to.



Packages required for building rxtx-java

  • autoconf
  • automake
  • libtool
  • gnu make
  • gcc
  • jdk > 1.3 or java-1_5_0-sun-devel
  • checkinstall (optional)

After installing the necessary libraries, you can download and start building the library with the following commands:

wget http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7r2.zip
unzip rxtx-2.1-7r2.zip
cd rxtx-2.1-7r2
export JAVA_HOME=/usr/lib64/jvm/java-1.5.0-sun/
./configure
make

Once the libraries are built, you can install them by following either one of the following two methods:

  1. Build an RPM package with the help of checkinstall
    (preferred)
  2. Copy the libs to the arduino libs folder.

If you are opting for the checkinstall method, I suggest to name the package rxtx-java. You can then install the package using normal rpm commands. Once you have done that, you need to determine the path to the libraries. Execute the following to obtain the Path to the rxtx libraries:

rpm -ql librxtx-java | grep RXTXcomm.jar
/usr/java/jdk1.5.0_06/jre/lib/ext/RXTXcomm.jar

We will now remember to add the path (‘/usr/java/jdk1.5.0_06/jre/’) to the arduino bootstrap script.

To install the libraries the second way, you can copy the compiled RXTXcomm.jar and librxtxSerial.so files to the arduino lib directory. The libs are built and placed into “x86_64-unknown-linux-gnu/.libs/” folder while the jar file should be in the same folder you are in.

Setting up the Arduino IDE

Download and untar the Arduino IDE from Arduino Software page

wget http://www.arduino.cc/files/arduino-0010-linux.tgz && \
tar -xvzf arduino-0010-linux.tgz

In the arduino/tools directory, make symlinks:

cd arduino-0010/hardware/tools
 ln -s /opt/cross/bin/avr-gcc avr-gcc && \
ln -s /opt/cross/bin/avr-g++ avr-g++ && \
ln -s /opt/cross/bin/avr-objcopy avr-objcopy && \
ln -s /opt/cross/bin/avr-objdump avr-objdump && \
ln -s /opt/cross/bin/avr-size avr-size

Copy the compiled RxTx-java libray into the arduino-0010/lib folder. Before doing so rename the existing libraries.

cd ../../lib/
mv librxtxSerial.so librxtxSerial.so.DISABLED
mv RXTXcomm.jar RXTXcomm.jar.DISABLED

Now copy the freshly compiled rxtx libraries into this folder

cp ../../rxtx-2.1-7r2/x86_64-unknown-linux-gnu/.libs/librxtxSerial.so .
cp ../../rxtx-2.1-7r2/RXTXcomm.jar .

Once you have copied the library and jar file, you are ready to execute the arduino bootstrap script to launch the Arduino IDE.

./arduino
Experimental:  JNI_OnLoad called.
Stable Library
=========================================
Native lib Version = RXTX-2.1-7
Java lib Version   = RXTX-2.1-7

The Arduino IDE

Arduino IDE

Resources

  1. http://www.arduino.cc
  2. http://www.rxtx.org
  3. http://ftdi-usb-sio.sourceforge.net/
  4. http://www.ftdichip.com/Drivers/3rdPartyDrivers.htm
  5. serproxy: http://www.lspace.nildram.co.uk/freeware.html
  6. ser2net: http://ser2net.sourceforge.net
  7. Java Comm Serial API How-To for Linux: http://wass.homelinux.net/howtos/Comm_How-To.shtml
This entry was posted in General, Linux, openSuSe and tagged , , , , , , , , . Bookmark the permalink.

One Response to Arduino IDE on 64bit openSUSE

  1. Pingback: Lars Jansen » Huge index of Arduino & Freeduino Knowledge

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>