Show Posts
Pages: [1]
1  Development / Other Software Development / IDE should not fail to start without meaningful error report on: February 07, 2014, 12:49:28 pm
Running arduino-1.0.5-r2 under Windows 7/64, the IDE will frequently not start at all. Sometimes it will start up, and then I can code and upload to my arduino until I quit the IDE.

There is an FAQ suggesting that slow startups under Windows are due to slow COM port enumeration, with suggestions to remove devices until the problem goes away. I have no extra or superfluous COM ports in my device manager.

There is no FAQ suggesting what to do if the Arduino splash screen comes up, sits a while, and then vanishes as the program quits without explanation.

I found one suggestion that --log4j-debug could be passed as an argument to arduino.exe. I get this output, but exit code 1 googling turns up only wildly different scenarios, none of which apply to my situation. Here is the content:

CmdLine:   D:\installers\arduino-1.0.5-r2\arduino.exe --l4j-debug
WOW64:      yes
Working dir:   D:\installers\arduino-1.0.5-r2\.
Bundled JRE:   java
Check launcher:   D:\installers\arduino-1.0.5-r2\java\bin\javaw.exe (OK)
Add classpath:   lib\pde.jar
Add classpath:   lib\core.jar
Add classpath:   lib\jna.jar
Add classpath:   lib\ecj.jar
Add classpath:   lib\RXTXcomm.jar
Launcher:   D:\installers\arduino-1.0.5-r2\java\bin\javaw.exe
Launcher args:   -Xms128m -Xmx128m -classpath "lib;D:\installers\arduino-1.0.5-r2\java\lib\tools.jar;lib\pde.jar;lib\core.jar;lib\jna.jar;lib\ecj.jar;lib\RXTXcomm.jar" processing.app.Base
Args length:   170/32768 chars
Exit code:   1


I found another suggestion to see what COM ports show up in the Arduino IDE without an arduino connected... however, also in this case the Arduino IDE will usually not launch to the new sketch screen; just the splash screen, then exit.

Sometimes rebooting solves the problem, and sometimes not. Sometimes I just have to keep launching the IDE until it decides to 'catch.' Sometimes I just have to come back later.

If the program would give some sort of indication of WHY it is choosing to not launch, that would help figure out how to solve the problem. As it is, I have no recourse but to beg for assistance on the forums. Please help!
2  Using Arduino / Installation & Troubleshooting / Re: Uno sending serial data becomes un-connectable to Serial Monitor on: January 27, 2011, 02:14:17 pm
Ok, I couldn't wait until this weekend to try it. IT WORKS! Caloo, Calay, happy day!

Thanks again. :-) I am very much looking forward to working with my fully-functional Arduino Uno now. :-)

3  Using Arduino / Installation & Troubleshooting / Re: Uno sending serial data becomes un-connectable to Serial Monitor on: January 27, 2011, 07:04:12 am
Sweet! Thanks so much. I will try that first thing this weekend during my arduino project time!  smiley-mr-green
4  Using Arduino / Installation & Troubleshooting / Uno sending serial data becomes un-connectable to Serial Monitor on: January 26, 2011, 10:03:07 pm
[I had the bad timing to post this a few hours before the old forum closed. I'm re-posting it here because I would really like to get this issue solved for me and everyone who's had a similar one, from the looks of my search results! I hope this is the correct new area.]

I've had an exceptional amount of difficulty getting the serial monitor working reliably in the arduino software v22 under Ubuntu Linux. It sometimes works if the amount of data coming over is very low or very intermittent (e.g., once per second or slower). First, the background:

I have a new Arduino Uno. It appears to work normally.
I am powering the Arduino over USB (no external power.)
I am using the arduino IDE v22 under Ubuntu Linux ~9.
I'm using java version "1.6.0_22" Java(TM) SE Runtime Environment (build 1.6.0_22-b04)
I have added myself to the "dialout" group.
My Uno always appears as /dev/ttyACM0, as follows:

ls -l /dev/ttyACM0
crw-rw---- 1 root dialout 166,  0 2011-01-23 16:34 /dev/ttyACM0

dmesg:
[243199.131605] usb 4-1: new full speed USB device using uhci_hcd and address 29
[243199.342928] usb 4-1: configuration #1 chosen from 1 choice
[243199.345892] cdc_acm 4-1:1.0: ttyACM0: USB ACM device

I can load, compile, and upload most sketches without difficulty. However, if a sketch sends more than a trivial amount of data with Serial.print(), things go haywire. I will describe in detail below, since I've managed to find a few other posts describing similar symptoms but I didn't see any posts that got to the bottom of it. Hopefully I can help the experts drive this to ground and get it sorted for all of us. I am happy to do additional debugging on my side if it will help.

To set a baseline, I called up the Blink example (which does not use any Serial communications) and loaded it in to the Uno. After the sketch loads, the "L13" led blinks slowly at ~0.5Hz as expected. At this point, with the Uno connected to the laptop and the arduino software running, I can open the serial monitor window and close it as much as I like. I can change the settings and the settings are recalled the next time I open the window. I don't see anything in the serial monitor window, but because Blink does not send anything, I don't expect to. I can use the mouse to select menus in the IDE and make selections with good responsiveness. I can quit the Arduino IDE and start it back up again, and it quits and loads quickly. In fact, I can load my own complex sketches that don't write serial data back to the PC and everything works OK. I belabor all of these points only because they contrast with what happens when I load a sketch using heavy Serial output.

With the Uno loaded with Blink, I called up the example Examples/Basics/AnalogReadSerial and made one small change: I added a delay(1000); to the start of the loop (in order to observe and test some things which I will note below). I sent this slightly modified Blink sketch to the Uno. The sketch loads (Uno RX/TX lights flash, Uno resets) and starts running. The Uno's TX light blinks slowly, about once per second, (which is expected since I added the delay(1000) line to the loop). The interesting thing here is that the TX light stays on for about half a second each cycle, then turns off. I click on the serial monitor icon in the Arduino IDE, and after a second or so, the window comes up and I start to see the output of the sketch. ALSO, the TX light on the Uno has changed its behavior: It still comes on once per second, but it only stays on for a few ms. It's more of a brief flicker than a blink. When I see this behavior I know the Uno has achieved some sort of "happy" state for serial comms with the host. I can open and close the serial monitor with the sketch running on the Uno; whenever the serial monitor window is closed, the TX light duty cycle is about 50%; whenever the serial monitor window is open, the duty cycle is maybe 1%. I can open and close the serial monitor window as often as I like. I can use the menus in the IDE and they are very responsive; I can quit the Arduino IDE and re-start it very quickly.

Now, if I take the "delay(1000)" line OUT of the sketch and re-upload it in its stock form, the situation changes dramatically.

I open the AnalogReadSerial example again and press the Upload button in the Arduino IDE and the sketch loads. The sketch starts running as soon as it's done loading, as expected, and the Uno's TX light turns on solid. It does not turn off, ever. Now I click the serial monitor button, and after a few seconds, I get the following error: "processing.app.SerialException: Serial port '/dev/ttyACM0' already in use.  Try quiting any programs that may be using it." Taking a cue from another thread, I do a "lsof | grep ttyACM0" at this point; the grep returns zero rows (no hits.) The /dev/ttyACM0 device is still present, but there is a new line in the dmesg dump:

[244277.807273] tty_port_close_start: tty->count = 1 port count = 0.

At this point, the IDE is very sluggish and unresponsive. Menus do not drop down for seconds at a time. I can quit the IDE, but it takes some time to actually respond to the close box click. (The Uno is still on this whole time, BTW.) When I start the IDE back up, it takes a long time for the GUI window to come forward. Before it does, on the command line from which I start the IDE, this message appears:

RXTX Warning:  Removing stale lock file. /var/lock/LCK..ttyACM0

Now when the IDE finally does come up and I hit the serial monitor button, I get a different error: "processing.app.SerialNotFoundException: Serial port '/dev/ttyACM0' not found.  Did you select the right one from the Tools > Serial Port menu?" At this point I verify that the device still exists with an ls -l /dev/ttyACM0, and sure enough it is still listed and has not changed. I check dmesg to see if a different port has appeared, but there are no more USB connect messages. There are, however, a whole lot more of these:

[244552.082351] tty_port_close_start: tty->count = 1 port count = 0.

(After some poking around after this line of experimenting, I can report that this line appears a few seconds AFTER the serial monitor button is pressed and almost immediately before the "port not found" error message is printed. It also appears after a failed upload of any sketch when I try to replace the problematic one running in the Uno.)

Now I am in a tough spot. I can't just open the Blink example and upload it, because the IDE claims it can't find the serial port /dev/ttyACM0.

Furthermore, at this point the Arduino Uno RESET button does not appear to work quite right. When I press it, the "L13" LED blinks three times in rapid succession, but the TX light never goes out. If I hit the upload sketch button in the IDE and then hit the Uno's hardware reset button after just the right fraction of a second delay, I can successfully load a replacement sketch. There is a very small time window that if I am lucky, I can hit and have the Blink sketch reload into the Uno and things return to normal.

So, it seems that there is something going on in the USB interface on the Uno and its relationship with the host-side driver that makes connecting to the Uno impossible if the Uno is already trying to send a lot of serial data to the host.

I am working with an MSGEQ7 and seeing the data quickly is important to figuring out how my circuits are behaving, so the (delay(1000)) is not really a solution. Can anyone help?! I am happy to do investigations and testing on my side if someone can point me in the right direction. I have some java and c/c++ development experience.

Thanks!
5  Forum 2005-2010 (read only) / Troubleshooting / Uno sending serial data becomes un-connectable on: January 23, 2011, 05:23:10 pm
I've had an exceptional amount of difficulty getting the serial monitor working reliably in the arduino software v22 under Ubuntu Linux. It sometimes works if the amount of data coming over is very low or very intermittent (e.g., once per second or slower). First, the background:

I have a new Arduino Uno. It appears to work normally.
I am powering the Arduino over USB (no external power.)
I am using the arduino IDE v22 under Ubuntu Linux ~9.
I'm using java version "1.6.0_22" Java(TM) SE Runtime Environment (build 1.6.0_22-b04)
I have added myself to the "dialout" group.
My Uno always appears as /dev/ttyACM0, as follows:

ls -l /dev/ttyACM0
crw-rw---- 1 root dialout 166,  0 2011-01-23 16:34 /dev/ttyACM0

dmesg:
[243199.131605] usb 4-1: new full speed USB device using uhci_hcd and address 29
[243199.342928] usb 4-1: configuration #1 chosen from 1 choice
[243199.345892] cdc_acm 4-1:1.0: ttyACM0: USB ACM device

I can load, compile, and upload most sketches without difficulty. However, if a sketch sends more than a trivial amount of data with Serial.print(), things go haywire. I will describe in detail below, since I've managed to find a few other posts describing similar symptoms but I didn't see any posts that got to the bottom of it. Hopefully I can help the experts drive this to ground and get it sorted for all of us. I am happy to do additional debugging on my side if it will help.

To set a baseline, I called up the Blink example (which does not use any Serial communications) and loaded it in to the Uno. After the sketch loads, the "L13" led blinks slowly at ~0.5Hz as expected. At this point, with the Uno connected to the laptop and the arduino software running, I can open the serial monitor window and close it as much as I like. I can change the settings and the settings are recalled the next time I open the window. I don't see anything in the serial monitor window, but because Blink does not send anything, I don't expect to. I can use the mouse to select menus in the IDE and make selections with good responsiveness. I can quit the Arduino IDE and start it back up again, and it quits and loads quickly. In fact, I can load my own complex sketches that don't write serial data back to the PC and everything works OK. I belabor all of these points only because they contrast with what happens when I load a sketch using heavy Serial output.

With the Uno loaded with Blink, I called up the example Examples/Basics/AnalogReadSerial and made one small change: I added a delay(1000); to the start of the loop (in order to observe and test some things which I will note below). I sent this slightly modified Blink sketch to the Uno. The sketch loads (Uno RX/TX lights flash, Uno resets) and starts running. The Uno's TX light blinks slowly, about once per second, (which is expected since I added the delay(1000) line to the loop). The interesting thing here is that the TX light stays on for about half a second each cycle, then turns off. I click on the serial monitor icon in the Arduino IDE, and after a second or so, the window comes up and I start to see the output of the sketch. ALSO, the TX light on the Uno has changed its behavior: It still comes on once per second, but it only stays on for a few ms. It's more of a brief flicker than a blink. When I see this behavior I know the Uno has achieved some sort of "happy" state for serial comms with the host. I can open and close the serial monitor with the sketch running on the Uno; whenever the serial monitor window is closed, the TX light duty cycle is about 50%; whenever the serial monitor window is open, the duty cycle is maybe 1%. I can open and close the serial monitor window as often as I like. I can use the menus in the IDE and they are very responsive; I can quit the Arduino IDE and re-start it very quickly.

Now, if I take the "delay(1000)" line OUT of the sketch and re-upload it in its stock form, the situation changes dramatically.

I open the AnalogReadSerial example again and press the Upload button in the Arduino IDE and the sketch loads. The sketch starts running as soon as it's done loading, as expected, and the Uno's TX light turns on solid. It does not turn off, ever. Now I click the serial monitor button, and after a few seconds, I get the following error: "processing.app.SerialException: Serial port '/dev/ttyACM0' already in use.  Try quiting any programs that may be using it." Taking a cue from another thread, I do a "lsof | grep ttyACM0" at this point; the grep returns zero rows (no hits.) The /dev/ttyACM0 device is still present, but there is a new line in the dmesg dump:

[244277.807273] tty_port_close_start: tty->count = 1 port count = 0.

At this point, the IDE is very sluggish and unresponsive. Menus do not drop down for seconds at a time. I can quit the IDE, but it takes some time to actually respond to the close box click. (The Uno is still on this whole time, BTW.) When I start the IDE back up, it takes a long time for the GUI window to come forward. Before it does, on the command line from which I start the IDE, this message appears:

RXTX Warning:  Removing stale lock file. /var/lock/LCK..ttyACM0

Now when the IDE finally does come up and I hit the serial monitor button, I get a different error: "processing.app.SerialNotFoundException: Serial port '/dev/ttyACM0' not found.  Did you select the right one from the Tools > Serial Port menu?" At this point I verify that the device still exists with an ls -l /dev/ttyACM0, and sure enough it is still listed and has not changed. I check dmesg to see if a different port has appeared, but there are no more USB connect messages. There are, however, a whole lot more of these:

[244552.082351] tty_port_close_start: tty->count = 1 port count = 0.

(After some poking around after this line of experimenting, I can report that this line appears a few seconds AFTER the serial monitor button is pressed and almost immediately before the "port not found" error message is printed. It also appears after a failed upload of any sketch when I try to replace the problematic one running in the Uno.)

Now I am in a tough spot. I can't just open the Blink example and upload it, because the IDE claims it can't find the serial port /dev/ttyACM0.

Furthermore, at this point the Arduino Uno RESET button does not appear to work quite right. When I press it, the "L13" LED blinks three times in rapid succession, but the TX light never goes out. If I hit the upload sketch button in the IDE and then hit the Uno's hardware reset button after just the right fraction of a second delay, I can successfully load a replacement sketch. There is a very small time window that if I am lucky, I can hit and have the Blink sketch reload into the Uno and things return to normal.

So, it seems that there is something going on in the USB interface on the Uno and its relationship with the host-side driver that makes connecting to the Uno impossible if the Uno is already trying to send a lot of serial data to the host.

I am working with an MSGEQ7 and seeing the data quickly is important to figuring out how my circuits are behaving, so the (delay(1000)) is not really a solution. Can anyone help?! I am happy to do investigations and testing on my side if someone can point me in the right direction. I have some java and c/c++ development experience.

Thanks!

6  Forum 2005-2010 (read only) / Syntax & Programs / Re: serial connection in processing (ubuntu) on: January 08, 2011, 12:15:15 pm
Probably we should all say "we have this problem" at the Processing board and perhaps the Ubuntu boards, as, strictly speaking, it turns out this is probably a processing problem and not an arduino problem. :-/
7  Forum 2005-2010 (read only) / Syntax & Programs / Re: serial connection in processing (ubuntu) on: December 31, 2010, 06:10:16 pm
FWIW, I verified that both the arduino app and the processing app are using the same version of the RXTX library. Their startup scripts do find different versions of the java libraries, though, since processing ships with its own, I am wondering if some of the JNI stuff processing uses is out-of-spec for the ubuntu box...
8  Forum 2005-2010 (read only) / Syntax & Programs / Re: serial connection in processing (ubuntu) on: December 31, 2010, 01:21:48 pm
If it makes you feel any better, I have an extremely similar problem, maybe the exact same problem. Under Ubuntu 9, the arduino IDE properly detects the /dev/ttyACM0 port created when I plug in the arduino, but processing apps don't see /dev/ttyACM0 and therefore can't ever talk to the arduino. I downloaded the latest versions of processing and arduino yesterday to try them out under Ubuntu; so far, no-go for processing.

The only difference between your problem and mine is that my processing apps DO see my USB mouse port, /dev/ttyS0. Of course, you can't connect to that port (it's in use) and even if you could, it's not where the arduino is anyway (as verified in the arduino IDE and by dmesg upon connection of the arduino.)

SO, it would be really cool if someone could provide us some leads about where to look to solve this problem. :-)
Pages: [1]