How can I store text messages and list them using GSM module?


i'm trying make mobile phone using gsm module "sim900a", able make calls , send text messages want make list of messages sent mobile gsm , able read them. should add code this?

this link tutorial have followed more info:
http://www.instructables.com/id/gsm-sim900a-with-arduino/

code: [select]
/*this tutorial used gsm sim900a mini v3.9.2
 
  connect 5vt d9 , 5vr d10
  feed gsm sim900a arduino's 5v

  code idayu sabri - mybotic
*/

#include <softwareserial.h>
softwareserial myserial(9, 10);
char msg;
char call;

void setup()
{
  myserial.begin(9600);   // setting baud rate of gsm module 
  serial.begin(9600);    // setting baud rate of serial monitor (arduino)
  serial.println("gsm sim900a begin");
  serial.println("enter character control option:");
  serial.println("h : disconnect call");
  serial.println("i : receive call");
  serial.println("s : send message");
  serial.println("c : make call"); 
  serial.println("e : redial");
  serial.println();
  delay(100);
}

void loop()

  if (serial.available()>0)
   switch(serial.read())
  {
    case 's':
      sendmessage();
      break;
    case 'c':
      makecall();
      break;
    case 'h':
      hangupcall();
      break;
    case 'e':
      redialcall();
      break;
    case 'i':
      receivecall();
      break;
  }
 if (myserial.available()>0)
 serial.write(myserial.read());
}

void sendmessage()
{
  myserial.println("at+cmgf=1");    //sets gsm module in text mode
  delay(1000);  // delay of 1000 milli seconds or 1 second
  myserial.println("at+cmgs=\"+60xxxxxxxxx\"\r"); // replace x mobile number
  delay(1000);
  myserial.println("sim900a sms");// sms text want send
  delay(100);
   myserial.println((char)26);// ascii code of ctrl+z
  delay(1000);
}

void receivemessage()
{
  myserial.println("at+cnmi=2,2,0,0,0"); // @ command recieve live sms
  delay(1000);
  if (myserial.available()>0)
  {
    msg=myserial.read();
    serial.print(msg);
  }
}

void makecall()
{
  myserial.println("atd+60xxxxxxxxx;"); // atdxxxxxxxxxx; -- watch out here semicolon @ end!!
  serial.println("calling  "); // print response on serial port
  delay(1000);
}


void hangupcall()
{
  myserial.println("ath");
  serial.println("hangup call");
  delay(1000);
}

void receivecall()
{
  myserial.println("ata");
  delay(1000);
  {
    call=myserial.read();
    serial.print(call);
  }
}

void redialcall()
{
  myserial.println("atdl");
  serial.println("redialing");
  delay(1000);
}

you've got 2 choices.
1. store message on arduino @ time of sending.
2. attempt find @ command gsm module gives access stored data.

at commands:
https://www.espruino.com/datasheets/sim900_at.pdf


Arduino Forum > Using Arduino > Project Guidance > How can I store text messages and list them using GSM module?


arduino

Comments

Popular posts from this blog

Error compiling for board Arduino/Genuino Uno.

Installation database is corrupt

esp8266 (nodemcu 0.9) client.write très lent ???