Avrdude errors - out of nowhere!

Hi all, first post in this forum. I am a newbie in all things Arduino!

I am getting the following errors:

avrdude: stk500_recv(): programmer is not responding

avrdude: stk500_getsync() attempt of 10: not in sync

This is very strange as I have not had any issues for the last 2 weeks or so that I have been using my Arduino Uno (a 'Hero' board as part of the inventr.io kits). I have uploaded many sketches until today with no problems.

The loopback test failed. I tried using 2 different Uno boards, 2 different USB cables, and 2 different USB ports on my machine (an old MacBook Pro c.2014 running High Sierra). I've restarted the machine.

The system is recognizing the port that I'm using and I am selecting the correct board (Uno). All seems ok, as expected. But failure when I try to upload. When plugged in, the board 'ON' light is on, and the

I have scoured through https://support.arduino.cc/hc/en-us/sections/360003198300

Maybe I should re-install Arduino IDE? Currently installed is v1.8.19.

Interesting, now I run this code:

void setup() {
  Serial.begin(9600);
  Serial.println("Setup row");
}

void loop() {
  Serial.println("Loop forever");
  delay(1000);
}

And the output in the Serial Monitor is:
Setup row
Loop forever
Loop forever
Setup row
Loop forever
Loop forever
Loop forever
Loop forever
//etc

Why does it push the setup code 2 times here? Could this be related to the issue I'm describing above?

When I see those errors I restart everything and it usually resolves the problem but I also double check to be sure things are correct for the board etc. I also see the "double setup()" a lot and just add a five second or so delay at the beginning of setup. It is really prevalent on the ESP devices. It still appears but with the delay it is obvious which is the correct start. I have seen this on several different types of boards. I use Linux, for me this is not a show stopper. Try putting a delay(5000); before Serial.begin().

How did you upload that. Just to make sure that we're not spending time on an error that's possibly no longer an error.

Thank you both for your help. Sorry I was away for a couple of weeks. The delay(5000) process did correct the double setup. That is a weird issue, any idea why this happens?

In terms of my other issues, I was able to upgrade my very old Mac and I am now also using Arduino IDE 2.0, things seem to be working fine for me now. My hunch is the issue is with the computer itself but hopefully the OS upgrade did the trick, so far so good.

Thanks again!

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.