Go Down

Topic: ATMega 1280 Linux Connection Problem (Read 15819 times) previous topic - next topic

reprapperMC

Hello Arduino Gods,
I am currently having problems uploading programs to my ATMega 1280 on a openSUSE Linux machine. First off I'll say I have tried multiple things to get this working so I'm going to list everything that either hasn't worked or that I am doing wrong. Also, one issue is that I need definite connection from the Mega to the computer as this Mega is for running a Reprap machine. The Mega will be getting constant info from the computer so doing the reset button dance isn't even an option. I am a Linux newb so it is possible I'm missing something staring me right in the face. Thank you in advance for any help.

1. First off,  the Mega is working perfectly fine. I can very easily upload programs and send info through USB to the Mega using Windows XP and Windows 7. Truthfully I would just stick with Windows but the Gcode Interpreter I'm using for my Reprap machine is not currently being updated for Windows, so there is that.

2. On to what is happening when I try to upload to the Mega on openSUSE: In the Arduino IDE I can select the correct serial port (/dev/ttyUSB0) and am selecting the correct board (Arduino Mega (ATMega 1280). The program compiles perfectly fine. When I select to upload the first thing I notice is that the rx tx lights do not blink. Within a few seconds the Arduino IDE errors out with this error:

Code: [Select]
Binary sketch size: 14992 bytes (of a 126976 byte maximum)
/home/steven/bin/arduino-0022/hardware/tools/avrdude -C/home/steven/bin/arduino-0022/hardware/tools/avrdude.conf -v -v -v -v -patmega1280 -cstk500v1 -P/dev/ttyUSB0 -b115200 -D -Uflash:w:/tmp/build3442533860849584296.tmp/Tonokip_Firmware.cpp.hex:i

avrdude: Version 5.4-arduino, compiled on Oct 22 2007 at 13:15:12
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/

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

         Using Port            : /dev/ttyUSB0
         Using Programmer      : stk500v1
         Overriding Baud Rate  : 115200
avrdude: Send: 0 [30]   [20]
avrdude: Send: 0 [30]   [20]
avrdude: Send: 0 [30]   [20]
avrdude: ser_recv(): programmer is not responding
avrdude: stk500_recv(): programmer is not responding
avrdude: Send: Q [51]   [20]
avrdude: ser_recv(): programmer is not responding
avrdude: stk500_recv(): programmer is not responding


3. Here are some of the things I have already tried.
A. First off with the original install of Arduino IDE I followed this: http://arduino.cc/playground/Linux/OpenSUSE
B. That didn't work so I tried the steps in the following link which did make the serial port appear but still did not fix the avrdude error: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1268008565
C. Next I tried changing the connection rate in the Arduino IDE preferences.txt file. I switched the baud rate to 115200 as this is the speed I normally use to connect the Mega to the gcode interpreter (Repsnapper). This changed nothing.
D. Lastly I even tried the dumb resetting of the board right before the upload, and right after pressing upload, and after the first return line appears. None of this works.

4. Also, info about the install: Arduino IDE is installed in the bin folder in the "home" folder. In following the information in the install tutorial I followed it word for word. So, if there is something that a Linux user would automatically do when installing Arduino IDE with out needing to be told so, I did not.

5. I've seen the error I'm getting appear in many forum posts with no definite answers. I'm guessing this error is generic and could be caused by many things. With this said, if you have any questions that may lead to getting this working, please ask away.

mrtaylor

Which version on openSuse, rxtx, java, etc... are you using?

reprapperMC

mrtaylor, thanks for your response. I'm not sure what exactly you mean by etc. so I put version numbers for what I thought was needed. If you need more please list which info is needed.

openSUSE: 11.3
rxtx-java: 2.2pre2-4.6
java-1_6_0-openjdk: 1.6.0.0_b20.1.9.4-1.2.1
avrdude: 5.10-44.9
cross-avr-binutils: 2.19.1-32.1
cross-avr-gcc: 4.3.3_20100125-27.2
avr-libc: 1.7.0-3.5
arduino: 0022-6.1

igor86

If this is 64 bit linux, you must use arduino 0021 software version. The new 0022 version is not yet properly ported to 64 bit linux systems.
-Igor

reprapperMC

OS:  Linux 2.6.34.7-0.7-desktop i686
System:  openSUSE 11.3 (i586)

mrtaylor

Please open a terminal and run this command. Post the result:
find / -ls 2>&1 | grep -i rxtxSerial

reprapperMC

Code: [Select]
2492889   48 -rw-r--r--   1 steven   users       48304 Dec 24 17:12 /home/steven/bin/arduino-0022/lib/librxtxSerial.so
2491909   48 -rw-r--r--   1 steven   users       48304 Dec 24 17:12 /home/steven/.local/share/Trash/files/arduino-0022/lib/librxtxSerial.so
803369   68 -rwxr-xr-x   1 root     root        68023 Dec 12 16:43 /usr/lib/librxtxSerial-2.2pre1.so
803372    0 lrwxrwxrwx   1 root     root           24 Jan 26 20:57 /usr/lib/librxtxSerial.so -> librxtxSerial-2.2pre1.so
1067340    0 lrwxrwxrwx   1 root     root           29 Jan 26 21:04 /usr/share/arduino-0022/lib/librxtxSerial.so -> ../../../lib/librxtxSerial.so


mrtaylor

let try replacing librxtxSerial.  Execute the following commands

// backup original library
mv /home/steven/bin/arduino-0022/lib/librxtxSerial.so /home/steven/bin/arduino-0022/lib/librxtxSerial.so.orig
// copy library found on system to arduino library directory
cp /usr/lib/librxtxSerial.so /home/steven/bin/arduino-0022/lib/librxtxSerial.so

cd /home/steven/bin/arduino-0022
./arduino



reprapperMC

mrtaylor, sorry but I am still getting the same error after replacing librxtxSerial.

mrtaylor

I am running out of ideas, so double check you have the correct board and port selected under the tools menu, try running a root.

reprapperMC

mrtaylor, the port and board is right. How would I go about running it as root? I've heard someone else say this is one way they got it working but I do not know to do it.

mrtaylor

You will need the root password

cd to the arduino directory
sudo ./arduino
<enter password>

another thing to try see if it still works under window xp if it does not reburn the bootloader.


reprapperMC

Weird, getting an error from trying to open in root.

Code: [Select]
steven@linux-ov9v:~/bin/arduino-0022> sudo ./arduino
root's password:
Exception in thread "main" java.lang.ExceptionInInitializerError
        at processing.app.Base.main(Base.java:112)
Caused by: java.awt.HeadlessException:
No X11 DISPLAY variable was set, but this program performed an operation which requires it.
        at sun.awt.HeadlessToolkit.getMenuShortcutKeyMask(HeadlessToolkit.java:231)
        at processing.core.PApplet.<clinit>(Unknown Source)
        ... 1 more


mrtaylor

#13
Jan 27, 2011, 05:43 am Last Edit: Jan 27, 2011, 05:47 am by mrtaylor Reason: 1
edited:
try this might work might not

sudo bash
export DISPLAY=:0.0
./arduino


reprapperMC

Code: [Select]
steven@linux-ov9v:~/bin/arduino-0022> sudo bash
linux-ov9v:/home/steven/bin/arduino-0022 # export DISPLAY=:0.0
linux-ov9v:/home/steven/bin/arduino-0022 # ./arduino
No protocol specified
Exception in thread "main" java.lang.InternalError: Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable.
        at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
        at sun.awt.X11GraphicsEnvironment.access$200(X11GraphicsEnvironment.java:62)
        at sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:178)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:142)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:186)
        at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:82)
        at sun.awt.X11.XToolkit.<clinit>(XToolkit.java:112)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:186)
        at java.awt.Toolkit$2.run(Toolkit.java:849)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:841)
        at processing.core.PApplet.<clinit>(Unknown Source)
        at processing.app.Base.main(Base.java:112)


Go Up