Go Down

Topic: GSM Shield Library damaged my equipment? (Read 1 time) previous topic - next topic

renatotavares

Not sure what happened but after using the GSM Shield Library https://code.google.com/p/gsm-shield-arduino/ and send a SMS with her, my shield no longer accepts the sending of SMS in the way I had been doing.

Usually I send an SMS like this:

Code: [Select]
//Serial Relay - Arduino will patch a
//serial link between the computer and the GPRS Shield
//at 19200 bps 8-N-1
//Computer is connected to Hardware UART
//GPRS Shield is connected to the Software UART

#include <SoftwareSerial.h>

SoftwareSerial mySerial(2, 3);

void setup()
{
  mySerial.begin(19200);               // the GPRS baud rate
  Serial.begin(19200);                 // the GPRS baud rate
  mySerial.print("\r");
  delay(1000);
  mySerial.print("AT+CMGF=1\r");
  delay(1000);
  mySerial.print("AT+CMGS=\"+918446043032\"\r");
  delay(1000);
  mySerial.print("teste");
  delay(1000);
  mySerial.write(26);
}

void loop()
{
}


Now this command does not work anymore. Now it is only possible to send SMS like this:

Code: [Select]
#include "SIM900.h"
#include <SoftwareSerial.h>
//If not used, is better to exclude the HTTP library,
//for RAM saving.
//If your sketch reboots itself proprably you have finished,
//your memory available.
//#include "inetGSM.h"

//If you want to use the Arduino functions to manage SMS, uncomment the lines below.
#include "sms.h"
SMSGSM sms;

//To change pins for Software Serial, use the two lines in GSM.cpp.

//GSM Shield for Arduino
//www.open-electronics.org
//this code is based on the example of Arduino Labs.

//Simple sketch to send and receive SMS.

int numdata;
boolean started=false;
char smsbuffer[160];
char n[20];

void setup()
{
  //Serial connection.
  Serial.begin(9600);
  Serial.println("GSM Shield testing.");
  //Start configuration of shield with baudrate.
  //For http uses is raccomanded to use 4800 or slower.
  if (gsm.begin(2400)){
    Serial.println("\nstatus=READY");
    started=true;
  }
  else Serial.println("\nstatus=IDLE");

  if(started){
    //Enable this two lines if you want to send an SMS.
    if (sms.SendSMS("3471234567", "Arduino SMS"))
      Serial.println("\nSMS sent OK");
  }

};

void loop()
{
  if(started){
    //Read if there are messages on SIM card and print them.
    if(gsm.readSMS(smsbuffer, 160, n, 20))
    {
      Serial.println(n);
      Serial.println(smsbuffer);
    }
    delay(1000);
  }
};


Anyone know the reason for this and how to solve?

My shield is this http://www.elecfreaks.com/wiki/index.php?title=EFCom_GPRS/GSM_Shield
Renato Tavares, Founder and Software Developer at Resolvendo
www.resolvendo.com

Any reason why the baud rate is different on both examples?
Eu não sou o teu criado. Se respondo no fórum é para ajudar todos mediante a minha disponibilidade e disposição. Responder por mensagem pessoal iria contra o propósito do fórum e por isso evito-o.
Se realmente pretendes que eu te ajude por mensagem pessoal, então podemos chegar a um acordo e contrato onde me pagas pela ajuda que eu fornecer e poderás então definir os termos de confidencialidade do meu serviço. De forma contrária toda e qualquer ajuda que eu der tem de ser visível a todos os participantes do fórum (será boa ideia, veres o significado da palavra fórum).
Nota também que eu não me responsabilizo por parvoíces escritas neste espaço pelo que se vais seguir algo dito por mim, entende que o farás por tua conta e risco.

Dito isto, mensagens pessoais só se forem pessoais, ou seja, se já interagimos de alguma forma no passado ou se me pretendes convidar para uma churrascada com cerveja (paga por ti, obviamente).

renatotavares

baud rate is the standard in both libraries, one uses in 2400, and another 19200.

Already solved the problem. Really was related to the baud rate
Renato Tavares, Founder and Software Developer at Resolvendo
www.resolvendo.com

zorzano

Anyway, the library is for the Arduino GSM/GPRS Shield, not the SIM900 based. The AT commands possibly will behave different.

Go Up