user21351: I have 2 HM10 Bluetooth modules connected to 2 Arduino Teensy running the following code.
void setup() {
  Serial.begin(9600);
  Serial1.begin(9600);
  // If the baudrate of the HM-10 module has been updated,
  // you may need to change 9600 by another value
  // Once you have found the correct baudrate,
  // you can update it using AT+BAUDx command 
  // e.g. AT+BAUD0 for 9600 bauds
}

void loop() {
  char c;
  if (Serial.available()) {
    c = Serial.read();
    Serial1.println(c);
  }
  if (Serial1.available()) {
    c = Serial1.read();
    Serial.print(c);    
  }
}

By pairing them using the AT commands I was able to send messages back and forth by writing to Serial1. However now when I try to send AT commands it will just send the string to the other module instead of replying OK etc. How do I break the connection and make the AT commands work again?
The tutorial I used to pair the modules.

user39003: I was able to break the connection with:
AT
The data sheet says to use AT+PWRM1, but it didn't work for me. Instead the above command dropped the connection to the remote device.
From the Datasheet:

Execute “AT+PWRM1” command, Module will auto into sleep mode when
power on or disconnect from remote device.


user40306: To Break Connection via BT Commands, I do the following (programmatically):
command 1: AT
command 2: AT+IMME1
When the BT is in Work Mode it does not recognize regular BT commands.  The exception to this is the AT command by itself. But, it must be followed by another command (#2) within the Supervision Timeout Period which is fairly quick. IMME1 takes the BT back to AT Mode where it is no longer connected and will recognize your AT[+...] commands. If the Save Setting is enabled, it will attempt auto-reconnect too quickly...

21351: <p>I have 2 HM10 Bluetooth modules connected to 2 Arduino Teensy running the following code.</p>

<pre><code>void setup() {
  Serial.begin(9600);
  Serial1.begin(9600);
  // If the baudrate of the HM-10 module has been updated,
  // you may need to change 9600 by another value
  // Once you have found the correct baudrate,
  // you can update it using AT+BAUDx command 
  // e.g. AT+BAUD0 for 9600 bauds
}

void loop() {
  char c;
  if (Serial.available()) {
    c = Serial.read();
    Serial1.println(c);
  }
  if (Serial1.available()) {
    c = Serial1.read();
    Serial.print(c);    
  }
}
</code></pre>

<p>By pairing them using the AT commands I was able to send messages back and forth by writing to Serial1. However now when I try to send AT commands it will just send the string to the other module instead of replying OK etc. How do I break the connection and make the AT commands work again?</p>

<p><a href="http://www.instructables.com/id/How-to-Use-Bluetooth-40-HM10/" rel="nofollow noreferrer">The tutorial</a> I used to pair the modules.</p>
 39003: <p>I was able to break the connection with:
AT</p>

<p>The data sheet says to use AT+PWRM1, but it didn't work for me. Instead the above command dropped the connection to the remote device.</p>

<p>From the Datasheet:</p>

<ol start="2">
<li>Execute “AT+PWRM1” command, Module will auto into sleep mode when
power on or disconnect from remote device.</li>
</ol>
 40306: <p>To Break Connection via BT Commands, I do the following (programmatically):<br>
command 1: <code>AT</code><br>
command 2: <code>AT+IMME1</code><br>
When the BT is in Work Mode it does not recognize regular BT commands.  The exception to this is the AT command by itself. But, it must be followed by another command (#2) within the Supervision Timeout Period which is fairly quick. IMME1 takes the BT back to AT Mode where it is no longer connected and will recognize your AT[+...] commands. If the Save Setting is enabled, it will attempt auto-reconnect too quickly...</p>
