How to toggle DTR from command line

I've received some great help on this forum, and just need one more piece to get my Mega working.

I put the Arduino IDE into verbose mode (thanks to Eberhard) to see the string it uses to upload with avrdude. When I execute the exact same avrdude string in a command line it does not work. I receive the following message: ser_recv(): programmer is not responding

Also helping was Lefty who suggested I toggle DTR before sending the avrdude command. Does anyone know how to do this? I am running Fedora 12 Linux, and my Mega is on /dev/ttyUSB0.

I tried the following, and it did not work: stty -F /dev/ttyUSB0 hupcl

Any help will be greatly appreciated. I'm trying to get this up an running for my son as a Christmas gift.............

OK, I found the solution. Here is the script I wrote:

stty 57600 raw ignbrk hup < /dev/ttyUSB0 && avrdude -C/home/Dad/ArduinoDev/arduino-0017/hardware/tools/avrdude.conf -v -v -v -v -pm1280 -cstk500v1 -P/dev/ttyUSB0 -b57600 -D -Uflash:w:/home/Dad/sketchbook/Blink/applet/Blink.cpp.hex:i

This seems to toggle DTR then runs avrdude to upload my file. This worked in Fedora 12 Linux with ny Arduino Mega on /dev/ttyUSB0

Hey Jab,

Isn't there is a simple way in the code to access it. I want to toggle DTR in my code, Is that possible. I am using Arduino Duemilanove?

Thanks for any help!

Just to leave a note on people searching this thread in the future. I've read that the newest version of AVRDUDE has a 'arduino' programmer defined that will automatically perform the DTR auto-reset before it attempts to communicate to the device being programmed. Not sure when it will be included in the Arduino IDE distribution.

Lefty

Jab:

That's weird stty -F /dev/ttyUSB0 hupcl works for me on Fedora 13.