Go Down

Topic: Arduino uno + gsm shield sim 900 problem (Read 7255 times) previous topic - next topic

Antonio69

Hi everyone! I have a problem with my arduino uno board and my gsm shield,the messages aren't send from my gsm to my phone, i link my gsm with my arduino like this and use this code
Code: [Select]

#include <SoftwareSerial.h>

SoftwareSerial GPRS(7, 8);         //7 = TX, 8 = RX
unsigned char buffer[64]; port
int count=0;     
int i = 1;                         //if i = 0, send SMS.
void setup(){
  //delay(10000);
  GPRS.begin(19200);               // the GPRS baud rate   
  Serial.begin(19200);             // the Serial port of Arduino baud rate.
  Serial.print("I'm ready");
  Serial.print("Hello?");
}

void loop(){
  if (GPRS.available()){         // if date is comming from softwareserial port ==> data is comming from gprs shield

    while(GPRS.available()){          // reading data into char array
      buffer[count++]=GPRS.read();     // writing data into array
      if(count == 64)break;
    }
  Serial.write(buffer,count);            // if no data transmission ends, write buffer to hardware serial port
  clearBufferArray();              // call clearBufferArray function to clear the storaged data from the array
  count = 0;                       // set counter of while loop to zero


}
if (Serial.available())            // if data is available on hardwareserial port ==> data is comming from PC or notebook
  GPRS.write(Serial.read());       // write it to the GPRS shield

  if(i == 0){
    GPRS.print("AT+CMGF=1\r"); //mandando SMS em modo texto
    Serial.println("AT+CMGF=1\r"); //mandando SMS em modo texto
    delay(1000);
    GPRS.print("AT+CMGS=\"+5549****3979\"\r"); // numero que vamos mandar o SMS
    Serial.println("AT+CMGS=\"+5549****3979\"\r"); // numero que vamos mandar o SMS
    delay(1000);
    GPRS.print("Test\r"); // corpo da msg
    Serial.println("Test\r"); // corpo da msg
    delay(1000);
    GPRS.write(0x1A); //equivalente a mandar Ctrl+Z(finaliza corpo do SMS)
    delay(1000);
    Serial.println("SMS sent successfully");
    i++;
  }   

}
void clearBufferArray(){              // function to clear buffer array
  for (int i=0; i<count;i++){
    buffer[i]=NULL;                  // clear all index of array with command NULL
  }
}

but doesn't work, my gsm shield is sim 900 s2-1040s-z1k0c. I'd like to know how i link my 2 board and the code to make it work, thank you all
Antonio

Litto

Hello, you could solve the problem? I've been 5 days and still can not get it to work, do not know if I have the correct library or sketch is not appropriate

SupArdu

Quote
SoftwareSerial GPRS(7, 8);         //7 = TX, 8 = RX
Is'nt it vice versa, 7=RX and 8=TX?
Check it in some of the examples available in the GSM software.

SupArdu
-------------------
have success
SupArdu

Gaggymoon

Hi all,

We have a problem here in Australia in that the main carrier Telstra is going to stop GSM 2G usage in Dec 2016 and other carriers will most likely follow shortly after that. This of course means that GSM 2G shields such as the one used above will no longer be usable and we will have to swap to the much more expensive 3G shields.

Not sure whats happening in other countries but it will seriously inconvenience many users. I'm looking forward to some Instructables that utilize the 3G version but it may be almost a direct substitution?


Hooney

I also have the same problem. Any solution?

Muthungu

i would suggest you use pin 3 for TX and pin 2 for RX.  and ensure the GSM antennae is fixed when powering the GSM to avoid damaging the shield

moy945123

did you fix the problem?? if so could you share your code and connection of the arduino to the gsm shield please and thank you.

RoyalCheese71

Well,

Got the same problem dude.

Have a check on my research : https://forum.arduino.cc/index.php?topic=595820.0

Maybe one of my solution will work , who knows..

pulung_ps

I have some problem like that. Any solution so far ?

Go Up