Can't let two HM-10 always connect

Hi all!
I use two UNO boards and two HM-10 Bluetooth so they can be interconnected, but when I power off and restart, they can't connect automatically. I also keyed "AT+CONNL", and it didn't return any message. :face_exhaling:
This is my serial port window:


These are my code:

#include <SoftwareSerial.h>
int HM10_TxD = 2; int HM10_RxD = 3;
SoftwareSerial BT(HM10_TxD, HM10_RxD);
char cB, cS;
void setup()
{
  Serial.begin(115200);
  BT.begin(115200);
}
void loop() {
  if (Serial.available()) {
    cB = Serial.read();
    BT.print(cB);
  }
  if (BT.available()) {
    cS = BT.read();
    Serial.print(cS);
  }
}

Please help me, thanks!

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