Go Down

Topic: Arduino UNO SIM5215e (Read 2406 times) previous topic - next topic

indubluefish

Hi Guys,
Iam having issue with Interfacing arduiino uno with SIM5215E board.

I dumber the demo code into arduino as suggested from the below website.
When i type AT commands from the Serial monitor am not receiving an reply from board.
Can u tell me if there any setting i need to change.
I need an basic code to send and SMS and make a call.

#include <SoftwareSerial.h>
SoftwareSerial mySerial{2,3);

int8_t SendATCommand(char *ATcommand,char *expected_answer,unsigned int timeout)
{
  uint8_t x=0,answer=0;
  char response[200];
  unsigned long previous;
  memset(response,'\0',sizeof(response));
  delay(100);
  while(Serial.available() > 0) Serial.read();
  Serial.println(ATcommand);
  x=0;
  previous = millis();
  do
  {
    if(Serial.available() != 0)
    {
      response
  • = Serial.read();

      x++;
      if(strstr(response,expected_answer) != NULL)
      {
        answer = 1;
      }
    }
  }while((answer == 0)&&((millis() - previous) < timeout));
  return answer;
}

int8_t answer;
char aux_str[30];
char phone_number[] = "xxxxxxxx";//Modify your want to send information.
void setup()
{
  Serial.begin(115200);
  Serial.println("Starting.....");
  delay(3000);
  SendATCommand("AT+CPIN=****","OK",2000);
  delay(3000);
  Serial.println("Connecting to the network...");
  while(SendATCommand("AT+CREG?","+CREG: 0,1",500) ||
        SendATCommand("AT+CREG?","+CREG: 0,5",500));
  Serial.println("Seting SMS mode....");
  SendATCommand("AT+CMGF=1","OK",1000);//set the sms mode to text
  Serial.println("Sending SMS");
  sprintf(aux_str,"AT+CMGS=\"%s\"",phone_number);
  answer = SendATCommand(aux_str,">",2000);//send the sms number
  if(answer == 1)
  {
    Serial.println("welcome to elecfreaks!!!!!!");
    Serial.write(0x1A);
//    answer = SendATCommand("","OK",20000);
//    if(answer == 1)
//    {
//      Serial.println("Send message success!!");
//    }
//    else
//    {
//      Serial.println("Send message false!!");
//    }
  }
  else
  {
    Serial.print("error: ");
    Serial.println(answer,DEC);
  }
}

void loop()
{
}

indubluefish

Please somebody help me out promptly.
I placed the Arduino UNO on the SIM5215e module and network LED is also blinking as per recommendation.

AM not getting any reply like OK for any of the AT command in the serial monitor.

vintageradio

I have worked successfully with SIM800L based units but I'm not familiar with the SIM5215e. The first thing I'd try is just to connect a simple ascii terminal emulator such as PuTTY to your SIM5215e.   If you can get it to communicate with that, they move on to making your code work.

Go Up