Comment 23 for bug 460857

Revision history for this message
David (david-depowell) wrote :

I was a little hesitant to do that, because last time I did it my computer wouldn't boot any more and I had to reinstall from scratch, because of a bug in grub. But I went ahead and tried it anyway, and sure enough it helped. When I plug and unplug the Arduino, /dev/ttyUSB0 comes and goes with it. So far so good.

However, my "original" problem remains. I tried running avrdude from the command line (via a simple script that I created) to write a hex file to the Arduino. The file simply says:

/usr/bin/avrdude -pm168 -carduino -P/dev/ttyUSB0 -b19200 -v -Uflash:w:Template.hex:a

It actually ran (but failed) on the first try, giving me two lines of "programmer not responding". Remembering what you said about the RTS reset, I tried it again, this time hitting the reset button on the Arduino. This time it hung just like before, where ctl-c was ignored. Ctl-z did pause it, but actually killing it seems impossible. Here's a short transcript of what transpired:

david@studyHP:~/apps$ jobs
[1]- Running tail -f /var/log/messages & (wd: ~)
[2]+ Stopped ./avrdude.sh
david@studyHP:~/apps$ kill -n 9 2
bash: kill: (2) - Operation not permitted
david@studyHP:~/apps$ jobs -l
[1]- 2173 Running tail -f /var/log/messages & (wd: ~)
[2]+ 2211 Stopped ./avrdude.sh
david@studyHP:~/apps$ kill -9 2211
david@studyHP:~/apps$ jobs
[1]- Running tail -f /var/log/messages & (wd: ~)
[2]+ Killed ./avrdude.sh
david@studyHP:~/apps$ jobs
[1]+ Running tail -f /var/log/messages & (wd: ~)
david@studyHP:~/apps$ ps u
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
david 2133 0.0 0.0 21392 4200 pts/0 Ss 19:45 0:00 bash
david 2173 0.0 0.0 9460 832 pts/0 S 19:46 0:00 tail -f /var/log/messages
david 2212 0.0 0.0 0 0 pts/0 D 19:51 0:00 [avrdude]
david 2293 0.0 0.0 15164 1136 pts/0 R+ 20:02 0:00 ps u

As you can see, as far as bash is concerned the job is gone, but ps shows it still there as a zombie.
I disconnected the Arduino, and got "usb 4-1: USB disconnect, address 3" in var/log/messages. However, just like before, the device is still there:

david@studyHP:~/apps$ ls -l /dev/ttyU*
crw-rw---- 1 root dialout 188, 0 2010-01-01 19:51 /dev/ttyUSB0
david@studyHP:~/apps$ lsof -i |grep /dev/ttyUSB0
david@studyHP:~/apps$

If you can actually program your Arduino with 64 bit Ubuntu, I'm not going to give up yet, but man it shouldn't be this hard to do.

David