Go Down

Topic: Arduino on Linux (Read 61235 times) previous topic - next topic


just to put it on the record:

arduino0003 works without problems under linux.
thanks a lot !



On linux 2.6.x:

# modprobe ftdi_sio

# echo ftdi_sio >> /etc/modules


welcome fab

that was fast... you got the board 1 day ago :)




last week in Barcelona we managed to install Arduino on several linux boxes: ubuntu, knoppix, max2.0, debian (raw), etc.

The good news are that Eric's tutorial applies almost step by step to each one of them. The bad news are that ubuntu and debian won't bring Java and that is not cool.

We had endless problems to fix this also because RXTX (from www.rxtx.org), the library that we use for the serial communication, had serious problems to talk to the latest javaComm (version 3). We are happy to announce that RXTX has developed version 2.1.7 of their software that fixes any problems and leaves javaComm out of the picture.

The only problem I found was to get a serial port monitor that would allow us to send data down to the board, any ideas?



Feb 11, 2006, 04:48 pm Last Edit: Feb 11, 2006, 06:45 pm by fab Reason: 1
I suggest append to make.sh

Code: [Select]

if [ ! -d work/tools/avr/bin/ ]
   mkdir -p work/tools/avr/bin/
   cd  work/tools/avr/bin/
   for i in avr-gcc  avr-objcopy  avr-objdump  avr-size  uisp
              ln -s ${DIRAVR}/bin/${i}

My 10 Euro cent!


Updated installation method by people at Riereta.Net. Taken from:


Thanks acracia and dddani for it


- - - - --

1. apt-get install subversion

2. getting arduino package sources:
download the latest version of arduino cvs with subversion:
~/ svn checkout svn://svn.berlios.de/arduino/trunk
we will come back to this directory later

3. apt-get install gcc-avr avr-libc jikes uisp

4. install jre*your version_number* (java.com) de http://www.java.com/es/download/manual.jsp and put it into the /usr/lib firectory

5. install rxtx for Java:
- - - - - - - -
Installing RXTX
First, obtain the RXTX binaries package with CommAPI from:
take the latest version for linux
Decompress and Untar this package:
~/ cp gunzip rxtx-2.1-7pre17-i686-pc-linux-gnu.tar.gz
~/tar xf rxtx-2.1-7pre17-i686-pc-linux-gnu.tar.gz
At this point, you'll have an rxtx-2.1-7pre17-i686-pc-linux-gnu directory. Next, you'll need to copy the shared objects into your java installation:
~/cp rxtx-2.1-7pre17-i686-pc-linux-gnu/librxtxParallel.so /usr/lib/jre*your version_number*/lib/i386
~/cp rxtx-2.1-7pre17-i686-pc-linux-gnu/librxtxSerial.so /usr/lib/jre*your version_number*/lib/i386
If you are installing on an architecture other than an x86, you'll need to adjust both the /i386-pc-linux/ and the /i386/ accordingly.

Next, you'll need to install the RXTXcomm.jar file:

~/cp rxtx-2.1-7pre17-i686-pc-linux-gnu/RXTXcomm.jar /usr/lib/jre*your version_number*/lib/ext/

At this point, the RXTX installation is complete.

We are almost finished. We just need to create the properties file that the Comm API will use to load the drivers (.so files). To create this file, type the following command:

~//bin/echo Driver=gnu.io.RXTXCommDriver > /usr/lib/jre*your version_number*/lib/javax.comm.properties
~//bin/echo Driver=gnu.io.RXTXCommDriver > /usr/lib/j2se/1.4/jre/lib/javax.comm.properties

~/ln -s /dev/ttyUSB0 /dev/ttyS99

If you don't have the /dev/ttyUSB0, do

~/ modprobe ftdi_sio

If you don't have it, then you have to give to your kernel support to usbhid and libftdi.

Device Drivers ---> USB support ---> USB Serial Converter support ---> USB FTDI Single Port Serial Driver (EXPERIMENTAL)

Congratulations! You have installed the Linux Comm API.
- - - - - - -

6. add the path to java/bin and rt.jar to your CLASSPATH:
in my case this looks like:

export CLASSPATH=/usr/lib/jreyour_version_number/bin:/usr/lib/jreyour_version_number/lib/rt.jar

7. you can check on this variables with the "env" command
note that as soon as you close your xterm this settings are gone. for a tutorial on environment variables
look at: http://www.dynamic-apps.com/tutorials/classpath.jsp

8. go back to arduino svn directory:

~/ cd to trunk/build/linux

9. compile it:

~/ ./make.sh

10. go to work directory

~/ cd work

11. create binaries directory

~/ mkdir -p tools/avr/bin/

12. create symbolic links to the programs arduino uses to compile

~/ cd tools/avr/bin/

~/ ln -s /usr/bin/avr-gcc avr-gcc ;
ln -s /usr/bin/avr-objcopy avr-objcopy ;
ln -s /usr/bin/avr-objdump avr-objdump ;
ln -s /usr/bin/avr-size avr-size ;
ln -s /usr/bin/uisp uisp ;

13. go back to /trunk/build/linux/ folder

~/ cd ../../../../

Per executar arduino

~/ ./run.sh

14. for having the comm.api driver always properly set, change your bash configuration file:

~/ vi /root/.bashrc

and add

/bin/echo Driver=gnu.io.RXTXCommDriver > /usr/lib/jre*your version_number*/lib/javax.comm.properties


i have two arduino board-USB on LINUX-debian kernel 2.6.15-4
-one with resistor 1/4w , go well
-one (newer) whis resistor SMD . this board can download a compiled program but can ejecut it.
¿ have you got idea about problem ?


Jun 28, 2006, 05:17 pm Last Edit: Jun 28, 2006, 05:34 pm by ICEM4N Reason: 1
Hi, Working on a Ubuntu Dapper, i have jre installed since i work with Eclipse and NetBeans for different java projects.

I managed to run the IDE and "compile", but when i try to upload the sketch|program to the board it freezes, the IDE freezes. If i try to "burn the bootloader" (i was trying if something works) it freezes too. The only way to close that window is clossing the terminal from the IDE was create (it doesn¡t respond at anything but i could move the window)

I think that is my version of jre (1.5 of sun - yeah it sucks, but blackdown only has 1.4 version)
More info :
I put a led over pin 13 and GND, it start bliking (i thougth the led_blik_tutorial was loaded from "fabric") I run the IDE, change the led_blik_tutorial to hold the led on for 2 seconds. I reset the board y hit "Upload button" after 8 seconds (more or less) it start bliking like at first, no changes were made. RX and TX led's do nothing. (i try this on the two usb-board i buy)

This was my shell output
nodani@noworld:~/arduino/build/linux$ ./run.sh
Stable Library
Native lib Version = RXTX-2.1-7pre17
Java lib Version   = RXTX-2.1-7
WARNING:  RXTX Version mismatch
       Jar version = RXTX-2.1-7
       native lib Version = RXTX-2.1-7pre17
RXTX Warning:  Removing stale lock file. /var/lock/LCK..ttyUSB0

Binary sketch size: 5238 bytes (of a 7168 byte maximum)

How i could make it work?



Thanx to all the Arduino Linux guys for describing their installation steps. I'm running a AMD64 Ubuntu 5.10 and noticed some small differences so I made a document discribing the steps I did to get Arduino up and running: http://yuri.at/go/?page_id=35

@ICEM4N: could it be that you have another RXTX copy installed somewhere, see this similar error message from Processing:  http://processing.org/faq/bugs.html#serial


Thx, following this guide http://riereta.net/tiki/tiki-index.php?page=PdInstallationArduino and makingsome minor changes it worked! (Ubuntu dapper 6.06 -updated from breezy 5.10 )


The arduino board comes pre-programmed with the led blinking program.


hi i was following the installation instruction on the post above without any trouble but as soon as i do ./run.sh i get this error:
olsen@ll-928:~/lab/arduino/trunk/build/linux$ ./run.sh
Exception in thread "main" java.lang.NoClassDefFoundError: processing.app.Base
  at gnu.java.lang.MainThread.run(libgcj.so.7)
Caused by: java.lang.ClassNotFoundException: processing.app.Base not found in gnu.gcj.runtime.SystemClassLoader{urls=[file:lib/,file:lib/build/,file:lib/pde.jar,file:lib/antlr.jar,file:lib/oro.jar,file:lib/registry.jar,file:lib/mrj.jar,file:lib/RXTXcomm.jar], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
  at java.net.URLClassLoader.findClass(libgcj.so.7)
  at java.lang.ClassLoader.loadClass(libgcj.so.7)
  at java.lang.ClassLoader.loadClass(libgcj.so.7)
  at java.lang.Class.forName(libgcj.so.7)
  at gnu.java.lang.MainThread.run(libgcj.so.7)
any clue around?


I'm having trouble installing Arduino, because of the lack of Java in Ubuntu... I'm really not an expert with Linux, but would it be possible to have Arduino be stand-alone in the same way that Processing is?


Hey all,

I hope people are still watching this thread.

#1. I'm trying to get arduino working on debian/etch using only packages available from repos (java from blackdown, as well as rxtx) I had package issues with 1.4 so I'm using 1.3 right now. I'm currently getting stuck with Jikes could not find package "java.lang" in it is not provided by any of the java packges I see.

#2. Due to the "fun" of java I would greatly perfer a non java dependant version of arduino for linux. probably just a few scripts would do it, "arduino_upload" "arduino_download" "arduino_compile" and I guess a serial debugger... I've gone somewhere on this but even things like uuisp are not working quite so well:

uisp -dserial=/dev/ttyUSB0 -dspeed=9600 --download of=~/Projects/Arduino/test.pde -dprog=stk500 -dpart=ATmega8 -v=3

Programmer is not responding.

I saw somewhere on the playground that arduino uses the stk500. I was able to get a little more luck (downloading what I think is the firmware) using:

uisp -dserial=/dev/ttyUSB0 --download of=~/Projects/Arduino/test.pde -dprog=dasa -dpart=ATmega8 -v=3

Reset inactive time (t_reset) 1000 us
AVR Direct Parallel Access failed after 32 retries.
Override signature bytes, device ATmega8 assumed.
Vendor Code: 0x1e
Part Family: 0x93
Part Number: 0x07
Atmel AVR ATmega8 is found.
Downloading: flash

Is there a more simple guide than http://www.arduino.cc/playground/Learning/BuildProcess on what the arduino IDE actually does?



I was able to fix the "java.lang" problem by editing the CLASSPATH to find rt.jar

So thats all I can do since the output is meaningless to me. Looks like I can't attach it to this post: http://b.goto10.org/misc/arduino_make.sh_output.txt

./run.sh gives me:

Exception in thread "main" java.lang.NoClassDefFoundError: processing/app/Base

Ok, looks like for some reason the make.sh script creates the work directory is such a way that it is not writible by the regular user?? so I did this:

sudo chown -R bbogart trunk/
sudo chgrp -R bbogart trunk/

looks like the svn make.sh script refers to something not in svn:

Extracting examples...
unzip:  cannot find or open ../shared/dist/examples.zip, ../shared/dist/examples.zip.zip or ../shared/dist/examples.zip.ZIP.

I'm guessing these java erros are due to my old 1.3 version, off to try some different packages...

so I've switched to blackdown 1.4 and It seems to compile! It would be nice for the makefile to print out "success" or something when it works, since I did not realize it with all the errors.

I build with DIRAVR=/usr so that the build could find the avr compiler. Now when I run the environment ./run.sh it says it can't find the compiler but it is in my path:

which avr-g++

I'll post this and followup on the next steps.

Go Up