Hi All,
How can I send AT command to AT-09 (HM-10 clone) BLE module ?
The Arduino code is :
Bluetooth device name is changed successfully
On B4R I tried these:
An error message arrives "ERR" or nothing happens
Thanks.
How can I send AT command to AT-09 (HM-10 clone) BLE module ?
The Arduino code is :
B4X:
#include <SoftwareSerial.h>
SoftwareSerial mySerial(2, 3);
void setup()
{
mySerial.begin(9600);
Serial.begin(9600);
delay(200);
mySerial.println("AT+NAMEdemoBleX");
while (mySerial.available())
{
Serial.write(mySerial.read());
}
delay(200);
}
void loop()
{
}
On B4R I tried these:
B4X:
Private Sub AppStart
Serial1.Initialize(115200)
Log("appstart")
softserial.Initialize(9600, 2, 3)
astream.Initialize(softserial.Stream, "astream_newdata", Null)
'test 1
'astream.Write("AT+NAMEbleDemoBR".GetBytes) '-> receive ERR
'astream.Write("AT+NAMEbleDemoBR") '-> receive ERR
'astream.Write("AT+NAMEbleDemoBR\r\n".GetBytes) '-> receive ERR
'test 2
'Dim message As String
'message = "AT+NAMEbleDemoBR" + CRLF
'astream.Write(message.GetBytes) '-> no answer, no change BLE name
'test3
'astream.Write("AT+NAMEbleDemoBR".GetBytes)
'astream.Write(Array As Byte(10))
'astream.Write(Array As Byte(13)) '-> receive ERR
'test4
Dim buffer() As Byte
Dim message As String
message = "AT+NAMEbleDemoBR"
buffer = message.GetBytes
astream.Write(buffer) '-> receive ERR
Log("AppStart End")
End Sub
Sub astream_NewData (Buffer() As Byte)
Log("recieve: ", Buffer)
End Sub
Thanks.
Last edited: