I have my MEGA2560 board for two weeks and suddenly I cannot upload a new sketch!
Search all over internet and this forum to solve my issue but without any success!
This is repeating over and over while trying to upload:
the last couple of weeks, i struggled with this problem as well, now i found a solution, maybe it can help you
After programming in my Adruino Mega 2560 (r3) + Ethernetshield (r3) (osx) i couldn't upload anything to my board and received this error: avrdude: stk500v2_ReceiveMessage(): timeout
Loopbacktest: works
Removing the ethernetshield and all wires didnt change a thing.
Removing and reinserting the usb cable, after which i CAN upload the 'blink example' !
'Succes' so i tought!
When trying to upload my sketch : avrdude: stk500v2_ReceiveMessage(): timeout
Once this happens, nothing (i.e.'blink') is able to be uploaded again (until I remove and reinsert the usb cable)
In my sketch there is a line : client.println("FORWARD!!!");
if i remove one exclamation mark, the problem is solved ! ...
Woutr:
the last couple of weeks, i struggled with this problem as well, now i found a solution, maybe it can help you
After programming in my Adruino Mega 2560 (r3) + Ethernetshield (r3) (osx) i couldn't upload anything to my board and received this error: avrdude: stk500v2_ReceiveMessage(): timeout
Loopbacktest: works
Removing the ethernetshield and all wires didnt change a thing.
Removing and reinserting the usb cable, after which i CAN upload the 'blink example' !
'Succes' so i tought!
When trying to upload my sketch : avrdude: stk500v2_ReceiveMessage(): timeout
Once this happens, nothing (i.e.'blink') is able to be uploaded again (until I remove and reinsert the usb cable)
In my sketch there is a line : client.println("FORWARD!!!");
if i remove one exclamation mark, the problem is solved ! ...
That specific problem is the result of the mega2560/1280 bootloader having a useless 'monitor' function where if it sees three consective ! characters in the upload data stream it stops programming the chip an just waits for the user to enter monitor commands which will never happen in an arduino setup. Just changing that statement to:
client.println("FORWARD!"); would also solve that specific problem. There is newer modified bootloader code for the mega boards that fix the root cause but they are not part of the arduino IDE and don't ship with anyone selling mega boards.
Keep this in mind for the future. It doesn't have to be three exclamation points in a text string. I had it happen with data I had typed into an array in hex. Took me forever to find the problem and I knew about the !!! problem. If you decide to bite the bullet and replace the bootloader, I have a page on this on my blog at Desert Home: Arduino Mega2560 - Wrapping up the Bootloader Problem
This particular bootloader fixes watchdog timer also.
I use the Mega 2560 board and got the same error message. But i haven't used any exclamation marks. Is there any other such thing that i should look out for?
I have found that when I'm using the 1.0 IDE (the newer IDE won't run on my 10 year old Mac), that simply unplugging the USB between program uploads solves most upload timeout problems.
Good Luck!
I was getting this error on both my Mega2560 board and UNO (both chinese knock offs) Then I remembered I had cleaned up the junk that windows remembers each time you plug something in. So I re-installed the Chinese driver CH340SER (or something like it), still no joy. Then I thought well its doing it with both boards (one configured with 3 microphones and another with a BMP180 barometer/temp sensor so the problem is probably with my machine(s) win xp and win 8.1. I got to feeling like it must be something with Java (which on my xp machine keeps nagging me to upgrade to version 8 which won't work with XP! (very annoying). I poked around and looked for ways to use the Arduino w/out Java and found the AVR site.
if you grab some older versions (say June 07), avrdude may complain about not being able to find libusb0.dll, do a search on your computer for the file, then copy it to C:/Windows/System32 and try again! This is a known bug, hopefully to be fixed soon...
I then searched my puter for the libusb0.dll and found them all over the place but not in C:/Windows/System32. I moved a copy to that folder and bing back in business.
Try to use different programmers. I had the same problem when I was using avrisp2 (AVR ISP MKII) which kept giving me timeout error. After I switched to avrisp (AVR ISP), the file was able to be uploaded instantly.