HC-05 Bluetooth AT Mode can change NAME but not PIN.

Trying to Change Name and Password of HC-05 Bluetooth Module.
Changing Name is successful using AT+NAME=myName AT Command.
But changing Pin using AT+PSWD=5678 confirms as OK but Module connects to Mobile with default 1234.

SKETCH

#include <SoftwareSerial.h>
SoftwareSerial BTSerial(10, 11);

void setup(){
  
  Serial.begin(9600);
  
  BTSerial.begin(38400);
        
}

void loop(){

  if ( BTSerial.available() )
    Serial.write(BTSerial.read());
    
  if ( Serial.available() )
    BTSerial.write(Serial.read());  
  
}

SERIAL MONITOR

AT ----> OK
AT+VERSION? ---> +VERSION:4.0-20190815
AT+NAME? ----> +NAME:myName
OK
AT+NAME=newName ---->OK
AT+NAME? ----> +NAME:newName
OK
AT+PSWD? ----> +PSWD:1234
OK
AT+PSWD=5678 ----> OK
AT+PSWD? ----> +PSWD:5678
OK
AT+RESET ----> OK
OK

hc05_passwrod.png

1 Like

So, what happens if you omit the AT+RESET?

Result is the same. I am unable to change the pin from default 1234.
Checked this with all my HC-05 modules.

That surprises me, but what would I know? I have never bothered to change the password. It is just faintly possible that you must use "advanced AT mode" to do this. Pressing the button isn't enough and you need to apply 3.3v to pin 34. Check the Martyn Currey website.

Installing public devices with password 1234 is a big security issue.
Is this issue known?
Is there anything in procedure to follow. Why Name is changed successfully but not PIN?

Probably not. See reply #3.

I have tried all methods at Martyn Currey website. 3.3v to Pin 34, High to Key Pin and Pressing Buttons while powering. Nothing worked.

If you have an HC-05 v3, I believe it might be suss. I understand they are quite OK, so long as you stay away from AT mode, where they have a mind of their own. I assume they identify themselves with the version query.