//RoboIndia Code for HC-05 with AT Mode
//https://www.roboindia.com/tutorials
#include <SoftwareSerial.h>
SoftwareSerial BTSerial(5, 6); // RX | TX
void setup()
{
Serial.begin(9600);
Serial.println("Enter AT commands:");
BTSerial.begin(38400); // HC-05 default speed in AT command more
}
void loop()
{
if (BTSerial.available()) // read from HC-05 and send to Arduino Serial Monitor
Serial.write(BTSerial.read());
if (Serial.available()) // Keep reading from Arduino Serial Monitor and send to HC-05
BTSerial.write(Serial.read());
}
I am trying to get an Uno communicating with a Nano, each with an HC-05.
As a very first step, Nano responds to my keyboard commands in the serial monitor.
The Uno does the Serial.println("Enter AT commands:") but does not respond to commands.
I have triple checked the wiring, yes, I have 1k and 2kl on each board. I have swapted HC-05s. They are fine.
The Uno has been put straight to Tx/Rx and downloaded the "null" sketch and still can't get any response, even to "AT" command.
I don't know what to try next with the Uno.
Any suggestions?
Let's step back a moment and do a thought experiment.
Let's assume I have the same wiring on both boards. Let's assume I have the same sketch, see above sketch. Let's assume I can get the Uno/HC-05 combo to work with an Android app whereby text from my Android is displayed in the serial monitor. Let's assume Win11.
Is there any reason why the sketch in question should work on a Nano and not an Uno.
Not from a software perspective. But such thought experiments are not usually productive. What is productive, is active troubleshooting using divide and conquer methodology.
The Uno and Nano differ almost not at all, considering the code above. They use almost the same processor (identical except for package).
What do you hope to gain from this thought experiment? Especially since the answer is basically "no".
OK. That says what you need to say about code and connections. What you now need to tell us is if you are getting the slow LED flash confirming you are actually in AT mode.
They are wired the same, and running the same sketch.
Should I send more close-up photos?
Should I make a fritzing of each (same mind, same eyes, problem!).
Humour me. Try running your project with Bluetooth disconnected and in your pocket. I guarantee you will get the same message. So what do you do, other than conclude it is redundant? It might as well say "the moon is made of cheese".
As I said, your code and wiring are surely kosher, but the pictures are useless, and you need to post your code in the proper manner. Use the </> tags, as described in the how to use this forum. For all we know the code is the same and you are just using different ports. Maybe they are and that is your intention, who knows?
If you want to get the HC05s into AT mode so that you can make changes to their setup, this tutorial (of mine) has helped others. >> Setting HC05 (ZS-040) to AT mode
I thought I had posted the code properly.
Thank you for the heads up.
I'll try to do it properly tomorrow.
The hc05 in pocket will, yes, give me the same result as if hooked up in my current scheme.
I'll start over tomorrow.
No, that wasn't the solution.
I did change boards and got each of them to respond to "AT" command. But then when I unplugged each and took them to a Win10 machine neither one responded. Then back to the Win11 machine and again neither will respond to "AT".
It as if they will only respond to AT once, then they lock out or something.
I don't know what to do next. Buy two new HC-06?
Definitely not. What you are trying to do is far from clear but, whatever it is, two HC-06s will not solve the problem. HC-06 is a slave-only device. In the light of
you need one Bluetooth to be a master. The other can be a slave, i.e. HC-06, but it doesn't do any better a job than the HC-05 currently employed.
I have no idea of what you are trying to do with Windows 10, 11, but this is an Arduino forum and I suggest you stick with the HC-05s you already have. Nothing you have said suggests that there is anything wrong with them, indeed, quite the opposite.