In any case, the IDE shouldn't hang for so long looking for ports every time the "Tools" menu is clicked.
I don't remember where, but somewhere on this forum, I recall somebody either finding and posting where this occurs on the java source, and/or a patch (which I think they submitted upstream)...
I'm having the same problem with 0021 under Ubuntu 10.04 Lucid and Arduino boards (both Uno and Duemilanove).
Serial communication from the Arduino board locks up the IDE and other serial monitors won't recognize the port - if I unplug the board the IDE comes back online. The IDE locks up so bad that I can't upload other sketches - I had to move to a mac (with 0021) to comment out the Serial.print(); in the offending code. Once that was removed I was able to go back my linux machine and everything worked fine.
The IDE locks up so bad that I can't upload other sketches - I had to move to a mac (with 0021) to comment out the Serial.print(); in the offending code.
In my experience the IDE didn't lock up for longer than 6 seconds -- go slow and be patient (and don't click the Tools menu). I was able to reprogram it from linux by repeatedly clicking the "Upload" button a few times (waiting between clicks), ignoring the error about /dev/ttyACM0 -- it got through eventually.
As I mentioned before, I suspect that the code running on the new Atmega8u2 chip on the Arduino Uno boards is to blame, simply because there are problems accessing the port outside of the Arduino IDE entirely (verified with minicom). Perhaps it's only using half-duplex serial, so while it's busy sending it can't do anything else -- that's just a guess though. I suppose the bootloader (optiboot) might be involved too, but now I'm really taking shots in the dark.
The FTDI based boards don't seem to run into this problem because it appears that they don't stream out serial data unless the port is accessed. On my Arduino Duemilanove, with the following code:
The LED blinks whenever the board has power, but the TX light only goes on when the port is accessed with the serial monitor, minicom, or "cat < /dev/ttyUSB0". The means that the FTDI based arduinos are not subject to this issue -- they're able to be reprogrammed easily, even if they contain a program that hammers the serial port. The Arduino Uno behaves differently in that the TX light is always on.
Like an idiot I did it again (tight Serial.print loop) -- but this time I've had no luck repeatedly smashing the "Upload" button in the IDE -- I guess the delay in the code is too small for me to "catch" it. I can no longer reprogram the Uno since it won't listen to me / present the OS with a working port for long enough to talk to it.
I'll try again on Windows or Mac later this week.
Edit (an hour later): This got me past my "bricked" condition, but after intentionally re-bricking I could not duplicate its success, so I think it was coincidence.
(IDE is open)
Step 1: rm /var/lock/LCK..ttyACM0
Step 2: Click "upload" again.
I put optiboot on a Duemilanove and it still works fine in this scenario, so it's not the bootloader.
It's a pretty serious usability regression compared to the Duemilanove. I hope they're focused on releasing the code for the 8u2 chip so that some progress can be made here in the community (although apparently the community of Linux Arduino Uno users is very small and non-vocal?)
I feel frustrated and with ever dimming hope of a solution.
I don't have a good understanding of what's going on here, so I'm hoping someone from the community can help figure out a good fix. The code for the 8U2 has been available since the Uno started shipping. It's in the hardware/arduino/firmwares directory of the release and online here: http://github.com/arduino/Arduino/tree/master/hardware/arduino/firmwares/. Maybe we can find a change that stops the 8U2 firmware from relaying serial data until a program on the computer opens the port?
Upload works 1 time out 7-9 times, serial monitor never (I use gtktty).
I use Ubuntu 10.04
mune@lello:~$ uname -a
Linux lello 2.6.32-25-generic #44-Ubuntu SMP Fri Sep 17 20:26:08 UTC 2010 i686 GNU/Linux
and, despite the CPU is an AMD 64 dual core, it is a 32 bit system (more software).
The only non-standard thing is that I use already a USB-serial converter (/dev/ttyUSB0) to communicate with a little UPS; the system for my arduino uno creates a /dev/ttyACM0 device.
I use the latest (0.21) IDE
mune@lello:~/Apps/arduino-0021$ ./arduino
Experimental: JNI_OnLoad called.
Stable Library
=========================================
Native lib Version = RXTX-2.1-7
Java lib Version = RXTX-2.1-7
I have the same problem.
My arduino uno works well on my Mac and in windows 7 on parallels.
But on my desktop with Ubuntu 10.04 no!
I use 10.04 because is the LTS version.
The launchpad.net/~arduino-ubuntu-team/ version is a old version and don't have Arduino Uno interface.
After i connect arduino to USB Port and open 0021 the menus, like tools, are really slow to open. More than 15sec..
Add me to the list. My Duemilanove has/had no issues. Just got an Uno, and I'm seeing all of the same things. Uploads are now through ACM instead of USB, Tools menu is very sluggish. However, repeating does not ever seem to push the program through. The TX button seems to be permanently lit, and after each try, I have to delete the lock file from /var/lock and reselect ACM from Tools.
I'm running 10.04 as well. Suggestions would be very much appreciated!
Just don't call it in a tight loop. Or you can hold down the reset button for a while (maybe while unplugging and replugging the board) to upload again.
Suggestions welcome. I'm not really sure why this is happening on Linux.
Mee too. Ubuntu 9.10. IDE freezes to 10-15 secs & manages to find nothing.
The best thing about arduino - easy debug through serial port is now pertty much unusable! ( Can compare with Duemilanove with the same sketch ). I want Duemilanove back !!!! >:(
Upd: Adding delay(1000) in setup() made the problem less painful for now.., but still ....
I'm going to add to this, Ubuntu 9.1: Arduino Mega 2560.
It takes 10 seconds + to open the tools menu and the correct serial port randomly appears and disappears each time I try to open it (appears as /dev/ttyACM0).
It seems to me to be some sort of deadlock between the arduino writing to the serial port and the program trying to access the serial port.
I've got a Maxbotix sonar and servo setup outputting ranging values to serial as they are taken.
Here's some things I noticed that may or may not have anything to do with the problem:
cat < /dev/ttyACM0 sometimes works but sometimes gives: /dev/ttyACM0: Input/output error This almost seems random but does seem to work more often when the servo is at or near 0 degrees I.e when it's near the top of the loop and hasn't done much yet, (a buffer problem?).
-Occasionally cat < /dev/ttyACM0 will capture the last few values from the program before resetting the board and working correctly. Sometimes cat < /dev/ttyACM0 will reset the board and start reading from the top of the loop, sometimes it will simply start reading without reseting.
The tx light is permanently on when not reading from the serial port but rapidly blinks when reading from it.
No idea if any of that is helpful to anyone I'm pretty new to all this.
Just a suggestion (I don't have any uno boards yet)
How about hitting the reset button on the board just before clicking the upload icon. That way the board will already be going through a reset cycle and won't have had time to do any serial stuff.
i've had the last few days many of the probs of others in this thread and i've tried many things / tips found here and otherwhere. The solution for my prob is "hidden" in an "older" thread in this forum: put-the arduino-cc-FQDN-here/cgi-bin/yabb2/YaBB.pl?num=1228315338
Setting the serial.debug_rate=9600 (which was atm 38400, possibly a relict of testing something) solved all my problems.
My environment with the problems:
Kubuntu 10.04
Arduino UNO
Arduino-IDE 0021
Greetz
Thomas
P.S Excuse my english
P.P.S because of that this is my first post here, it isn't allowed to post active links
I look forward to trying this with my Arduino Uno, but note that you appear to have a Diecimila since your USB port is /dev/ttyUSB?. The Arduino Uno serial port device is /dev/ttyACM?. I have no problems with my Diecimila, only my Uno.