[SOLVED] HC-06 Bluetooth Module And AT Commands
Maybe your like
So I have this HC-05 module that I am using...
In AT mode (LED flashing on module), if I send "AT". I get "OK" back. so all good so far!
However none of the other standard AT commands seem to be working!
I tried sending:
AT+PSWD=XXXX AT+PSWDXXXX AT+NAME=YYYYY AT+NAMEYYYYY
If I send them, I get no response and neither has anything changed on the module. ![]()
Anyone experienced similar issue with HC-06 modules?
Thanks.
mmdk95 February 23, 2021, 10:17am 2Try AT+HELP for a list of commands. Also, make sure you have the correct role selected. Some commands only work for role 0, others only work for role 1
sherzaad February 23, 2021, 11:38am 3mmdk95: Try AT+HELP for a list of commands.
same outcome.... no reply I only get an "OK" reply when I send only "AT"
mmdk95 February 23, 2021, 12:32pm 4Hmm strange indeed.
My other guesses would be that it may be sleeping (although I don't think you'd get a response back for AT either) or that your connection is not great and the data gets corrupted. You are not forgetting your carriage return and line feed right?
sherzaad February 23, 2021, 1:05pm 5mmdk95: You are not forgetting your carriage return and line feed right?
actually if I add those I do not get any response then even to the "AT" command
Nick_Pyner February 23, 2021, 2:37pm 6So what are you asking about? HC-06 or HC-05?
sherzaad February 23, 2021, 2:55pm 7Nick_Pyner: So what are you asking about? HC-06 or HC-05?
as the title stipulates... I'm asking about HC-06
Nick_Pyner February 23, 2021, 3:18pm 8For starters, AT+PSWD is not a valid command for HC-06, it is AT+PIN. Since you are getting a response to AT, you might try sending AT+VERSION, to see if anything comes back for that. If it says anything other than LINVOR1.5, it could be suss.
HC-06 uses no cr/lf but relies on timeout, and that can be a problem. I believe it is most reliable to send the commands from an Arduino programme as a one-shot in setup.
sherzaad February 23, 2021, 9:13pm 9Nick_Pyner: For starters, AT+PSWD is not a valid command for HC-06, it is AT+PIN. Since you are getting a response to AT, you might try sending AT+VERSION, to see if anything comes back for that. If it says anything other than LINVOR1.5, it could be suss.
HC-06 uses no cr/lf but relies on timeout, and that can be a problem. I believe it is most reliable to send the commands from an Arduino programme as a one-shot in setup.
You nailed it! I followed your advice and did a 'one-shot' programme and the HC06 module responded! ++ Karma! Now I can change my device name and PIN. Please see below the programme I used. this link helped me identify which commands were valid for the HC06: http://www.martyncurrey.com/hc-06-hc01-comv2-0/
#include <SoftwareSerial.h> //HC06 Bluetooth Module Command List const char COMM_CHK[] = "AT"; //Check if the command terminal work normally const char VERSION[] = "AT+VERSION"; //Get firmware, bluetooth, HCI and LMP version const char NAME[] = "AT+NAME"; //Set device name. To set device name add name string (20 char max) at end of this string const char PIN[] = "AT+PINyyyy"; //Set pin code for pairing. Replace 'yyyy' with desired pin const char SET_BAUDRATE[] = "AT+BAUDx"; //Replace 'x' with character corresponding to desired speed from list below to set device baudrate: /* 1 ——— 1200 2 ——— 2400 3 ——— 4800 4 ——— 9600 5 ——— 19200 6 ——— 38400 7 ——— 57600 8 ——— 115200 9 ——— 230400 A ——— 460800 B ——— 921600 C ——— 1382400 */ const char NOPARITY[] = "AT+PN"; //No parity check const char EVENPARITY[] = "AT+PE"; //Even parity check is set const char ODDPARITY[] = "AT+PO"; //Odd parity is set const char LEDON[] = "AT+LED1"; //turns (blue) board LED ON const char LEDOFF[] = "AT+LED0"; //turns (blue) board LED OFF const char SLAVEMODE[] = "AT+ROLE=S"; //set module into SLAVE mode const char MASTERMODE[] = "AT+ROLE=M"; //set module into SLAVE mode SoftwareSerial mySerial(4, 3); // RX, TX void send_AT_cmd(char *str) { Serial.println(str); mySerial.write(str); delay(1000); if (mySerial.available()) { while (mySerial.available())Serial.write(mySerial.read()); } Serial.println(""); } void setup() { // Open serial communications and wait for port to open: Serial.begin(115200); while (!Serial) { ; // wait for serial port to connect. Needed for Native USB only } // set the data rate for the SoftwareSerial port mySerial.begin(9600); delay(500); Serial.println("<<<<HC-06 AT commad setup>>>>!"); //comm check send_AT_cmd(COMM_CHK); //rename device module char newNAME[30]; strcpy(newNAME, NAME); strcat(newNAME, "WALL-e"); send_AT_cmd(newNAME); //set new device pin send_AT_cmd(PIN); } void loop() { // put your main code here, to run repeatedly: } Nick_Pyner February 24, 2021, 12:30am 10I'm really pleased to hear it worked so well. I thought I was a bit of a voice in the wilderness on this, and didn't know Martyn had the same approach.
This can be simpler, like
void setup() { // put your setup code here, to run once: Serial.begin(9600); //bluetooth Serial.print("AT+NAMEFosters"); //CHANGE NAME delay(1000); Serial.print("AT+PIN1234"); //CHANGE PASSWORD delay(1000); Serial.print("AT+BAUD8"); //CHANGE SPEED TO 115K void loop(){ } //one-shot - nothing herewith HC-06 on hardware serial, and no feedback. It just takes a bit of faith...
system Closed June 24, 2021, 12:30am 11This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.
Related topics
| Topic | Replies | Views | Activity |
|---|---|---|---|
| AT COMMANDS to HC-06 Networking, Protocols, and Devices | 9 | 29920 | May 6, 2021 |
| HC06 pairing problems Networking, Protocols, and Devices | 17 | 623 | July 12, 2025 |
| Bluetooth module hc-06 never responds to AT commands issued in arduino Networking, Protocols, and Devices | 2 | 1980 | May 6, 2021 |
| UNO and Bluetooth HC06 AT commands Networking, Protocols, and Devices | 34 | 10965 | May 6, 2021 |
| BT HC-06 Modul - keine Command Antwort Deutsch | 18 | 6907 | May 6, 2021 |
Tag » Arduino Hc-06 At Commands
-
AT Command Mode Of HC-05 And HC-06 Bluetooth Module : 5 Steps
-
Getting HC-06 Back Into AT-command Mode? - Arduino Forum
-
Bluetooth AT Commands Settings (HC05 HC06) - Arduino Project Hub
-
Using The HC-06 Bluetooth Module | MCU On Eclipse
-
Arduino Bluetooth AT Commands HC 05 HC 06 - YouTube
-
How To Configure The Bluetooth HC-06 Module With AT Commands ...
-
Configure HC-06 Demo
-
Bluetooth Module (HC-06) + Arduino - ESE205 Wiki
-
Arduino And Bluetooth Module HC-06 - AranaCorp
-
Arduino And HC-06 (ZS-040) | Martyn Currey
-
Using AT Commands To Set Up Your Bluetooth Module : HC-05 And ...
-
AT Command Mode Of HC-05 And HC-06 Bluetooth Module - Pinterest
-
Arduino AT Not Working (Arduino UNO And HC-06)
-
HC-05 And HC-06 Bluetooth Modules - Wolles Elektronikkiste