Programmer is not responding/not in sync

I've been banging my head against the "Programmer is not responding" and "Not in sync" issues for several days, but finally found a solution.

For context, I'm working with an Ardweeny (Arduino clone) with a TTLy FTDI USB to serial adapter from Solarbotics. I've been trying to get the IDE set up under a new installation of Ubuntu 14.04 and under Windows 7, and I've received the same error in each. I found my solution under Ubuntu, though it will work in Windows as well.

The first step in debugging is to go to File -> Preferences and check the checkbox for 'Show verbose output during upload'.

Attempt an upload. The output screen will show "Binary sketch size: ..." and below it a command that will look something like this:

/usr/share/arduino/hardware/tools/avrdude -C/usr/share/arduino/hardware/tools/avrdude.conf -v -v -v -v -patmega328p -carduino -P/dev/ttyUSB0 -b57600 -D -Uflash:w:/tmp/build6694517456443535348.tmp/Blink.cpp.hex:i

The values will vary depending on the board you selected.

In Linux, you can highlight the command and copy it, open a terminal, and paste the command into the terminal. Edit the command and delete the "-b" parameter (-b57600 in this case) which sets the baud rate (the data transfer speed). Execute the command. If the upload is successful, then my solution will work for you.

Avrdude is the program that loads your compiled program, and all of the parameters are stored in the boards.txt file. The list of boards you select from is based on the contents of this file, and each board has a set of parameters that includes "upload.speed".

After seeing that omitting the "-b" parameter allowed the upload to work, I approached the problem from the perspective that the baud rate was the issue. The upload.speed parameter in the file is mandatory, so I had to find the correct value.

I ran the command string in the terminal, trying different standard baud rates in the "-b" parameter. In my case, 115200 worked! To fix the problem in the application, I needed to modify the file boards.txt.

In Ubuntu, I used the command "sudo gedit /usr/share/arduino/hardware/arduino/boards.txt" to edit the boards.txt file. In Windows 7, I navigated to C:\Program Files(x86)\Arduino\hardware\arduino and opened boards.txt in Notepad.

Since the instructions said to use Arduino Duemilanove w/ ATmega328, I copied the parameters for that board and made a new entry for Ardweeny. I changed the upload.speed to 115200, and changed all the references to "atmega328." to "ardweeny." (e.g. "" instead of " Duemilanove w/ ATmega328".

I saved the changes and have had clean uploads since.

I'd appreciate folks more experienced with Arduino testing to see if they can replicate my results.

Testing this approach in Windows is similar, but a little more convoluted.

Copy the avrdude command as before. In Windows I got the following:

C:\Program Files (x86)\Arduino\hardware/tools/avr/bin/avrdude -CC:\Program Files (x86)\Arduino\hardware/tools/avr/etc/avrdude.conf -v -v -v -v -patmega328p -carduino -P\.\COM5 -b115200 -D -Uflash:w:C:\Users\jwr\AppData\Local\Temp\build1045884840563787222.tmp\Blink.cpp.hex:i

Click Start and type cmd in the Search programs and files text box. This will open a terminal window where you can enter commands.

You can paste the avrdude command you copied into the window, but it will not be interpreted correctly because of the spaces in “Program Files (x86)”. Thus the “little more convoluted”.

Open Notepad and paste the command. Setting the format to word wrap is helpful.

Highlight the path before avrdude and press [Ctrl] to cut it. Go to the CMD window and type cd and then paste the path.

C:\Users\jwr> cd C:\Program Files (x86)\Arduino\hardware/tools/avr/bin/

That will switch us to the folder containing avrdude.

Going back to Notepad, we have another parameter containing “Program Files (x86)”. Highlight the path for the -C parameter up to /etc/avrdude.conf. Delete it and replace it with (two periods), making the parameter -C…/etc/avrdude.conf.

Delete the -b parameter (-b115200 in my example).

Notepad will now contain something like this:

avrdude -C…/etc/avrdude.conf -v -v -v -v -patmega328p -carduino -P\.\COM5 -D -Uflash:w:C:\Users\jwr\AppData\Local\Temp\build1045884840563787222.tmp\Blink.cpp.hex:i

Copy and paste into the CMD window. The upload should run successfully, indicating that the sync issue is due to an incorrect baud rate parameter.

Note that if your upload is working correctly, you can replicate the “not in sync” issue by changing the -b parameter to a different value, either in the command line interface as shown here or by changing the value in boards.txt.

My boards.txt file contains the Ardweeny entry that I added with my new upload speed value. All values are identical with the values for Arduino Duemilanove w/ ATmega328 that Solarbotics says to use except for the upload speed value. My entry works, while the recommended selection generates the “not in sync” error.

Hopefully this will be useful for others who are getting the “Programmer is not responding” or “not in sync” errors.