HM 10 BLE Module not responding to AT commands

Hi,

I am trying to connect an HM10 BLE module to Arduino UNO and sending AT commands to it via Serial Monitor.

This is the code :

#include <SoftwareSerial.h>

SoftwareSerial BTSerial(10, 11); // RX | TX

void setup()
{
Serial.begin(9600);
Serial.println(“Enter AT commands:”);
BTSerial.begin(38400);
}

void loop()
{
if(Serial.available())
{
Serial.println(“Writing to BT”);
BTSerial.write(Serial.read());
// BTSerial.flush();
Serial.println(“Still Writing to BT”);
}
if(BTSerial.available())
{
Serial.println(“Reading BT”);
Serial.write(BTSerial.read());
Serial.println(“Still Reading BT”);
}
}

On uploading the code to Arduino and sending “AT” via Serial Monitor(baud rate : 9600 and “No line ending” were set), I get the following :

Writing to BT
Still Writing to BT
Writing to BT
Still Writing to BT

The “AT” is being read as “A” and “T”. This is because I tried several inputs and for each character it outputs :
Writing to BT
Still Writing to BT

Even tried escape sequences and sent for example, “AT\r\n” but each character in this is being read individually hence not getting the desired response. Also tried BTSerial.flush() but that too didn’t work.

How can I make “AT” or any command be read as a single entity and not individualized characters?