Go Down

Topic: Receive SMS example (Read 85773 times) previous topic - next topic

xl97

format your code.. and put it in code tags...

otherwise not many people will look at it for you.



DAD0

hello guyz i have a somewhat similar problem i want to extract the msg(text or body) and the number and date time at which it received of given msg id right now i have successfully communicate the arduino(uno) and gsm module(800l) all AT commands are working fine.
here is the code.

#include <Arduino.h>
#include <SoftwareSerial.h>
#include <string.h>
SoftwareSerial sim(10, 11);

void recmsg();
void setup() {
  Serial.begin(9600);
  Serial.println("Wait a few seconds...");
  delay(5000);
  Serial.println("Initializing.");
  sim.begin(9600);
  delay(1000);
 
}
void loop() {
  if (Serial.available() > 0)
    {recmsg();
       }
   
  if (sim.available() > 0)
    {Serial.write(sim.read());
}}

void recmsg(){
  String all="ALL";
char n=0;
//char number[20];
 // Serial.println(sim.println("AT+CMGR=16") );
 // Serial.println(sim.println("AT+CMGL=\"" + all + "\"") );
 // Serial.println(sim.println("AT+CMGD=15") );
 //Serial.println(sim.println("AT+CMGL=\"" + all + "\"") );
 //Serial.println(n);
 sim.println("AT+CMGR=22");
 sim.print("\r");
 n=sim.read();
 
 //delay(5000);
 Serial.println(n);
 
 }


nenh

Hello to everyone. I'm new to the forum and I'm a student. This is my undergraduate thesis on a track that makes it very difficult for me. So my work is about some measurements that I have to take from a machine and be wirelessly sent to a computer! the first step i have to do is connect a arduino uno to a gps/gprs(gsm 862 Telit). So these two have to receive a message and just transmit it to a server. my problem is i can't code this job.the measurements I take from the machine are stored in a txt file. the measurements have the form (region, time, dates, radiation level). the measurements do not want to be sent to the server via wi-fi because the machine a takes outside measurements away from the wi-fi. Your help is valuable Your help is valuable.
*sorry if I'm writing in the wrong place*

Kevin_a69

Hi there everyone,
I hope I can get some direction on the following related problem

I am using the MKR 1400 and it is working fine for me EXCEPT that for some reason there are major delays in receiving the SMS messages whenever they come in rapid sequence.

I am using a slightly modified version of the ReceiveSMS (example sketch) for this test.
The setup  is unchanged
Here is the modified loop :


void loop() {
  int c;

  // If there are any SMSs available()
  if (sms.available()) {
    Serial.println("Message received from:");

    // Get remote number
    sms.remoteNumber(senderNumber, 20);
    Serial.println(senderNumber);

    sms.peek();
    delay(100);
    sms.flush();
    delay(100);
    Serial.println("MESSAGE DELETED");
  }

  sms.flush();
  delay(1000);

}


So for example I would send 5 short SMS to the MKR 1400 (each one right after the other )

Then on the serial monitor I would see the first message come in and then some seconds after the 2nd SMS would show up and then several seconds after the 3rd would show and then sometimes the other 2 messages take quite long before they are received.

AND if I take that same telephone SIM and place it in a cellphone and I repeat the same 5 SMS tests ...... ALL 5 SMS would be instantly be received on the cellphone without practically ANY delay.  Therefore it is definitely not an issue with the GSM service provider


I just cant figure out what could be causing such large delays on the MRK 1400 board BUT it is really a show stopper for the application I need to run on it.

Any assistance on this matter will be greatly appreciated.

Go Up