Go Down

Topic: HC-05 doesn't respond to AT commands even though it is in AT mode (Read 725 times) previous topic - next topic

felic

I have a couple of HC-05 modules and I wanted to set one up as a master device. Therefore I have to change it's settings in AT mode. But I just can't get the module to respond to my AT command.  

I can connect to the module via Bluetooth without a problem using the default password.
I tested the module for basic sending and receiving of serial data and that works like a charm. (@9600 baud btw)

Here is what I've been doing to get into AT mode:
Hold the button on the PCB then apply power and release the button after a few seconds.
-> As expected the module's LEDs begin to blink slowly [2 secs off], [2 secs on], ...
-Sending the letters AT using the Arduino Serial monitor didn't return the expected "OK". I tried all available baud rates (even though 38400 should have done it). Newline was set to CR+LF.

I also tried the exact same thing, but instead of holding the button, I set pin 34 to high before applying power. This also got me into AT mode (slow LED blinking).

But as before it didn't respond to AT commands.  


I'm quite certain everything is connected correctly because as I said, receiving/sending serial data via the Bluetooth connection works just fine.  



What could I be doing wrong? This thing has been driving me nuts for the last three days. I wasted soo many hours; it's quite unbelievable...  

I already tested 3 different HC-05 modules. -> Same result every time.  
I also tried it from my Android tablet. -> Same results. (It only sent "AT\r" though. But that should have generated an AT response anyways.)

Nick_Pyner

I also tried it from my Android tablet. -> Same results. (It only sent "AT\r" though. But that should have generated an AT response anyways.)
That doesn't sound right at all.

Unless you have set up some pretty smart TTL serial cable fom Android, I would suggest no, it shouldn't. Nothing should happen at all.

If the power is applied to bluetooth, it can only be in one of two modes - AT mode, or communications mode, and never both. If it is in comms mode it will talk to Android, if it is in AT mode it won't.

If you have the slow blink, it confirms you are in AT mode. It does not confirm your wiring is correct.

felic

I'm not sure if this is a misunderstanding, but I connected the HC-05 via serial and bluetooth to my Tablet at the same time. In non-AT mode @9600baud I was able to send and receive data through the HC-05.
When I started the HC-05 in AT mode (baud 38400) and sent "AT" to the HC-05, my tablet was not sending "AT\r\n", but "AT\r". And I got no response. Sending "AT" without CR or LF didn't result in anything as well. 

But a fried of mine confirmed that the HC-05 should respond with something, even if you just send "AT\r".

Nick_Pyner

It is either a misunderstanding, or your friend is lying.

The fact that you can send/receive DATA in non AT mode is irrelevant other than that it confirms nothing is broken.

How are you connecting your tablet to the HC-05 when it is in AT mode? It might be time to read reply #1 again.

felic

I never said I was able to send/receive data in AT-mode.
I can receive/send data via the non-AT-mode.

I have an OTG-USB cable for my tablet and I have a USB TTL adapter connected to that. So I have a COM port on my tablet. That is how I connect the HC-05 to my tablet in AT-mode.

When I'm in non-AT-mode I connected it the same way, but in addition to that I also connected it to the tablet via bluetooth.


And my friend is not lying. He said that while being in AT-mode he sent "AT" via the serial connection to the HC-05 and the serial monitor was set to "Carriage Return" and "38400 baud". The HC-05 responded with a massive amount of "OK"s. When he used "Both CR & LF" the HC-05 responded with "OK". The responses came over the serial connection.

The Bluetooth functionality per se was completely ignored while being in AT-mode, both by me and by my friend.

felic


Nick_Pyner

Take the tablet out of the game and use the PC in the normal manner.  This will probably mean you have to use software serial to communicate with bluetooth.

If you have the slow blink, it confirms you are in AT mode. It does not confirm your wiring is correct.

You can only use 38400 in AT mode.

Check the Martyn Currey website for proper code.

felic

I only used Android to confirm what I have experienced when doing the same thing on my Windows PC. 
The Bluetooth connection works just fine. No need to test that.
I'm also not using an Arduino for testing the HC-05 because it is just another potential point of failure. 
I'm connecting it directly to my PC using my TTL-USB adapter. 

But it doesn't matter I have already tried it with an Arduino in the first place. 

Nick_Pyner

This thing has been driving me nuts for the last three days. I wasted soo many hours; it's quite unbelievable...

I'm also not using an Arduino for testing the HC-05 because it is just another potential point of failure. 
I'm connecting it directly to my PC using my TTL-USB adapter. 
Good luck with that then, and it is now clear what your real problem is. You are on the wrong forum. You need a PC forum. This is an Arduino forum, quite densely populated by Arduino users who use their Arduinos to configure HC-05s and usually get a result before they get depressed.

felic

I'm not sure if you're on drugs or something, but if anyone should be upset here, then it's certainly me. Why do I constantly have to repeat myself? Why did it took you until post #8 to realize that I' connecting to the HC-05 directly via a TTL cable? 

If you're not reading what I'm writing before answering, then the one who should reconsider if this forum is the right place for him is certainly you.

Nick_Pyner

I'm not sure if you're on drugs or something, but if anyone should be upset here, then it's certainly me. Why do I constantly have to repeat myself? Why did it took you until post #8 to realize that I' connecting to the HC-05 directly via a TTL cable? 
Well, not only was that the first time you mentioned that you were attempting to configure an HC-05 with a PC but also I'm afraid it took me that long to realise that anybody might do anything so stupid. Further, not only were you never clear about what you were trying to do, but also you are deafeningly silent about the Arduino you are using, while some of the smaller ones use a TTL-USB adapter to connect to PC, and thus it would entirely appropriate equipment to configure an HC-05 with one of those Arduinos in the normal manner. 

I apologise for for taking so long. If I had realised what a futile waste of time this was, I would never have attempted to help in the first place.

felic

Well, not only was that the first time you mentioned that you were attempting to configure an HC-05 with a PC
That doesn't even matter because, as I said, my tablet showed the exact same results (besides the fact that my tablets serial console was only able to end messages with a \r instead of the officially required \r\n).

you were attempting to configure an HC-05 with a PC but also I'm afraid it to me that long to realise that anybody might do anything so stupid.
How is that stupid? I'm just taking a potential point of failure out of the equation. A HC-05 can receive AT commands from any serial connection. 
And as I said about three time, I have tried it with an Arduino in the first place and that didn't work either.

not only were you never clear about what you were trying to do
I provided a detailed description of what I've been trying and I think it's pretty obvious that I'm trying to get the HC-05 to take my AT commands properly. Anything that goes beyond that is not relevant to the topic.

but also you are deafeningly silent about the Arduino you are using
Oh well, guess why that is. I didn't use an Arduino 90% of the time I was testing.
And I also don't see how that is relevant. If you would have read my posts properly, you would know that the cannot be the problem. (I tested with a Mega, two different Unos and two different Pro Minis. For the Pro Minis I had to use my TTL USB adapter which is an original UM232R FTDI. That's the same adapter I used for directly connecting the HC-05 to my PC and to my tablet.)

If I had realised what a futile waste of time this was, I would never have attempted to help in the first place.
I can only repeat myself: The Arduino didn't change anyhting. I tested a variety of different ones and non of them did the job. And the fact that interfacing the HC-05 directly with a console shoed the same results just further proves that it is not the lack of using an Arduino causing this issue here.

vignesh95


Nick_Pyner

I can't see how that could be the problem. I think he might have connected Tx to Tx but there is probably no point in pursuing this. The thread is rather old.

mauried

Some bluetooth modules require that the AT commands are sent with no gaps between the characters, so you cant send them by typing.
You either have to send them from the Arduino using serial , or some PC terminal programs have a batch send capability which allows full speed sending of text strings.


Go Up