I've been able to easily use Arduino UNO with RF (two way comm) and ESP8266 with wifi. Both set up and running in under 30 minutes. Bluetooth is another story: weeks trying. I'm using HC-05 BT modules (I have two, neither works), windows 11, Arduino IDE. I can pair the HC-05 with my computer BT device and it connects and computer indicates two ports, COM4 and COM5. These also appear in the IDE. I can easily switch the HC-05 into and out-of command (AT) mode, and I can modify parameters if necessary. When I do a AT-UART? I get a response of 115200, the baud rate.
I then use a sketch to blink the on-board LED, remove the USB connection and use a 12 volt wallwart to supply power to the UNO and HC-05.
So far, everything is working as it should. The HC-05 is blinking rapidly (2/sec) indicating waiting for connection. When I upload to COM4 using Bluetooth only, there is no error and all compiler and download messages are normal, but THEN IT HANGS just before completing the task where it says "Using Port: COM4"
"Using Programmer: ARduino"
"Overriding Baud Rate: 115200"
Many minutes later, it returns an error: "An error occurred while uploading the sketch"
I tried using hardware serial only instead of Software serial, tried a new UNO, tried the second HC-05, tried different USB ports, checked Control Panel and Device Manager that show all is normal: COM4 and COM5 stating "standard serial over Bluetooth link".
This should be a slam-dunk. All I can think of is Windows11 security affecting incoming connections BUT my BlueTooth works with other devices (eg the keyboard I'm typing on). I also checked Windows Defender and Event Viewer to see if there was COM port errors. Nothing.
The HC-05s are new, could be Chinese knock-offs though. Any ideas?
Not a duplicate post. I was asking at first how to do OTA WITHOUT using HC-05 becuase I gave up on them, but the new post is all about the NEW HC-05 attempt. First post was everything but HC-05, this post is everything ABOUT HC-05
It's about OTA, at least. The other thread has lots of context that would help people understand what you're doing better. If I didn't remember the other thread, I would be a little baffled about what you're trying to do here. In the other thread, there were some explanations of the involvement of the DTR pin in the upload process and so on, there is no mention of it here.
In a nutshell, it was this:
I tried Bluetooth to death, didn't work, so wanted to accomplish the same end (OTA) with other technology. I got the others to work, sort of, but found too much overhead (programming, or hardware) with it so I RETURNED to the Bluetooth thing, becuase like I said, it SHOULD BE a slam-dunk. I'm going to try Bluetooth on a Win7 computer.
What about DTR? I thought it was mentioned but no. The DTR pin must be toggled by the serial controller, in order to reset the AVR at the right time to enable an upload. Very likely, BT can't do that.
Yes, I was aware of DTR, in fact aware for the last 45 years! In the old days we had to make our 25 pin or 15 pin D-shell connectors using many of the handshaking lines. I'd wire 9-10 pins, depending on what printer/modem/plotter we were interfacing to. What a pain.
However, not ONE of the many YouTube tutorials or of the very many forum comments ever mentioned DTR (except the one you sent me), and yet they were all claiming it all worked fine. I have 2-3 Instructables that show this, claim this, so I didn't think it had to be implemented. I will try it.
How is the HC-05 connected to the UNO? If it's attached to the hardware serial ports TX/RX, that is not sufficient to do an upload. If you look at an Arduino schematic, you will always see a line from the serial to USB IC to the AVR reset circuit. If it's a 16U2, it might not be labelled "DTR" but if a serial to USB ASIC IC is used, it will be DTR, and the PC uploading software treats both as DTR. The serial programmer boards for the Pro Mini also connect DTR to the Pro, for the same reason, it's needed to enable the upload sequence.
I'm not really surprised that YouTube videos and Instructable posts don't mention it.
DTR is pin 13 of the 16U2 on the UNO, it pulls reset low through capacitor C5 "USB Boot EN".
https://docs.arduino.cc/hardware/uno-rev3
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.