Problema con mi gsm sim900 icomsat 1.1

Hola. ¿Qué tal?
Bueno, estoy probando con el icomsat 1.1 gsm con arduino uno y le conecté mi chip de celular en la parte de abajo de la tarjeta.
Completé el código en el ide para enviar mensaje pero no salia nada.
Lo estoy haciendo con la librería del gsm con los ejemplos pero no me funciona.
No sé cual podría ser el problema.

Bueno, aparte soy nuevo utilizando este dispositivo y también ya he visto muchos foros, pero bueno, ya intenté varias modificaciones, pero nada.

Acá está el código:
PHP:
// include the GSM library
#include <GSM.h>

// PIN Number for the SIM
#define PINNUMBER "*********"; //(¿aca va el numero de que va recibir el msj?)

// initialize the library instances
GSM gsmAccess;
GSM_SMS sms;

// Array to hold the number a SMS is retreived from
char senderNumber[20];

void setup()
{
  // initialize serial communications and wait for port to open:
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for Leonardo only
  }

  Serial.println("SMS Messages Receiver")

  // connection state
  boolean notConnected = true;

  // Start GSM connection
  while (notConnected)
  {
    if (gsmAccess.begin(PINNUMBER) == GSM_READY)
      notConnected = false;
    else
    {
      Serial.println("Not connected");
      delay(1000);
    }
  }

  Serial.println("GSM initialized");
  Serial.println("Waiting for messages");
}

void loop()
{
  char 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);

    // An example of message disposal
    // Any messages starting with # should be discarded
    if (sms.peek() == '#')
    {
      Serial.println("Discarded SMS");
      sms.flush();
    }

    // Read message bytes and print them
    while (c = sms.read())
      Serial.print(c);

    Serial.println("\nEND OF MESSAGE");

    // Delete message from modem memory
    sms.flush();
    Serial.println("MESSAGE DELETED");
  }

  delay(1000);

}
 
Última edición por un moderador:
Atrás
Arriba