Hi there,
I am using Arduino Uno with sim800c. The tx and rx are connected to arduino with 1k resistors as described in the datasheet.
#include <SoftwareSerial.h>
SoftwareSerial mySerial(11, 10);
void setup()
{
mySerial.begin(9600); // Setting the baud rate of GSM Module
Serial.begin(9600); // Setting the baud rate of Serial Monitor (Arduino)
delay(100);
}
void loop()
{
if (Serial.available()>0)
switch(Serial.read())
{
case 's':
SendMessage();
break;
case 'r':
RecieveMessage();
break;
}
if (mySerial.available()>0){
Serial.write(mySerial.read());
}
}
void SendMessage()
{
mySerial.println("AT");
delay(1000);
}
void RecieveMessage()
{
mySerial.println("AT+CNMI=2,2,0,0,0"); // AT Command to receive a live SMS
delay(1000);
}
This is the code I am using. When I send the command "AT" it sends AK instead of OK. This is the problem with all the AT commands.