BIND two HC-05 modules?

Two HC-05 modules. One is commanded to ROLE 0 The other is commanded to ROLE 1.
CMODE is set to 0 on the "ROLE 1" module.
Each is connected to its own UNO. Each responses as hoped ("OK"). However, I am unable to "BIND" the two modules. I have tried a variety of formats of mac addresses in the BIND commmands. Most errors are type zero (i.e. "ERROR(0)" ).

  1. Should I be using the BIND Command?
  2. Are there other appropriate "AT+" commands to connect the two modules "(master" and "slave")
  3. If you succesfully BIND two HC-05 modules please illlustrate the BIND command (including mac address format) you use.

Sketch code below:

#include <SoftwareSerial.h>
SoftwareSerial BTSerial(11, 12); // RX | TX

void setup()
{
  pinMode(9, OUTPUT);  // this pin will pull the HC-05 pin 34 (key pin) HIGH to switch module to AT mode
  digitalWrite(9, HIGH);
      pinMode(4, OUTPUT);
      digitalWrite(4, HIGH);
  Serial.begin(9600);
  Serial.println("Enter AT commands:");
  BTSerial.begin(38400);  // HC-05 default speed in AT command mode
  delay(5000);
}

void loop()
{
  digitalWrite(9, HIGH);
  // Keep reading from HC-05 and send to Arduino Serial Monitor
  if (BTSerial.available())
    Serial.write(BTSerial.read());
  // Keep reading from Arduino Serial Monitor and send to HC-05
  if (Serial.available())
    BTSerial.write(Serial.read());
     //  Serial.println(Serial.read());
}


Thanks for your future assistance.

I used the instructions on this page to bind 2 HC05 modules: https://howtomechatronics.com/tutorials/arduino/how-to-configure-pair-two-hc-05-bluetooth-module-master-slave-commands/
This worked very well for me.

Are you able to enter AT mode to make the changes? If not, this tutorial may help: Setting HC05 (ZS-040) to AT mode

I will check out your howto link. Thanks. I have two working HC-05 modules; one is a master and one is a slave. I realised that I will require LOTS OF HELL of the following ---> old "Instructables". Finally, I am at the point of trying to see if a master can control LEDs on the slave (and vice versa). I just found another (https://howtomechatronics.com/tutorials/arduino/how-to-configure-pair-two-hc-05-bluetooth-module-master-slave-commands/) tryout connection to control a motor or (in reverse) and LED.

First, I will check out the link you send me. Many thanks.

Tom

I think that the link that you found is the same that I posted.

Good luck.