La subida a un Nano a través de un HC-05 falla con stk500_getsync not in sync
Traducido del English por IA ·
Me encargo de una casa de huéspedes y voy aprendiendo sobre la marcha, así que perdón si esto es una tontería. Tenemos un Arduino Nano encima del techo del comedor que lee dos sensores de posición de compuertas y los pasa a un ESP32, que los envía a nuestro panel de Hermetry. Cada vez que quiero cambiar el sketch del Nano necesito una escalera y tengo que abrir una placa del techo.Leí que se puede subir por Bluetooth con un HC-05, así que compré uno (placa azul, en la parte trasera dice ZS-040, en el anuncio pone v4.0). Lo emparejé con mi portátil, muestra un puerto COM, lo selecciono en el IDE de Arduino y subo. Me aparece:
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x00
Conecté el TX del HC-05 al RX del Nano, el RX al TX a través de un divisor, VCC a 5 V, GND. El pin STATE está conectado a RESET porque así lo mostraba un video.
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.
Traducido del English por IA ·
¿A qué baudios está configurado el HC-05? El mío venía de fábrica a 9600.
What baud is the HC-05 set to? Mine came at 9600 out of the box.
Traducido del English por IA ·
Pregunta de principiante total, pero ¿por qué no pasar la tarea del Nano al ESP32 y actualizar ese por Wi-Fi?
Total beginner question, but why not put the Nano’s job on the ESP32 and update that one over Wi-Fi?
Traducido del English por IA ·
Kevin, quizás algún día. El Nano ya está cableado y no quiero volver a rehacer el techo. No conozco la velocidad en baudios del HC-05, no cambié nada.
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.
Traducido del English por IA ·
¿Elegiste la placa y el procesador correctos? Los Nano antiguos necesitan «ATmega328P (Old Bootloader)».
Did you pick the right board and processor? Old Nanos need «ATmega328P (Old Bootloader)».
Traducido del English por IA ·
El punto de Kevin A es importante, porque determina la velocidad en baudios que debe usar el HC-05: el bootloader antiguo usa 57600 y el nuevo Optiboot usa 115200. Primero hay que configurar el HC-05 a esa misma velocidad con comandos AT.
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.
Traducido del English por IA ·
Y STATE no es una señal de reset. Pasa a alto una sola vez cuando se conecta el enlace Bluetooth, no genera un pulso cuando arranca avrdude. Eso por sí solo produce resp=0x00.
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.
Traducido del English por IA ·
Aisha y Ciaran tienen las dos causas. Hice esto una vez para un Nano en una unidad de tratamiento de aire, aquí está la receta completa para la placa ZS-040.1. Ponga el HC-05 en modo AT: mantenga pulsado el botoncito mientras lo alimenta, el LED parpadea lentamente (aproximadamente cada 2 s). Comuníquese con él a 38400 desde un adaptador USB-serie. 2. Configúrelo (115200 si su Nano funciona con «ATmega328P», 57600 si solo funciona «Old Bootloader»):
AT+ROLE=0
AT+UART=115200,0,0
AT+POLAR=1,0
AT+POLAR=1,0 hace que PIO11 baje a nivel bajo mientras hay un enlace activo. 3. Cableado del reset. La ZS-040 no saca PIO11 a un pin de cabecera, así que suelde un cable fino al pin 32 del módulo. Conéctelo al RESET del Nano a través de un condensador de 0,1 uF, igual que lo hace el DTR del chip USB. Cuando avrdude abre el puerto, el enlace se establece, PIO11 baja, el condensador convierte eso en un pulso de reset corto, y el bootloader queda escuchando. 4. Desconecte STATE de RESET.Es delicado, y la primera sincronización tras emparejar a veces falla, así que pruebe dos veces antes de volver a depurar.
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.
Traducido del English por IA ·
¡Funciona! Mi Nano solo se carga con «Old Bootloader», así que configuré AT+UART=57600,0,0. Soldar en el pin 32 fue lo más aterrador, un vecino con una punta fina me ayudó. La primera carga falló, la segunda funcionó, tal como dijo Laura. El panel del techo ya está cerrado.
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.
- Debes estar registrado para responder a este debate.
Únete a la conversación
Inicia sesión para preguntar y responder, dar me gusta a las publicaciones útiles y marcar la respuesta que resolvió tu problema. Cada aportación suma puntos y niveles.

