Go Down

Topic: Problems with 0021 on Ubuntu 10.04 Lucid Lynx (Read 28 times) previous topic - next topic

rgm

Oct 03, 2010, 08:41 am Last Edit: Oct 03, 2010, 09:29 am by rgm Reason: 1
I'm having serious problems with 0021 under Ubuntu 10.04 Lucid Lynx.
I seem to only be able to upload code once, then if I plug/unplug the Uno I can never get serial communication to work with it again (or maybe it has to do with the program it's running, see below).

dmesg shows that every time I plug my Arduino in it *is* registering as /dev/ttyACM0.  Every plug/unplug increases the address:
Code: [Select]

[ 1008.289135] usb 3-1: USB disconnect, address 2
[ 1010.764454] usb 3-1: new full speed USB device using uhci_hcd and address 3
[ 1010.961880] usb 3-1: configuration #1 chosen from 1 choice
[ 1010.964741] cdc_acm 3-1:1.0: ttyACM0: USB ACM device

Then, a bit later:
Code: [Select]

[ 1095.042640] tty_port_close_start: tty->count = 1 port count = 0.
[ 1140.802645] tty_port_close_start: tty->count = 1 port count = 0.
[ 1164.386670] tty_port_close_start: tty->count = 1 port count = 0

(not sure if that matters)

Furthermore, the IDE acts very unfriendly when trying to activate the "Tools" menu.  There is a 5-6 second delay during which the GUI locks up (menus should never block the main thread!), then the menu appears with the "Serial Port" option greyed out (I have no other serial ports in my system).  During this delay, a user is apt to click twice -- which causes the menu to instantly disappear after it finally appears.

I tried using RXTX 2.2 (unstable) but that didn't help.

My troubles seemed to start after I loaded some Serial.print() statements into my setup() function (after a Serial.begin of course).  The TX light is steady-on -- I've made a typo in the setup() routine and the arduino is stuck in an infinite Serial.print("*") loop -- this is verifiable by using minicom to connect to the port -- when minicom feels like opening the port.  Most of the time it says:

minicom: cannot open /dev/ttyACM0: No such file or directory

Does anyone have any suggestions?

rgm

#1
Oct 03, 2010, 08:45 am Last Edit: Oct 03, 2010, 10:37 am by rgm Reason: 1
Update:  I was finally able to upload new code to the board by repeatedly clicking the Upload button, and ignoring the /dev/ttyACM0 errors.  On the 4th or 5th click it worked, and my Arduino is no longer stuck in an infinite Serial.print loop, which makes it behave much better.

In summary, Arduinos that have programs that stream out serial data are very difficult to program / work with, even outside of the IDE, as evidenced by minicom's issues.

cr0sh

Quote
In summary, Arduinos that have programs that stream out serial data are very difficult to program / work with, even outside of the IDE, as evidenced by minicom's issues.


Probably the best way to handle this is to insert a pause in your setup before initiating the serial setup and such.

Another (and possibly better) alternative would be to set things up so that you can send a command to start/stop the streaming (and store the setting in the EEPROM); that way, you could turn off the streaming before doing a new upload, then re-enable it for your testing.
I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

rgm

Yes, I ended up adding code to not start the streaming until told to, but once the streaming starts, it still causes undesirable behavior on the computer side of things -- the serial port is "unavailable" most of the time, at the OS level.  I can't help but think that this means that the 8u2 on the Arduino Uno needs some smarter code on it, but I haven't had a chance to verify how FTDI Arduinos function in this situation.  Maybe they suffer from the same "limitation."

As a naive user, I would expect the port to always be available regardless of whether the uC was streaming serial data or not.

In any case, the IDE shouldn't hang for so long looking for ports every time the "Tools" menu is clicked.

cr0sh

Quote
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 will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

Go Up