Arduino Uno with ArchLinux (3.8.4-1-ARCH)

I quickly explain how to make your arduino card works with your ArchLinux distrib by patching and installing the last version of rxtx.

Step 1 : Arduino package

Install the aur arduino package using the well known and loved binnary : yaourt.

yaourt -S arduino

Step 2 : Download, patch and install rxtx

Download the pre-release zip from http://rxtx.qbang.org/wiki/index.php/Download :

wget http://rxtx.qbang.org/pub/rxtx/rxtx-2.2pre2.zip
unzip rxtx-2.2pre2.xip
cd rxtx-2.2pre2

Launch configure with the --disable-lockfile option :

./configure --disable-lockfile

Here, if you try to compile, you’ll probably have a UTS_RELEASE undefined error. To correct that, first locate the file utsrelease.h(find /usr/ -name 'utsrelease.h'). In my case, it is located in /lib/modules/3.8.4-1-ARCH/build/include/generated/. Then, include this file to config.h (It’s a file generated by configure.) , so that that constant will be defined everywhere.

echo "\n#include \"/lib/modules/3.8.4-1-ARCH/build/include/generated/utsrelease.h\"\n" > config.h

Now, we have to add the ttyACMx devices to the list of checked devices. We just need to modify the file src/gnu/io/RXTXCommDriver.java, and add an entry into an array (ttyACM). See the diff file here :

--- src/gnu/io/RXTXCommDriver.java.back 2013-03-31 14:14:38.718567087 +0200
+++ src/gnu/io/RXTXCommDriver.java      2013-03-31 14:08:38.728149384 +0200
@@ -577,6 +577,7 @@
                                                "ttyS", // linux Serial Ports
                                                "ttySA", // for the IPAQs
                                                "ttyUSB", // for USB frobs
+                                               "ttyACM",// linux CDC ACM devices
                                                "rfcomm",       // bluetooth serial device
                                                "ttyircomm", // linux IrCommdevices (IrDA serial emu)
                                                };

The line marked with a plus is the one added.

Then, compile and install!

make && sudo make install

Use your arduino

You can now launch the arduino IDE (command arduino) and upload a test sketch (like blink). You can select your arduino uno wich will probably show as “ttyACM0” in the device list.

Some informations

We disable the flag --diseable-lockfile so that errors messages diseapear speaking about the impossibility to write lock files. We also added the right .h file containing UTS_RELEASE to remove stupid compiling errors (the file in wich the macro is defined changed recently). To finish, we had to modify rxtx’s code (read the comments, they ask you to add missing devices) so that you can use ttyACMx. An other solution would be to add a symbolic link in /dev/ from a ttyUSBx to a ttyACMx.

Anyway, if you can’t use your arduino, and you have an error of the style processing.app.SerialNotFoundException: [..] « /dev/ttyACM0 » not found, it’s probably that ttyACM is not in the list of rxtx’s devices.

References :