PASSWORD HC-05

Hi everyone, I have a problem with setting the password in the hc-05 module.
I can set the name, master / slave and other values, but when I try to use AT + PSWD = 1234, the serial monitor returns ERROR (1D).
Has anyone already had this problem? Thank you for the reply.

Senza titolo-1.jpg

try to do so
AT+PSWD="1234"

3 Likes

It works, thank you

It's my pleasure. Do you have a command at + link works? What sequence of AT commands do you implement? I have a problem: HC-05 firmware 2.0-20161226 - Networking, Protocols, and Devices - Arduino Forum

hey guys help my hc-05 version is VERSION:3.0-20170601 but when i try to change the default password with at command below it gives this error message
AT+PSWD=1243
when i press enter it displays
ERROR:(1D)

YEAH ME I HAVE THE SAME PROBLEM my hc-05 version is VERSION:3.0-20170601 but when i try to change the default pass word with at command it gives this error message
AT+PSWD=1243
when i press enter it displays
ERROR:(1D)

IM TRYING TO FIX IT RIGHT NOW!!

kraiv:
try to do so
AT+PSWD="1234"

kraiv:
try to do so
AT+PSWD="1234"

thanks man this worked!!!

1 Like

Hi can any one tell me where do i find all the At commands for the HC-05 Bluetooth

Davit1243:
Hi can any one tell me where do i find all the At commands for the HC-05 Bluetooth

I suggest learning to how to Google.

Hello everyone, I had connect my HC-05 module according to

i changed the password using command AT+PSWD=5678 , then i checked it with AT+PSWD? which shows me changed password.

But problem is when i restart Bluetooth (Disconnect VCC of HC-05 and Connect again) password again changed to 1234.

I tried using AT+PSWD="5678" also but problem still persist.

Is there any other command that doesn't stick, like AT+Name=, for instance? I submit the best bet is that you didn't change the password, you just thought you did. It may merely be a matter of NL and or CR on the monitor
Try

The following is for HC-05 with button switch e.g. ZS-040 on Mega, using Serial1 . This approach uses keyboard entry, rather than the simple one-shot above.
Hold button down as you connect the power - easy. The LED flashes much more slowly, about two seconds on and two seconds off.

/                        *HC-05 ex Currey
Serial monitor           9600       Both NL & CR
The ">" character indicates the user entered text.
AT+NAME=name         AT+UART=115200,0,0          */
char c=' ';
boolean NL = true;

void setup() {
Serial.begin(9600);
Serial1.begin(38400);    // this is for Bluetooth in AT mode, irrespective of comms speed.
Serial.println("Serial active...enter  AT command");
}

void loop() { 
      if (Serial1.available())   \\Bluetooth in
    {
        c = Serial1.read();
        Serial.write(c);
    }
 
    if (Serial.available())      \\keyboard 
    {
        c = Serial.read();
        Serial1.write(c);       
        if (NL) { Serial.print(">");  NL = false; }  // Echo 
        Serial.write(c);
        if (c==10) { NL = true; }
    }
}

If you are using software serial on a Uno etc, you need to use that library and pins to match, but may still call it Serial1.

I tried above code. AT+NAME command worked well but AT+PSWD does not work. it changes password only for session but after restart it reset to 1234

OK, if you can change the name OK, you have proven that you know what you are doing. From here, it looked like you didn't.

IF you tried both commands in the same session
AND got an OK on both occasions, thereby proving your command entry is correct
BUT one would stick and the other wouldn't

THEN I'm afraid I can only conclude you have a truly weird and unique problem, best solved by replacing the faulty module. I say "I'm afraid I can only conclude" because I think these modules are pretty reliable and robust. One exception is HC-05 v3, so would you be kind enough to send

AT+VERSION?

and tell us what comes back? If it is v3 with a date of recent years, that might explain your problem.

I had the same problem

AT+PSWD="6666"
AT+UART=38400 ,0,0

So what version of HC-05 are you using?

Hi everyone
I would like to set the password (pin) from within an Arduino sketch rather than using the on-line monitor. I have written a short sketch for the Arduino Due that I thought was emulating the actions of the monitor but is obvoiously not doing so as it causes the HC-05 to hang.
Can anybody point me in the right direction here?
Many thanks

05at_code.ino (1.43 KB)