New: the AI firewall watches the whole platform and explains each incident in plain words. See how it works

Uploading to a Nano through an HC-05 fails with stk500_getsync not in sync

Uploading to a Nano through an HC-05 fails with stk500_getsync not in sync

Solved 8 7

I look after a guesthouse and I’m learning as I go, so sorry if this is silly. We have an Arduino Nano above the ceiling of the dining room that reads two damper position sensors and passes them to an ESP32 which sends them to our Hermetry dashboard. Every time I want to change the Nano’s sketch I need a ladder and have to open a ceiling tile.

I read you can upload over Bluetooth with an HC-05, so I bought one (blue board, says ZS-040 on the back, v4.0 in the listing). Paired it with my laptop, it shows a COM port, I select it in the Arduino IDE and upload. I get:

avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x00

I wired HC-05 TX to Nano RX, RX to TX through a divider, VCC 5 V, GND. The STATE pin is connected to RESET because a video said so.

♥ 0

What baud is the HC-05 set to? Mine came at 9600 out of the box.

Ask me about 4–20 mA.
♥ 2

Total beginner question, but why not put the Nano’s job on the ESP32 and update that one over Wi-Fi?

Still waiting for the gateway to reconnect.
♥ 0

Kevin, maybe one day. The Nano is already wired up and I don’t want to redo the ceiling. I don’t know the HC-05’s baud, I didn’t change anything.

♥ 0

Did you pick the right board and processor? Old Nanos need “ATmega328P (Old Bootloader)”.

Measure twice, poll once.
♥ 0

Kevin A’s point matters, because it decides which baud the HC-05 has to use: old bootloader is 57600, the new Optiboot one is 115200. The HC-05 has to be set to that same speed with AT commands first.

♥ 0

And STATE isn’t a reset signal. It goes high once when the Bluetooth link connects, it doesn’t pulse when avrdude starts. That alone gives you resp=0x00.

♥ 0

Aisha and Ciaran have the two causes. I did this for a Nano in an air handler once, here’s the whole recipe for the ZS-040 board.

1. Put the HC-05 in AT mode: hold the little button while powering it, the LED blinks slowly (about every 2 s). Talk to it at 38400 from a USB-serial adapter. 2. Set it up (115200 if your Nano works with “ATmega328P”, 57600 if only “Old Bootloader” works):

AT+ROLE=0
AT+UART=115200,0,0
AT+POLAR=1,0

AT+POLAR=1,0 makes PIO11 go low while a link is up. 3. Reset wiring. The ZS-040 doesn’t bring PIO11 out to a header pin, so solder a thin wire to pin 32 of the module. Connect it to the Nano’s RESET through a 0.1 uF capacitor, the same way the USB chip’s DTR does it. When avrdude opens the port, the link comes up, PIO11 drops, the capacitor turns that into a short reset pulse, and the bootloader is listening. 4. Disconnect STATE from RESET.

It’s fiddly, and the first sync after pairing sometimes fails, so try twice before you start debugging again.

Accepted solution♥ 5

It works! My Nano only uploads with “Old Bootloader”, so I set AT+UART=57600,0,0. Soldering to pin 32 was the scariest part, a neighbour with a fine tip helped. First upload failed, second one worked, like Laura said. The ceiling tile stays closed now.

♥ 2
Viewing 9 posts – 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.

Join the conversation

Sign in to ask and answer, like helpful posts and mark the reply that solved your problem. Every contribution earns points and levels.

Share