# Can't configure HC-05 as master

**URL:** <https://forum.arduino.cc/t/cant-configure-hc-05-as-master/965577>\
**Category:** Networking, Protocols, and Devices\
**Created:** [March 4, 2022, 12:26am UTC](https://forum.arduino.cc/t/cant-configure-hc-05-as-master/965577 "2022-03-04T00:26:45Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![Owl2](https://avatars.discourse-cdn.com/v4/letter/o/7bcc69/32.png) [@Owl2](https://forum.arduino.cc/u/Owl2)\
**Post date:** [March 4, 2022, 12:26am UTC](https://forum.arduino.cc/t/cant-configure-hc-05-as-master/965577/1 "2022-03-04T00:26:45Z")

</div>

I am trying to configure the HC-05 as master by using the AT+ROLE command:

```cpp
AT+ROLE=1
OK

```

The response is "OK". However, if I check the role, it says that the role is 0, which stands for slave:

```cpp
AT+ROLE?
+ROLE:0

```

I tried AT+INQ, which requires being in master mode, but it returns an error:

```cpp
AT+INQ
ERROR:(16)

```

I guess it confirms that the module is not in master mode.

I tried restoring the settings (AT+ORGL) and resetting (AT+RESET) before and after changing the role, but it is still always at zero. Changing role to 2 also returns "OK" but the role does not actually change.

I am using hardware serial for reading AT commands from PC and software serial for reading response from HC-05.

```cpp
#include <SoftwareSerial.h>

SoftwareSerial softSerial(2, 3);

void setup() {
  Serial.begin(19200);
  softSerial.begin(38400);
}

void loop() {
  if (softSerial.available()) {
    char c = softSerial.read();
    Serial.write(c);
  }
  if (Serial.available()) {
    char c = Serial.read();
    softSerial.write(c);
  }
}

```

My wiring schematic is shown below:

 ![Schematic](https://europe1.discourse-cdn.com/arduino/original/4X/2/f/1/2f1fa87eb677c18a48b67f05876d1d824adbac77.png)

I would appreciate any help on this

---

<div class="post-metadata">

**Author:** ![mrburnette](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/mrburnette/32/702556_2.png) [@mrburnette](https://forum.arduino.cc/u/mrburnette)\
**Post date:** [March 4, 2022, 1:00am UTC](https://forum.arduino.cc/t/cant-configure-hc-05-as-master/965577/2 "2022-03-04T01:00:29Z")

</div>

maybe helpful:  
[https://medium.com/@karkhanaclub/how-to-enable-and-use-at-commands-of-hc-05-using-arduino-f8983fa56eaa](https://medium.com/@karkhanaclub/how-to-enable-and-use-at-commands-of-hc-05-using-arduino-f8983fa56eaa)

Added:

[http://edge.rit.edu/edge/P17310/public/Final%20Documents/Latch%20Arm%20Control%20Box.pdf](http://edge.rit.edu/edge/P17310/public/Final%20Documents/Latch%20Arm%20Control%20Box.pdf)

---

<div class="post-metadata">

**Author:** ![anon85221860](https://avatars.discourse-cdn.com/v4/letter/a/59ef9b/32.png) [@anon85221860](https://forum.arduino.cc/u/anon85221860)\
**Post date:** [March 4, 2022, 1:06am UTC](https://forum.arduino.cc/t/cant-configure-hc-05-as-master/965577/3 "2022-03-04T01:06:14Z")

</div>

[Arduino with HC-05 (ZS-040) Bluetooth module – AT MODE | Martyn Currey](http://www.martyncurrey.com/arduino-with-hc-05-bluetooth-module-at-mode/)

---

<div class="post-metadata">

**Author:** ![groundFungus](https://avatars.discourse-cdn.com/v4/letter/g/73ab20/32.png) [@groundFungus](https://forum.arduino.cc/u/groundFungus)\
**Post date:** [March 4, 2022, 1:15am UTC](https://forum.arduino.cc/t/cant-configure-hc-05-as-master/965577/4 "2022-03-04T01:15:00Z")

</div>

When you start the HC05 in AT mode (EN to 3.3V) how does the LED flash?

I set up my Uno with an HC05, EN pin to 3.3V, and tried your code. I can change role, code works fine.

---

<div class="post-metadata">

**Author:** ![mrburnette](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/mrburnette/32/702556_2.png) [@mrburnette](https://forum.arduino.cc/u/mrburnette)\
**Post date:** [March 4, 2022, 1:15am UTC](https://forum.arduino.cc/t/cant-configure-hc-05-as-master/965577/5 "2022-03-04T01:15:09Z")

</div>

From [runaway\_pancake](https://forum.arduino.cc/u/runaway_pancake) link, this statement

> There are 2 options for entering Master Mode; bring Pin 27 HIGH or bring pin 28 HIGH. Pin 27 allows you to use software and pin 28 allows you to use a hardware switch.

> In an earlier post I mentioned that it looks likes pin 27 or pin 28 has to be pulled HIGH to enter Master Mode and this does indeed seem to be the case. Everything I have tried without pulling the pin(s) HIGH has failed. They reply with “OK” and if you interrogate with “AT+ROLE” they report “+ROLE=1” but they are actually still in Slave Mode. They reply with “OK” and if you interrogate with “AT+ROLE” they report “+ROLE=1” but they are actually still in Slave Mode.

I cannot confirm the above behavior.

---

<div class="post-metadata">

**Author:** ![Owl2](https://avatars.discourse-cdn.com/v4/letter/o/7bcc69/32.png) [@Owl2](https://forum.arduino.cc/u/Owl2)\
**Post date:** [March 4, 2022, 10:12am UTC](https://forum.arduino.cc/t/cant-configure-hc-05-as-master/965577/6 "2022-03-04T10:12:08Z")

</div>

> [@mrburnette](#):
>
> maybe helpful:  
> [https://medium.com/@karkhanaclub/how-to-enable-and-use-at-commands-of-hc-05-using-arduino-f8983fa56eaa](https://medium.com/@karkhanaclub/how-to-enable-and-use-at-commands-of-hc-05-using-arduino-f8983fa56eaa)

From the article:

> As the module has 2 modes Partial AT mode and Full AT mode.  
> ...  
> The only change to switch the module from Partial to Full AT mode is the switch that was released when the wire was connected to the 3.3V, now for switching it to Full AT mode, the switch must not be left unpressed, and wire should be connected now without letting the switch go.

In my attempts I was not holding the button, so, according to this article, the module must have been in Partial AT mode. I tried pressing the button, powering up the HC-05, and sending AT commands (all while the button is still pressed). The only difference I noticed is that AT+MPIO? returns different values when the button is pressed and released. But I am still unable to change the role.

---

<div class="post-metadata">

**Author:** ![Owl2](https://avatars.discourse-cdn.com/v4/letter/o/7bcc69/32.png) [@Owl2](https://forum.arduino.cc/u/Owl2)\
**Post date:** [March 4, 2022, 10:15am UTC](https://forum.arduino.cc/t/cant-configure-hc-05-as-master/965577/7 "2022-03-04T10:15:33Z")

</div>

> [@groundFungus](#):
>
> When you start the HC05 in AT mode (EN to 3.3V) how does the LED flash?

The LED is blinking with 2 seconds interval (On for 2 seconds and Off for 2 seconds)

---

<div class="post-metadata">

**Author:** ![Owl2](https://avatars.discourse-cdn.com/v4/letter/o/7bcc69/32.png) [@Owl2](https://forum.arduino.cc/u/Owl2)\
**Post date:** [March 4, 2022, 10:17am UTC](https://forum.arduino.cc/t/cant-configure-hc-05-as-master/965577/8 "2022-03-04T10:17:56Z")

</div>

> [@mrburnette](#):
>
> From [runaway\_pancake](https://forum.arduino.cc/u/runaway_pancake) link, this statement
> 
> > There are 2 options for entering Master Mode; bring Pin 27 HIGH or bring pin 28 HIGH. Pin 27 allows you to use software and pin 28 allows you to use a hardware switch.
> 
> > In an earlier post I mentioned that it looks likes pin 27 or pin 28 has to be pulled HIGH to enter Master Mode and this does indeed seem to be the case. Everything I have tried without pulling the pin(s) HIGH has failed. They reply with “OK” and if you interrogate with “AT+ROLE” they report “+ROLE=1” but they are actually still in Slave Mode. They reply with “OK” and if you interrogate with “AT+ROLE” they report “+ROLE=1” but they are actually still in Slave Mode.
> 
> I cannot confirm the above behavior.

I tried connecting pin 27 and 28 to 3.3V, but I didn't notice any difference at all.

---

<div class="post-metadata">

**Author:** ![rpiloverbd](https://avatars.discourse-cdn.com/v4/letter/r/cab0a1/32.png) [@rpiloverbd](https://forum.arduino.cc/u/rpiloverbd)\
**Post date:** [March 4, 2022, 11:41am UTC](https://forum.arduino.cc/t/cant-configure-hc-05-as-master/965577/9 "2022-03-04T11:41:17Z")

</div>

I proceeded this way a few years ago.

1)AT

Answer was OK.

1. AT+UART?

Answer was +UART:9600,0,0 OK.

3)AT+ROLE=1

Answer was OK.

4)AT+CMODE=0

Answer was OK.

AT+BIND= 9\*\*\*, **,** \*\*\*  
Here I typed the slave's address after the equal sign. There was a point to be noted. At the time of slave configuration, I got the slave's address that contained some numbers and semicolons. But in the command above I had to replace semicolons by commas. And the answer was 'OK'.

At the time of master-slave operation, slave has to be powered up before the master.

---

<div class="post-metadata">

**Author:** ![Owl2](https://avatars.discourse-cdn.com/v4/letter/o/7bcc69/32.png) [@Owl2](https://forum.arduino.cc/u/Owl2)\
**Post date:** [March 4, 2022, 12:02pm UTC](https://forum.arduino.cc/t/cant-configure-hc-05-as-master/965577/10 "2022-03-04T12:02:32Z")

</div>

I repeated the same steps, and the answer was always OK. But I can't connect to slave (AT+PAIR and AT+LINK give errors) and AT+ROLE? still returns 0.

---

<div class="post-metadata">

**Author:** ![rpiloverbd](https://avatars.discourse-cdn.com/v4/letter/r/cab0a1/32.png) [@rpiloverbd](https://forum.arduino.cc/u/rpiloverbd)\
**Post date:** [March 5, 2022, 8:25am UTC](https://forum.arduino.cc/t/cant-configure-hc-05-as-master/965577/11 "2022-03-05T08:25:57Z")

</div>

At the times of up of powering both the Slave and Master module, you have to keep the power buttons pressed for 3 seconds and then release them. Are you following this step?

---

<div class="post-metadata">

**Author:** ![Owl2](https://avatars.discourse-cdn.com/v4/letter/o/7bcc69/32.png) [@Owl2](https://forum.arduino.cc/u/Owl2)\
**Post date:** [March 16, 2022, 5:55pm UTC](https://forum.arduino.cc/t/cant-configure-hc-05-as-master/965577/12 "2022-03-16T17:55:40Z")

</div>

It did not help either.

---

<div class="post-metadata">

**Author:** ![Owl2](https://avatars.discourse-cdn.com/v4/letter/o/7bcc69/32.png) [@Owl2](https://forum.arduino.cc/u/Owl2)\
**Post date:** [March 16, 2022, 6:04pm UTC](https://forum.arduino.cc/t/cant-configure-hc-05-as-master/965577/13 "2022-03-16T18:04:49Z")

</div>

I ended up buying a new HC-05 module. I did exactly the same steps with it, which i previously tried with the old one. And the new one worked just fine.  
BTW, the 2 modules look different. The faulty one has 2 black chips and 1 white chip on it and it has only 1 red LED. The good module has 3 black chips and 2 LEDS: red and blue.

---

<div class="post-metadata">

**Author:** ![Nick\_Pyner](https://avatars.discourse-cdn.com/v4/letter/n/e8c25b/32.png) [@Nick\_Pyner](https://forum.arduino.cc/u/Nick_Pyner)\
**Post date:** [March 16, 2022, 11:27pm UTC](https://forum.arduino.cc/t/cant-configure-hc-05-as-master/965577/14 "2022-03-16T23:27:11Z")

</div>

Please provide a link to the new device.

---

<div class="post-metadata">

**Author:** ![rpiloverbd](https://avatars.discourse-cdn.com/v4/letter/r/cab0a1/32.png) [@rpiloverbd](https://forum.arduino.cc/u/rpiloverbd)\
**Post date:** [March 19, 2022, 11:21am UTC](https://forum.arduino.cc/t/cant-configure-hc-05-as-master/965577/15 "2022-03-19T11:21:54Z")

</div>

Good to know that. May be the previous one was a knock off.

---

<div class="post-metadata">

**Author:** ![Brazilino](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/brazilino/32/1198404_2.png) [@Brazilino](https://forum.arduino.cc/u/Brazilino)\
**Post date:** [March 19, 2022, 1:09pm UTC](https://forum.arduino.cc/t/cant-configure-hc-05-as-master/965577/16 "2022-03-19T13:09:29Z")

</div>

> [@Nick\_Pyner](#):
>
> Please provide a link to the new device.

I would like to see it too.

---

<div class="post-metadata">

**Author:** ![Owl2](https://avatars.discourse-cdn.com/v4/letter/o/7bcc69/32.png) [@Owl2](https://forum.arduino.cc/u/Owl2)\
**Post date:** [March 19, 2022, 5:09pm UTC](https://forum.arduino.cc/t/cant-configure-hc-05-as-master/965577/17 "2022-03-19T17:09:13Z")

</div>

The old one: [https://aliexpress.ru/item/1005002168332848.html?\_ga=2.122264075.1255622978.1647457450-1975065871.1614176644&sku\_id=12000018925700215](https://aliexpress.ru/item/1005002168332848.html?_ga=2.122264075.1255622978.1647457450-1975065871.1614176644&sku_id=12000018925700215)

The new one: [https://www.ozon.ru/product/modul-bluetooth-hc-05-arduino-269103746/?sh=uCjgTOFu7A](https://www.ozon.ru/product/modul-bluetooth-hc-05-arduino-269103746/?sh=uCjgTOFu7A)

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [September 15, 2022, 5:09pm UTC](https://forum.arduino.cc/t/cant-configure-hc-05-as-master/965577/18 "2022-09-15T17:09:50Z")

</div>

Closed on September 15, 2022, 5:09pm UTC

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
