HC05 wont switch from slave to master mode on Arduino Nano Every

I'm working on a small project and for it I need to pair two HC05 Bluetooth modules together.

No matter what I do or what kind of tutorial I follow I never seem to be able to change the role from slave to master on any of my modules. It always stays on slave.

After "AT+ROLE=1" it displays "OK" but it never changes the value to "+ROLE:1", it stays as "+ROLE:0".

I'm using:

2x Arduino Nano Every

2x HC05 modules (I also have 2x HC06 but they are no use if I cant ger a master one)

I'm using code from SoftwareSerialExample - Arduino example (followed this tutorial: https://www.youtube.com/watch?v=SWEDCZSa3ow&list=LL&index=2&ab_channel=techiesms):

#include <SoftwareSerial.h>

SoftwareSerial mySerial(2, 3);

void setup() {
  // Open serial communications and wait for port to open:
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }
  // set the data rate for the SoftwareSerial port
  mySerial.begin(38400);
  //mySerial.println("Hello, world?");
}

void loop() { // run over and over
  if (mySerial.available()) {
    Serial.write(mySerial.read());
  }
  if (Serial.available()) {
    mySerial.write(Serial.read());
  }
}

I only changed the baud values

Serial monitor:

AT+ROLE?
+ROLE:0
AT+ROLE=1
OK
AT+ROLE?
+ROLE:0

HC05 pin connection:

RXD - D3
TXD - D2
GND - GND
VCC - 5V
EN - none
STATE - none

The LED on the HC05 module blinking every 2 sec.

AT+STATE? => gives me "+STATE:PAIRABLE"? Could this be it?

What could be the problem? How can I fix this? Are my HC05 broken? Are there other ways of setting a role for a HC05?

Some things to try... warning: the HC05 was bad.

It's not likely to be your issue, but there is no need to use software serial on a Nano Every. Unlike the classic Nano, the Tx and Rx pins at 0/1 are a hardware serial port addressed as Serial1. It is independent from the usb serial. It is much better to use Serial1 rather than software serial for connection to the HC05 serial.

In the absence of a result, there is a faint possibility that you are not jogging the AT mode hard enough and need to lean 3.3v against the EN pin. There may be something on the Martyn Currey website to that effect.

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