Arduino IDE on 64 bit Ubuntu Gutsy and Hardy


Arduino IDE on 64 bit Ubuntu Gutsy and Hardy

Arduino is an open-source electronics prototyping platform. It is a chip you can program, connect sensors, motors and leds.

I describe how I successfully installed and run Arduino IDE on 64 bit Ubuntu Gutsy and Hardy. I did not compile any Arduino code and I did not connect an actual Arduino chip to computer. I later used this setup to develop machines using the Arduino chip and it worked fine.

Update 2009-01-24: Arduino 0012 amd64 Linux seems work out of the box on 64 bit Ubuntu 8.04 Hardy. You just need to install requirements, but not modify Arduino IDE itself. This is based on just initial testing.

See also: Sulautetut.fi – learning embedded systems with Arduino (in Finnish / suomeksi).

© 2007-2009 Tero Karvinen – GNU General Public License, version 2 or later



Install Requirements

Install the requirements recommended in the official Arduino homepage:

$ sudo aptitude install sun-java5-jre gcc-avr avr-libc

Choose Sun Java, Arduino does not yet work with GNU Java:

$ sudo update-alternatives --config java

Install 32 bit compatibility libraries and Java serial connection libraries:

$ sudo aptitude install ia32-libs librxtx-java



Install Arduino IDE

Download and extract arduino-0010-linux.tgz (local mirror) from Arduino Software Download page .

$ wget http://www.iki.fi/karvinen/mirror/arduino-0010-linux.tgz
$ tar -xf arduino*.tgz
$ cd arduino*

Disable Arduino IDE’s built-in serial libraries

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

Correct serial library locations in Arduino startup script.

  • In CLASSPATH, change “lib/RXTXcomm.jar” (the disabled libary) to “/usr/share/java/RXTXcomm.jar” (came with aptitude install librxtx-java).
  • In LD_LIBRARY_PATH, change “`pwd`/lib” (built in libraries) to “/usr/lib” (libraries installed with aptitude)

For your convinience, you can overwrite your arduino startup script with this example

$ nano arduino
#!/bin/sh

CLASSPATH=java/lib/rt.jar:lib:lib/build:lib/pde.jar:lib/core.jar:lib/antlr.jar:lib/oro.jar:lib/registry.jar:lib/mrj.jar:/usr/share/java/RXTXcomm.jar
export CLASSPATH

# put the directory where this file lives in the front of the path, because
# that directory also contains jikes, which we will need at runtime.
PATH=`pwd`/tools:${PATH}
export PATH

# put the directory with the native RXTX libs in the library path
LD_LIBRARY_PATH=/usr/lib:${LD_LIBRARY_PATH}
export LD_LIBRARY_PATH

java processing.app.Base



Run Arduino IDE and Enjoy!

$ ./arduino

Should print

/usr/share/themes/Human/gtk-2.0/gtkrc:71: Engine "ubuntulooks" is unsupported, ignoring
/usr/share/themes/Human/gtk-2.0/gtkrc:242: Priority specification is unsupported, ignoring
Experimental:  JNI_OnLoad called.
Stable Library
=========================================
Native lib Version = RXTX-2.1-7
Java lib Version   = RXTX-2.1-7

And some harmless warnings. Arduino asks you to pick a folder for your projects, then shows an IDE window.

Congratulations, you have successfully installed Arduino IDE!

(I successfully got Arduino IDE window open on amd64 Ubuntu Gutsy on 2007-12-03. I did not compile anything and I did not connect an actual Arduino board to computer.)



Troubleshooting



Can’t load RXTXCommDriver on AMD 64-bit

Also: “wrong ELF class: ELFCLASS32 (Possible cause: architecture word width mismatch)”.

Install 64 bit Java serial libraries with apt, then make arduino use those. Described in the instructions above.

$ ./arduino
java.lang.UnsatisfiedLinkError:
/home/tee/Download/arduino/arduino-0010-linux/arduino-0010/lib/librxtxSerial.so:
Can't load IA 32-bit .so on a AMD 64-bit platform thrown while loading
gnu.io.RXTXCommDriver
Exception in thread "main" java.lang.UnsatisfiedLinkError:
/home/tee/Download/arduino/arduino-0010-linux/arduino-0010/lib/librxtxSerial.so:
Can't load IA 32-bit .so on a AMD 64-bit platform
      at java.lang.ClassLoader$NativeLibrary.load(Native Method)
      at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1751)
      at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1676)
      at java.lang.Runtime.loadLibrary0(Runtime.java:822)
      at java.lang.System.loadLibrary(System.java:993)
      at gnu.io.CommPortIdentifier.<clinit>(CommPortIdentifier.java:83)
      at processing.app.Editor.populateSerialMenu(Editor.java:903)
      at processing.app.Editor.buildToolsMenu(Editor.java:800)
      at processing.app.Editor.<init>(Editor.java:190)
      at processing.app.Base.<init>(Base.java:149)
      at processing.app.Base.main(Base.java:104)



Window can’t be resized, libmawt locking assertion failure

On Ubuntu 8.04 Hardy, compiling and uploading to board works, but window can’t be resized. If you make the window bigger, most it is left as gray, unused area.

Locking assertion failure.
#6 /usr/lib/jvm/java-1.5.0-sun-1.5.0.15/jre/lib/amd64/xawt/libmawt.so(Java_sun_awt_X11GraphicsEnvironment_initDisplay+0x9) [0x7f56409f71c9]

Fix: Install and use Sun Java 6. After this, it worked perfectly.

Some proposed solutions that did NOT work: ‘export LIBXCB_ALLOW_SLOPPY_LOCK=1’, ‘export LIBXCB_ALLOW_SLOPPY_LOCK=true’; ‘export AWT_TOOLKIT=MToolkit’: “Runtime link error – it appears that libXt got loaded before libXm”. Modifying libmawt.so binary with sed.



Command Line

You can also program Arduino with good old command line interface. Then you will not need Java.

http://www.arduino.cc/en/Hacking/CommandLine



Ubuntu 8.04 Hardy

Arduino IDE works perfectly in Hardy with instructions above if you use java-6-sun.

$ sudo aptitude install sun-java6-jdk sun-java6-jre sun-java6-bin
$ sudo update-alternatives --config java   # choose Sun Java 6

I tried these settings with arduino-0011-linux, sun-java6-jre 6-06-0ubuntu1, Ubuntu 8.04.1 hardy on amd64. Arduino IDE worked perfectly: GUI could be resized, sketch could be uploaded to board and run.



References

Arduino Homepage

Sedition 2007-09-26: Arduino Diecimilia on Feisty Fawn – instructions for 32 bit Feisty – that showed out to work on 64 Gutsy!

BlueSun 2007: Arduino-0010 Installed and Running on 7.10 Gutsy AMD64 “I just followed the above instructions to the letter on my new Kubuntu Gutsy 64-bit installation. Everything is functioning properly and I’ve compiled and installed a test sketch on my Arduino NG. ”


Posted in Old Site | Tagged , , , , | Leave a comment

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>

  • Picks

  • Boxing Clock for AndroidOcton8 Diving T-ShirtsShaking Tower Panda Android GameLearn Chinese with Android
  • Student projects