Avrdude: stk500v2_ReceiveMessage timeout

Hello folks,

I have found a similar post pointing to cable problem or not to use USB3.
Well in my case it's neither as its the same with multiple ports and multiple computers and now to make things worse the device is built into a box making physical access impossible for it so all I can really do is power off the whole device restart it and hope that it's gonna do the programming.

Just out of curiosity:

for ((;;)); do make upload && break; done

Trying to forceupload it for hours will not make any difference.

There is 1 solution here which guaranteed to work: When uploading the sketch manually reset the device with shorting out the RESET and GND pin, this works 100%

But as I said in my case I no longer have physical access to the Arduino and don't want to take apart the device.

BTW mine is Arduino Pro Micro.

This is beyond annoying even during developing to these boards on completely different laptops I get tons of upload errors, upload fails a lot and I just have to keep trying and trying and trying until both led finally flashing and the sketch uploaded finally. This is completely nerve wrecking and the Arduino IDE would not even offer that small complement to autoupload the sketch forever until it succeeds so you have to sit there and keep pushing the UPLOAD button like a billion times.

I have requested this as a future, it was never added.

So any1 any1 suggestion how to do anything from software against this if possible?

I dont think there is an issue with the cable or comm because my arduino frequently sends data through the USB and there is no problem at all.

If everything else fails, you have to :wink: You might have to do it once to add a reset button.

For a ProMicro, it is usually a double reset to get it in bootloader mode.

You can invoke the bootloader by opening and closing the serial port with a baudrate of 1200 baud. After that you have 8 seconds to start the upload. This might not work if your previously loaded sketch is the root cause of the problem.

It might be advisable to use a script that performs this action followed by an upload with avrdude via the command line.