Arduino Not working in Linux

Hi, I bought an arduino clone Duemilanove and currently is trying to use on Linux. It worked on Windows but when I am trying to upload to the target atmeg168, I always get a status error from sketch ide

avrdude stk500_recv programmer is not responding

I've checked my usb and it seem to work $ dmesg |tail [ 433.909028] usb 2-3: configuration #1 chosen from 1 choice [ 434.766311] usbcore: registered new interface driver usbserial [ 434.766334] USB Serial support registered for generic [ 434.766371] usbcore: registered new interface driver usbserial_generic [ 434.766374] usbserial: USB Serial Driver core [ 434.833852] USB Serial support registered for pl2303 [ 434.833879] pl2303 2-3:1.0: pl2303 converter detected [ 434.865692] usb 2-3: pl2303 converter now attached to ttyUSB0 [ 434.865718] usbcore: registered new interface driver pl2303 [ 434.865722] pl2303: Prolific PL2303 USB to serial adaptor drive

Someone said that the arduino doesnt use a PL2303 so you must be doing something unusual. But again, I don't know what PL2303 is and how should I remove it to set my linux environment ready.

It is already a 3week troubleshooting and looking for answers in the web but still not able to find any help

d

Hi, Did you go through this list ? http://arduino.cc/en/Guide/Troubleshooting

On which Linux Distribution/Release are you trying this? Where did you buy the the clone? Does it work when you run the IDE as root ("sudo arduino")? Eberhard

Hi Eberhard,

I already go to that list -> http://arduino.cc/en/Guide/Troubleshooting

I am trying this on Ubuntu 9.10 . I bought the clone at e-gizmo

I tried running it on root and that did not work as well

d

Hi,

Assuming you are repeating excatly the same steps that where successful under Windows I don't have much to offer:

I can't find your clone on the gizmo pages. Your clone uses a different USB2Serial chip than the arduino but that should not make a difference as long as it is shown on the serial-port list of the IDE when you plug it in, and it is removed from this list when you unplug it.

If you haven't done this already, you could try to install the Arduino Ubuntu Package announced here : http://www.arduino.cc/playground/Linux/Ubuntu It has a few updates to AvrDude.

Eberhard

hi,

I already did that previously and it did not work for me. Do you want to see the schematic?

Do you want to see the schematic?

Not really. If it works on windows and the device is recognized by the IDE there is no reason for a hardware failure.

Could you upload the "AnalogInOutSerial" example sketch Menu File->examples->analog->AnalogInOutSerial from windows that simply prints messages to the serial port, and then start up the IDE on Linux. Use the SerialMonitor of the IDE to see if the board basically works...

Eberhard

The usual problem with Linux is Java, got into Synaptic package manager and uninstall all the Java clients already installed. Restart the computer and then go back to the package manager and install just Sun-java6-jre and its dependancies.

Do you have the anything reported by "ls /dev/ttyUS*" before and after you plug in the board ?

I am currently reinstalling the sun-java6-jre

This is the result of teh command when the board in not connected

$ ls /dev/ttyUS* ls: cannot access /dev/ttyUS*: No such file or directory

The device files (/dev/ttyUSB*) are created dynamically. They are created when the device was plugged in successfully, they are removed when when you unplug them.

The dmesg listing has already shown that your device is detected.

It can't hurt to switch to the sun-jre, but I don't think it is the reason for your problems.

Eberhard

unfortunately reinstalling the sun-java6-jre did not solve this. By the way, my os is ylmf, an ubuntu ver 9.10

This could be due to differences between the Linux and Windows drivers for the PL2303 - if the developers of the clone only ever used Windows they might not have spotted the problem. Google for driver issues.

Do the test with the Serial Monitor, everything else is just wild guessing.

I have 2 (non-arduino) devices with the prolific chip, there are no driver problems with any of them.

Eberhard

Hi, I'm using 9.10 since Dec 2009.

did you remove btltty?

see http://www.ladyada.net/learn/arduino/lesson0-lin.html

Sometimes the Linux distribution installs brltty (braille device) which will conflict with the Arduino. You must uninstall brltty! Do so by running

$ sudo apt-get remove brltty

also http://www.arduino.cc/playground/Linux/Ubuntu

then I would reboot your system and plug in the Arduino to the USB again.

I've already done this previously and still did not work

I tried to upload the "AnalogInOutSerial" example sketch in windows and run it on linux IDE. The serialmonitor of the IDE in linux doesn't show any anything.

But when I do ls /dev/ttyUS* I see the device got connected

$ ls /dev/ttyUS* /dev/ttyUSB0

d

Is this device-file /dev/ttyUSB0 listet in the Tools->SerialPort Menu?

Eberhard

no I did not notice /dev/ttyUSB0

no I did not notice /dev/ttyUSB0

Well if the IDE does not recognize the device, there is oviously not way the IDE can program it.

Now the only debugging option I can think of is to look at the events generated when your device is plugged in.
Here are the instructions:

  • Unplug you board if it is plugged in
  • Open a console window
  • Run this command : “udevadm monitor --property > /tmp/arduino-log”
  • plug your board into a USB port
  • Stop the monitor by hitting Ctrl-C
  • Post the contents of the file “/tmp/arduino-log”

Eberhard

monitor will print the received events for: UDEV - the event which udev sends out after rule processing KERNEL - the kernel uevent

KERNEL[1273260338.488181] add /devices/pci0000:00/0000:00:03.1/usb2/2-2 (usb) UDEV_LOG=3 ACTION=add DEVPATH=/devices/pci0000:00/0000:00:03.1/usb2/2-2 SUBSYSTEM=usb DEVNAME=bus/usb/002/003 DEVTYPE=usb_device DEVICE=/proc/bus/usb/002/003 PRODUCT=67b/2303/400 TYPE=0/0/0 BUSNUM=002 DEVNUM=003 SEQNUM=1313 MAJOR=189 MINOR=130

KERNEL[1273260338.490483] add /devices/pci0000:00/0000:00:03.1/usb2/2-2/2-2:1.0 (usb) UDEV_LOG=3 ACTION=add DEVPATH=/devices/pci0000:00/0000:00:03.1/usb2/2-2/2-2:1.0 SUBSYSTEM=usb DEVTYPE=usb_interface DEVICE=/proc/bus/usb/002/003 PRODUCT=67b/2303/400 TYPE=0/0/0 INTERFACE=255/0/0 MODALIAS=usb:v067Bp2303d0400dc00dsc00dp00icFFisc00ip00 SEQNUM=1314

UDEV [1273260338.544093] add /devices/pci0000:00/0000:00:03.1/usb2/2-2 (usb) UDEV_LOG=3 ACTION=add DEVPATH=/devices/pci0000:00/0000:00:03.1/usb2/2-2 SUBSYSTEM=usb DEVNAME=/dev/bus/usb/002/003 DEVTYPE=usb_device DEVICE=/proc/bus/usb/002/003 PRODUCT=67b/2303/400 TYPE=0/0/0 BUSNUM=002 DEVNUM=003 SEQNUM=1313 ID_VENDOR=Prolific_Technology_Inc. ID_VENDOR_ENC=Prolific\x20Technology\x20Inc.\x20 ID_VENDOR_ID=067b ID_MODEL=USB-Serial_Controller_D ID_MODEL_ENC=USB-Serial\x20Controller\x20D ID_MODEL_ID=2303 ID_REVISION=0400 ID_SERIAL=Prolific_Technology_Inc._USB-Serial_Controller_D ID_BUS=usb ID_USB_INTERFACES=:ff0000: MAJOR=189 MINOR=130 DEVLINKS=/dev/char/189:130

UDEV [1273260338.544145] add /devices/pci0000:00/0000:00:03.1/usb2/2-2/2-2:1.0 (usb) UDEV_LOG=3 ACTION=add DEVPATH=/devices/pci0000:00/0000:00:03.1/usb2/2-2/2-2:1.0 SUBSYSTEM=usb DEVTYPE=usb_interface DEVICE=/proc/bus/usb/002/003 PRODUCT=67b/2303/400 TYPE=0/0/0 INTERFACE=255/0/0 MODALIAS=usb:v067Bp2303d0400dc00dsc00dp00icFFisc00ip00 SEQNUM=1314

KERNEL[1273260338.554806] add /devices/pci0000:00/0000:00:03.1/usb2/2-2/2-2:1.0/ttyUSB0 (usb-serial) UDEV_LOG=3 ACTION=add DEVPATH=/devices/pci0000:00/0000:00:03.1/usb2/2-2/2-2:1.0/ttyUSB0 SUBSYSTEM=usb-serial SEQNUM=1315

KERNEL[1273260338.554844] add /devices/pci0000:00/0000:00:03.1/usb2/2-2/2-2:1.0/ttyUSB0/tty/ttyUSB0 (tty) UDEV_LOG=3 ACTION=add DEVPATH=/devices/pci0000:00/0000:00:03.1/usb2/2-2/2-2:1.0/ttyUSB0/tty/ttyUSB0 SUBSYSTEM=tty DEVNAME=ttyUSB0 SEQNUM=1316 MAJOR=188 MINOR=0

UDEV [1273260338.557070] add /devices/pci0000:00/0000:00:03.1/usb2/2-2/2-2:1.0/ttyUSB0 (usb-serial) UDEV_LOG=3 ACTION=add DEVPATH=/devices/pci0000:00/0000:00:03.1/usb2/2-2/2-2:1.0/ttyUSB0 SUBSYSTEM=usb-serial SEQNUM=1315

UDEV [1273260338.655847] add /devices/pci0000:00/0000:00:03.1/usb2/2-2/2-2:1.0/ttyUSB0/tty/ttyUSB0 (tty) UDEV_LOG=3 ACTION=add DEVPATH=/devices/pci0000:00/0000:00:03.1/usb2/2-2/2-2:1.0/ttyUSB0/tty/ttyUSB0 SUBSYSTEM=tty DEVNAME=/dev/ttyUSB0 SEQNUM=1316 ID_PORT=0 ID_PATH=pci-0000:00:03.1-usb-0:2:1.0 ID_VENDOR=Prolific_Technology_Inc. ID_VENDOR_ENC=Prolific\x20Technology\x20Inc.\x20 ID_VENDOR_ID=067b ID_MODEL=USB-Serial_Controller_D ID_MODEL_ENC=USB-Serial\x20Controller\x20D ID_MODEL_ID=2303 ID_REVISION=0400 ID_SERIAL=Prolific_Technology_Inc._USB-Serial_Controller_D ID_TYPE=generic ID_BUS=usb ID_USB_INTERFACES=:ff0000: ID_USB_INTERFACE_NUM=00 ID_USB_DRIVER=pl2303 ID_IFACE=00 ID_VENDOR_FROM_DATABASE=Prolific Technology, Inc. ID_MODEL_FROM_DATABASE=PL2303 Serial Port MAJOR=188 MINOR=0 DEVLINKS=/dev/char/188:0 /dev/serial/by-path/pci-0000:00:03.1-usb-0:2:1.0-port0 /dev/serial/by-id/usb-Prolific_Technology_Inc._USB-Serial_Controller_D-if00-port0

Hi, seems like the device-file /dev/ttyUSB* for the USB2Serial adapter is not created by any udev default rule.

You have to add a new UDEV rule manually: Open an editor and create a new file named "prolific.rules" (extension rules is important)

The content of the file is:

#udev rules for prolific usb2serial boards
ATTRS{idVendor}=="067b", ATTRS{idProduct}=="2303", MODE="0666", SYMLINK+="ttyUSB%n"

The first line is a comment, the second one must be on a single line (no linefeed or carriage return allowed)

Copy this file as root to directory /etc/udev/rules.d/ plug your board in and see if it now appears in the Arduino-IDE.

Eberhard