Pages: [1]   Go Down
Author Topic: Problems with Arduino IDE on Linux  (Read 1220 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I recently converted from Windows 7 to Linux.  I've been having issues with the Arduino IDE which I never experienced in Windows.  Often the GUI menu bar will become unresponsive, or at least very slow.  The menus won't come up immediately and if I click the serial monitor button it make take 20 to 30 seconds to appear.  Also, sometimse the program will get into a funk where when I click upload, it will take 5 to 30 seconds to launch avrdude (I have verbose logging turned on).  Sometimes restarting the Arduino IDE will fix it, usually I have to restart Linux in order to get it to behave properly again.

I'm using Linux Mint and Arduino IDE 1.0.3.  I tried 1.5.2 for giggles, but no difference.

Any thoughts?  Thanks in advance.
Logged

SE USA
Offline Offline
Faraday Member
**
Karma: 40
Posts: 3783
@ssh0le
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

are you using open jdk or real java, cause it works fine for me
Logged


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

OpenJDK
Logged

Offline Offline
Edison Member
*
Karma: 57
Posts: 2078
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The Arduino IDE contains almost everything, but not the Java and not the java-rxtx.

So if you have installed the avr-gcc compiler and avrdude and Arduino IDE from the repositories, things could get mixed.

Remove the packages 'arduino' and 'arduino-core'. Perhaps you might need to reinstall Java.
Download the Arduino 1.0.3 and place it in a new folder, run it from that folder.

It that still doesn't work, try installing the other (real) Java.
Logged

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

Packages arduino and arduino-core were not installed.  I was running from a directory created from a downloaded tarball.

I reinstalled the openjava packages, no notable effect.

I installed real Java, jre 7.0.15.  I'm still seeing the same behavior.  I turned on Java verbose logging, and went back to basics, loading the Blink example and running the arduino shell script as root.

I noticed there seems to be angst over /dev/ttyACM0.  Once I saw this log:

RXTX fhs_lock() Error: creating lock file: /var/lock/LCK..ttyACM0: File exists

However, I can't reproduce that event now.  I noticed a few times the /dev/ttyACM0 choice disappeared from the IDE Tools-Serial Port menu.

I can live with the menu slowness, but the unresponsiveness and unpredictability of uploads is driving me nuts.  I disable Automatic Software Reset on all my Arduinos and use the reset button when doing uploads.  I used to be able to just hit the reset button as soon as I saw "Uploading...".  Now avrdude may load up immediately or up to 30 seconds later, which screws up the timing and makes the upload fail.

Here are verbose Java logs (omitting the logs during compilation):

Quote
Binary sketch size: 7,614 bytes (of a 32,256 byte maximum)
/home/joe/Documents/arduino-1.0.3/hardware/tools/avrdude -C/home/joe/Documents/arduino-1.0.3/hardware/tools/avrdude.conf -v -v -v -v -patmega328p -carduino -P/dev/ttyACM0 -b115200 -D -Uflash:w:/tmp/build450924210641535177.tmp/rig_library_test.cpp.hex:i

avrdude: Version 5.11, compiled on Sep  7 2011 at 19:34:16
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "/home/joe/Documents/arduino-1.0.3/hardware/tools/avrdude.conf"
         User configuration file is "/home/joe/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/ttyACM0
         Using Programmer              : arduino
         Overriding Baud Rate          : 115200
avrdude: Send: 0 [30]   [20]
avrdude: Send: 0 [30]   [20]
avrdude: Send: 0 [30]   [20]
avrdude: Recv: R [52]
avrdude: stk500_getsync(): not in sync: resp=0x52

avrdude done.  Thank you.


I noticed one time when playing with the Blink sketch that if I hit Upload again and again, avrdude started getting more responsive and after about the eighth time it loaded up immediately and I was able to do a successful upload with my normal hit-the-reset-button timing.

None of this would appear to be memory or CPU related.  This is on a two proc box with a system load normally in the .1 area, never going above 1.5, and lots of idle time.  There is 4GB of memory, used is around 2.4 GB at the moment.  There is nothing notable in /var/log/syslog, like the USB device going into the weeds.

I suppose I could enable ASR again on my boards and live with the delay with avrdude, though I hate to admit defeat :-).  Maybe I could write a wrapper around avrdude to see when it's actually getting called, though not sure if that would be of any help.
Logged

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

For fun I installed arduino and aruino-core and ran it to see if there would be a difference.  No change.  The IDE in that package is 1.0.1.
Logged

Offline Offline
Edison Member
*
Karma: 57
Posts: 2078
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Can you be more specific ?

Is your Arduino board connected ? Which board ?
Without the Arduino board connected, can you use the Arduino IDE and check the sketch ?
If that is also slow, can you use a Ubuntu or Mint from cdrom or USB stick ?

The Java rxtx could cause problems, but the newest version should work.
The Arduino Leonardo could cause problems, for example if it is running a sketch that is blocking the serial communication.

But in the end, I have no idea. Sorry.
It should not be slow, unless something is very wrong.
Logged

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

I'm using an Uno.

This is interesting; if I disconnect the Arduino Uno, the UI responds fine.  It isn't until I plug the Arduino in when I start to have UI problems.

I'll try booting up on the Linux Mint live CD later.
Logged

SE USA
Offline Offline
Faraday Member
**
Karma: 40
Posts: 3783
@ssh0le
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

try using the one in the repository, its only 1.0 (if its the same as ubuntu) but just to see if it works

sudo apt-get install arduino
Logged


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

I installed the arduino package using apt-get.  It installed Arduino 1.0.1 like Synaptic did before, and the behavior was the same this time.

I booted up on a Linux Mint live CD and the Arduino IDE (1.0.3 from the native hard disk) performed fine.  So, I booted back into the native Linux installation.  On a whim I restored an original copy of preferences.txt and now the UI is working fine and my problems with /dev/ttyACM* seem to have disappeared.

So, I'm keeping my fingers crossed.  Thanks for the help!
Logged

SE USA
Offline Offline
Faraday Member
**
Karma: 40
Posts: 3783
@ssh0le
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

welcome to linux

everything complex is simple
everything simple is complex
Logged


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

Tell me about it  smiley  I've been doing Linux and BSD servers since about 1995, but I never attempted to make Linux my primary day-to-day desktop OS on my home machine.  It's easy to blow a whole day on one little issue.  It's been a crazy ride, but I'm liking it.  I can't imagine ever migrating to Windows 8 and I'm fed up with Windows 7.  I would like a Mac, but not the accompanying price tag.
Logged

SE USA
Offline Offline
Faraday Member
**
Karma: 40
Posts: 3783
@ssh0le
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

yea same here, I love my old as dirt mac's (newest one runs 10.2) but I know better than to pay that kind of money for what they are hardware wise
« Last Edit: March 03, 2013, 10:39:17 pm by Osgeld » Logged


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

I got back from a business trip and went to play with some Arduinos, and I started having the same problems...deja vu all over again, as they say.  I spent two hours ripping my hair out but I finally figured it out.  Long story short, the Arduino was pumping a bunch of data out the serial port and apparently that I/O reeks havoc on the IDE UI and avrdude.  As soon as I unplugged the Arduino, the problems went away.  If I held down the reset button and then released it as soon as I saw avrdude starting up, I could successfully do an upload.  So, I've changed my code to not pump out all the diagnostic data on the serial port by default and things are well behaved now.

I never had this issue on Windows, so apparently things are a bit different in Linux. 
Logged

Pages: [1]   Go Up
Jump to: