Pages: [1]   Go Down
Author Topic: Cannot upload to Arduino Uno any more  (Read 2228 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 0
Posts: 69
Arduino Rocks!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi all. I was doing some programming when suddenly I couldn't upload anymore to my Arduino Uno board from Ubuntu 10.04. My board is connected with the computer and mounted at /dev/ttyACM0. When I'm trying to upload, I get the following error:

Code:
processing.app.SerialException: Error opening serial port '/dev/ttyACM0'.
at processing.app.Serial.<init>(Serial.java:146)
at processing.app.Serial.<init>(Serial.java:91)
at processing.app.SerialMonitor.openSerialPort(SerialMonitor.java:204)
at processing.app.Editor.handleSerial(Editor.java:2415)
at processing.app.EditorToolbar.mousePressed(EditorToolbar.java:352)
at java.awt.Component.processMouseEvent(Component.java:6285)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
at java.awt.Component.processEvent(Component.java:6053)
at java.awt.Container.processEvent(Container.java:2041)
at java.awt.Component.dispatchEventImpl(Component.java:4651)
at java.awt.Container.dispatchEventImpl(Container.java:2099)
at java.awt.Component.dispatchEvent(Component.java:4481)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4235)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
at java.awt.Container.dispatchEventImpl(Container.java:2085)
at java.awt.Window.dispatchEventImpl(Window.java:2478)
at java.awt.Component.dispatchEvent(Component.java:4481)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:643)
at java.awt.EventQueue.access$000(EventQueue.java:84)
at java.awt.EventQueue$1.run(EventQueue.java:602)
at java.awt.EventQueue$1.run(EventQueue.java:600)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
at java.awt.EventQueue$2.run(EventQueue.java:616)
at java.awt.EventQueue$2.run(EventQueue.java:614)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:613)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Caused by: gnu.io.UnsupportedCommOperationException: Invalid Parameter
at gnu.io.RXTXPort.setSerialPortParams(RXTXPort.java:171)
at processing.app.Serial.<init>(Serial.java:136)
... 35 more

When I try to run the arduino software as root (sudo arduino), everything works fine!!! However, I am in the dialout group. Any suggestions???
Logged

An Arduino development board costs €20~60. A pack of 20 Zener diodes to protect your board from almost certain damage costs less than €1...

Offline Offline
Edison Member
*
Karma: 19
Posts: 1041
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What is the output of
Code:
ls -l /dev/ttyACM0
(that's a minus el)
The fourth column (after "root") will be the group that it is in. I'm guessing it's not "dialout"

What version of the IDE are you running?
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 69
Arduino Rocks!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I found out the solution after a long time of researching. I apologize for double-posting. The answer is more or less found here. The difference is that I couldn't change the contents of the file ~/.arduino/preferences.txt because the arduino software would modidy the value of the parameter serial.debug_rate back to 14400 whenever I was trying to set it to 9600. I finally deleted the folder ~/.arduino and everything now goes like clockwork.
Logged

An Arduino development board costs €20~60. A pack of 20 Zener diodes to protect your board from almost certain damage costs less than €1...

Offline Offline
Jr. Member
**
Karma: 0
Posts: 69
Arduino Rocks!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What is the output of
Code:
ls -l /dev/ttyACM0
(that's a minus el)
The fourth column (after "root") will be the group that it is in. I'm guessing it's not "dialout"

What version of the IDE are you running?

BTW, The output is:
Code:
crw-rw---- 1 root dialout 166, 0 2012-03-06 04:34 /dev/ttyACM0
After all it was not permissions issue. I had previously set the debug_rate at 14400 and things went wrong from that moment on...
Logged

An Arduino development board costs €20~60. A pack of 20 Zener diodes to protect your board from almost certain damage costs less than €1...

Chicago
Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for that huge hint.  I had the same symptom, IDE would only download if user was root.  If logged on as normal user I got:

Code:
Binary sketch size: 2,464 bytes (of a 30,720 byte maximum)
processing.app.SerialException: Error opening serial port '/dev/ttyUSB1'.
at processing.app.Serial.<init>(Serial.java:178)
at processing.app.Serial.<init>(Serial.java:77)
at processing.app.debug.Uploader.flushSerialBuffer(Uploader.java:77)
at processing.app.debug.AvrdudeUploader.uploadViaBootloader(AvrdudeUploader.java:172)
at processing.app.debug.AvrdudeUploader.uploadUsingPreferences(AvrdudeUploader.java:67)
at processing.app.Sketch.upload(Sketch.java:1706)
at processing.app.Sketch.exportApplet(Sketch.java:1662)
at processing.app.Sketch.exportApplet(Sketch.java:1634)
at processing.app.Editor$DefaultExportHandler.run(Editor.java:2346)
at java.lang.Thread.run(Thread.java:636)
Caused by: gnu.io.UnsupportedCommOperationException: Invalid Parameter
at gnu.io.RXTXPort.setSerialPortParams(RXTXPort.java:171)
at processing.app.Serial.<init>(Serial.java:163)
... 9 more
processing.app.debug.RunnerException: Error opening serial port '/dev/ttyUSB1'.
at processing.app.debug.Uploader.flushSerialBuffer(Uploader.java:101)
at processing.app.debug.AvrdudeUploader.uploadViaBootloader(AvrdudeUploader.java:172)
at processing.app.debug.AvrdudeUploader.uploadUsingPreferences(AvrdudeUploader.java:67)
at processing.app.Sketch.upload(Sketch.java:1706)
at processing.app.Sketch.exportApplet(Sketch.java:1662)
at processing.app.Sketch.exportApplet(Sketch.java:1634)
at processing.app.Editor$DefaultExportHandler.run(Editor.java:2346)
at java.lang.Thread.run(Thread.java:636)

Deleting the user .arduino eliminated the Java exception but there was an avrdude problem.  I solved the issue by copying .arduino/preferences.txt from root to the user .arduino directory.
Logged

He who dies with the most software wins.

Pages: [1]   Go Up
Jump to: