Arduino not detected on USB port

Bug #1054988 reported by Victor Engmark
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
arduino (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

My original Arduino Uno R3 is detected by the kernel when connected to a USB port:

$ tail -2 /var/log/kern.log
kernel: [ 611.954962] usb 8-1: new full-speed USB device number 5 using uhci_hcd
kernel: [ 612.158006] cdc_acm 8-1:1.0: ttyACM0: USB ACM device

The device is created:

$ ls -la /dev/ttyACM0
crw-rw---- 1 root dialout 166, 0 Sep 23 14:08 /dev/ttyACM0

I have read/write access to the device (I just rebooted, so the groups are current):

$ groups | grep -o '\bdialout\b'
dialout

I can talk to the device - The following command results in reboot-like activity on the Arduino built-in LEDs:

$ echo ciao > /dev/ttyACM0

At this point, however, I'm not able to use this device with the Arduino IDE:

1. Tools -> Serial Port is grayed out

2. When starting arduino from the command line, there's a RXTX version mismatch:
$ arduino
Stable Library
=========================================
Native lib Version = RXTX-2.2pre2
Java lib Version = RXTX-2.1-7
WARNING: RXTX Version mismatch
 Jar version = RXTX-2.1-7
 native lib Version = RXTX-2.2pre2

3. Trying to upload a program results in the following error message:
processing.app.SerialNotFoundException: Serial port 'COM1' not found. Did you select the right one from the Tools > Serial Port menu?
 at processing.app.Serial.<init>(Serial.java:153)
 at processing.app.Serial.<init>(Serial.java:76)
 at processing.app.debug.Uploader.flushSerialBuffer(Uploader.java:75)
 at processing.app.debug.AvrdudeUploader.uploadViaBootloader(AvrdudeUploader.java:88)
 at processing.app.debug.AvrdudeUploader.uploadUsingPreferences(AvrdudeUploader.java:66)
 at processing.app.Sketch.upload(Sketch.java:1664)
 at processing.app.Sketch.exportApplet(Sketch.java:1624)
 at processing.app.Sketch.exportApplet(Sketch.java:1578)
 at processing.app.Editor$DefaultExportHandler.run(Editor.java:2314)
 at java.lang.Thread.run(Thread.java:679)

The first symbolic link workaround proposed at http://andypiper.co.uk/2010/12/21/prototyping-arduino-and-ubuntu/ works:
$ sudo ln -s /dev/ttyACM0 /dev/ttyUSB0

Now I can see /dev/ttyUSB0 in Arduino IDE, and I'm able to upload programs despite the RXTX version mismatch.

The second workaround proposed at the same place did *not* work. After applying it and rebooting:

$ cat /etc/udev/rules.d/80-arduino-uno.rule
KERNEL=="ttyACM*", ATTRS{product}=="Arduino*", SYMLINK+="ttyUSB%n"

$ ls -l /dev/ttyACM0 /dev/ttyUSB0
ls: cannot access /dev/ttyUSB0: No such file or directory
crw-rw---- 1 root dialout 166, 0 Sep 23 14:22 /dev/ttyACM0

Could it be that it's not recognized as an Arduino device?

$ lsusb | grep --ignore-case arduino || echo none
none

However:
$ sudo lsusb -v | grep --ignore-case arduino || echo none
  iManufacturer 1 Arduino (www.arduino.cc)

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: arduino 1:1.0+dfsg-9
ProcVersionSignature: Ubuntu 3.2.0-31.50-generic 3.2.28
Uname: Linux 3.2.0-31-generic x86_64
ApportVersion: 2.0.1-0ubuntu13
Architecture: amd64
Date: Sun Sep 23 14:05:30 2012
InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Release amd64 (20120425)
PackageArchitecture: all
ProcEnviron:
 LANGUAGE=en_US:en
 TERM=xterm
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: arduino
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Victor Engmark (victor-engmark) wrote :
Revision history for this message
Victor Engmark (victor-engmark) wrote :

Also, running arduino as root did not help, as suggested elsewhere <http://blog.markloiseau.com/2012/05/install-arduino-ubuntu/>.

Revision history for this message
Victor Engmark (victor-engmark) wrote :

Installing the latest official Arduino IDE <http://arduino.googlecode.com/files/arduino-1.0.1-linux64.tgz> did not help either - The Serial Port menu is still grayed out.

Revision history for this message
Scott Howard (showard314) wrote : Re: [Bug 1054988] Re: Arduino not detected on USB port

Thanks for the thorough debugging
It looks like something is screwed up with your RXTX

 Native lib Version = RXTX-2.2pre2
  Java lib Version = RXTX-2.1-7
  WARNING: RXTX Version mismatch
        Jar version = RXTX-2.1-7
        native lib Version = RXTX-2.2pre2

means that somehow the library is coming from the wrong place (it
looks like it's either from a combination of an official arduino.cc
package and a debian/ubuntu package, or a mismatched debian & ubuntu
package). The RXTX version 2.1-7 is unable to detect /dev/ttyACM*
because support was added in a later patch. Ubuntu has not had version
2.1.7 since lucid (~2 years ago) but arduino.cc still uses a patched
rxtx 2.1.7, so you probably have an extra rxtx java library floating
around your system that is conflicting with your system libraries.

I'd suggest $sudo apt-get remove librxtx-java and look for
RXTXcomm.jar on your system, maybe in /usr/share/java/RXTXcomm.jar or
in some other folder if you downloaded files from arduino.cc? If you
find it, mv it somewhere else or rename it, then try installing
arduino again $sudo apt-get install arduino.

Revision history for this message
Victor Engmark (victor-engmark) wrote :

$ sudo apt-get remove librxtx-java
$ sudo updatedb
$ locate RXTXcomm.jar
/home/username/bin/arduino-1.0.1/lib/RXTXcomm.jar
/usr/lib/jvm/java-6-openjdk-amd64/jre/lib/ext/RXTXcomm.jar

The first one is accounted for - It's the downloaded Arduino IDE. The second is of unknown origin:

dpkg --search /usr/lib/jvm/java-6-openjdk-amd64/jre/lib/ext/RXTXcomm.jar
dpkg-query: no path found matching pattern /usr/lib/jvm/java-6-openjdk-amd64/jre/lib/ext/RXTXcomm.jar.

Googling this path finds *no* results. Is there any other way it could be related to an installed package? I usually only install software with apt-get. There's another interesting file in the same directory:

$ cat /usr/lib/jvm/java-6-openjdk-amd64/jre/lib/ext/javax.comm.rxtx.properties
javax.comm.rxtx.SerialPorts=/dev/ttyS0:/dev/ttyS1:/dev/ttyUSB0:/dev/ttyUSB1

Looks like it accounts for why Arduino IDE doesn't list /dev/ttyACM0. This file is also unknown to dpkg.

Moving these away and reinstalling Arduino strangely does not work:
$ sudo mv /usr/lib/jvm/java-6-openjdk-amd64/jre/lib/ext/RXTXcomm.jar{,.bak}
$ sudo mv /usr/lib/jvm/java-6-openjdk-amd64/jre/lib/ext/javax.comm.rxtx.properties{,.bak}
$ sudo apt-get purge arduino
$ sudo apt-get install arduino
$ sudo updatedb
$ locate RXTXcomm.jar
/home/username/bin/arduino-1.0.1/lib/RXTXcomm.jar
/usr/lib/jvm/java-6-openjdk-amd64/jre/lib/ext/RXTXcomm.jar.bak
/usr/share/arduino/lib/RXTXcomm.jar
/usr/share/java/RXTXcomm.jar
$ arduino
Stable Library
=========================================
Native lib Version = RXTX-2.2pre2
Java lib Version = RXTX-2.1-7
WARNING: RXTX Version mismatch
 Jar version = RXTX-2.1-7
 native lib Version = RXTX-2.2pre2

Revision history for this message
Scott Howard (showard314) wrote :

On Sun, Sep 23, 2012 at 12:46 PM, l0b0 <email address hidden> wrote:log
> Moving these away and reinstalling Arduino strangely does not work:
> $ sudo mv /usr/lib/jvm/java-6-openjdk-amd64/jre/lib/ext/RXTXcomm.jar{,.bak}
> $ sudo mv /usr/lib/jvm/java-6-openjdk-amd64/jre/lib/ext/javax.comm.rxtx.properties{,.bak}
> $ sudo apt-get purge arduino
> $ sudo apt-get install arduino
> $ sudo updatedb
> $ locate RXTXcomm.jar
> /home/username/bin/arduino-1.0.1/lib/RXTXcomm.jar
> /usr/lib/jvm/java-6-openjdk-amd64/jre/lib/ext/RXTXcomm.jar.bak
> /usr/share/arduino/lib/RXTXcomm.jar
> /usr/share/java/RXTXcomm.jar
> $ arduino
> Stable Library
> =========================================
> Native lib Version = RXTX-2.2pre2
> Java lib Version = RXTX-2.1-7
> WARNING: RXTX Version mismatch
> Jar version = RXTX-2.1-7
> native lib Version = RXTX-2.2pre2
>

I too couldn't find where that is coming from in
/usr/lib/jvm/java-6-openjdk-amd64/jre/lib/ext, it's not listed in
ubuntu nor debian.

here are mine from a precise system:
showard@esc-303123:~$ locate RXTXcomm.jar
/usr/share/arduino/lib/RXTXcomm.jar
/usr/share/java/RXTXcomm.jar

in a clean Ubuntu system it is the same as well

> WARNING: RXTX Version mismatch
> Jar version = RXTX-2.1-7
> native lib Version = RXTX-2.2pre2

looks like your problem is that it is still using the wrong
RXTXcomm.jar. Maybe /home/username/bin/arduino-1.0.1/lib is in the
java search path somehow? You should be using
/usr/share/java/RXTXcomm.jar then the warning would not show up.

Try renaming /home/username/bin/arduino-1.0.1/lib/RXTXcomm.jar

Revision history for this message
Victor Engmark (victor-engmark) wrote :

$ mv ~/bin/arduino-1.0.1/lib/RXTXcomm.jar{,.bak}
$ arduino
Stable Library
=========================================
Native lib Version = RXTX-2.2pre2
Java lib Version = RXTX-2.1-7
WARNING: RXTX Version mismatch
 Jar version = RXTX-2.1-7
 native lib Version = RXTX-2.2pre2

And no serial device.

Revision history for this message
Scott Howard (showard314) wrote :

On Mon, Sep 24, 2012 at 12:21 PM, l0b0 <email address hidden> wrote:
> $ mv ~/bin/arduino-1.0.1/lib/RXTXcomm.jar{,.bak}
> $ arduino
> Stable Library
> =========================================
> Native lib Version = RXTX-2.2pre2
> Java lib Version = RXTX-2.1-7
> WARNING: RXTX Version mismatch
> Jar version = RXTX-2.1-7
> native lib Version = RXTX-2.2pre2
>
> And no serial device.

Thanks again, unfortunately I can't reproduce it - and I expect that
arduino IDE won't see any Arduino Uno or later board as long as you
get that java RXTX warning. The mismatch is worrisome too. It's not a
bug in ubuntu, though, since ubuntu hasn't had that jar version 2.1-7
in over two years, I'm still stumped how that got on your system and
where it is hiding...

Revision history for this message
Victor Engmark (victor-engmark) wrote :

It looks like a reboot was necessary after moving the RXTX libraries away - It works fine now. Thank you very much for the help!

Revision history for this message
Scott Howard (showard314) wrote :

Awesome! I'm very happy to hear it got worked out, closing the bug.

Changed in arduino (Ubuntu):
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.