Two HC-05 communication

Hello.
I have two HC-05 modules, one as slave, another one as master.
They are successfully connected.

If master send for example println("L"), slave successfully receive "L\r\n" and turn on LED.
Oposite communication is not working - if slave successfully receive "L\r\n", it sends back println("ACK").

Master receives something, but it;s not readable. It looks like different baud rate is set, but both modules, master and slave has set uart to - AT+UART=38400,1,0.

Could you please help me, why master module does not receive correct response?

Thanks

ondrejtomcik:
Hello.
I have two HC-05 modules, one as slave, another one as master.
They are successfully connected.

If master send for example println("L"), slave successfully receive "L\r\n" and turn on LED.
Oposite communication is not working - if slave successfully receive "L\r\n", it sends back println("ACK").

Master receives something, but it;s not readable. It looks like different baud rate is set, but both modules, master and slave has set uart to - AT+UART=38400,1,0.

Could you please help me, why master module does not receive correct response?

Thanks

  1. physical Connection?

Swap the two modules, see if the problem follow a specific module.

chuck.

Don't expect anybody to help when your code is such a secret.

Hello and welcome :slight_smile:

Do you use Arduino Mega ? If yes then try add this in your setup()

void setup()
{
  digitalWrite( 19, HIGH ); // fix Serial1
  digitalWrite( 17, HIGH ); // fix Serial2
  digitalWrite( 15, HIGH ); // fix Serial3

http://forum.arduino.cc/index.php?topic=280928.0
http://forum.arduino.cc/index.php?topic=308965.0

Hello.
Thanks for answers.
Code is simple:
ToggleLight is called when BT modules are connected. (Master module)

void ToggleLight()
{
  BT.flush();
  BT.println("L");
  delay(200);
  while (BT.available())
  {
    Serial.write(BT.read());
  }
}

Code of slave module is:

void loop() {
  if (BT.available()) {
    if (BT.readStringUntil('\n') == "L\r") {
      BT.println("ACK"); // I also tried simple BT.write(1);
      // some action
    }
  }
}

Slave module always correctly receive "L\r\n". Response to master always comes but it's invisible, or E character, or question mark in box, dunno where could be problem.

Master hc-05 is connected to arduino nano, slave to uno.

Thanks.

I used different BT module and it's working. Maybe it's broken.
But I have another question please. Can slave module print address of master module, which is establishing the connection and stop it? Or does it have some in-build allow / block address list?

Thanks

The complete command set can be found here: http://www.linotux.ch/arduino/HC-0305_serial_module_AT_commamd_set_201104_revised.pdf

I read it already, but did not find any information regarding my question.
Allow / block list is maybe not there, but there should be the way to get address of connected/connecting device.

If I connect one HC 05 at the sending Arduino and one HC 06 at the receiving Arduino will it work?