Pages: [1]   Go Down
Author Topic: Problem with serial communication between Arduino UNO and GSM Shield...  (Read 660 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 32
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hy everybody... Recently I purchased a GSM Shield (with SIM900 module) but I've some problems with serial communication between Arduino and the shield... I uploaded this sketch on Arduino:

Code:
#include <SoftwareSerial.h>

SoftwareSerial GPRS(7, 8); //Seriale simulata per comunicare col modem

unsigned char buffer[64]; // buffer per i dati scambiati sulla seriale
int count=0;              // contatore dati nel buffer

void setup()
{
  GPRS.begin(19200);   // Baudrate di default del modem SIM900
  Serial.begin(19200); // Baudrate della seriale di Arduino
}

void loop()
{
  if (GPRS.available())  // Se ci sono dati sulla seriale simulata (il modem ci invia dati)
  {
    while(GPRS.available()) // Finché ci sono dati disponibili
    {
      buffer[count++]=GPRS.read(); // Inserisce i byte nel buffer
      if(count == 64)break;
    }
    Serial.write(buffer,count);  // Scrive i dati ricevuti sulla seriale di Arduino
    clearBufferArray();  // Svuota il buffer
    count = 0;           
   }
  if (Serial.available()) // Se ci sono dati sulla seriale di Arduino
    GPRS.write(Serial.read()); // Inviamo i dati al modem
}
void clearBufferArray() // Funzione di supporto per svuotare il buffer
{
  for (int i=0; i<count;i++)
      buffer[i]=NULL;                 
}

then I tried to use AT Command Tester website... I pressed Find port button, then I selected the Arduino COM; I setted the Baud rate on 19200 and then I pressed Connect button... Here is the problem because i received this error:

Code:
Found ports :COM1, COM3

No port is connected.

Sending AT query..

Invalid or no response from the device. Please check the modem port and the baud rate.Disconnecting port COM3.

I tried to use all available Baud Rate but I always received the same error...

Can anyone help me to solve this problem?

Thank all...

P.S: Sorry form my english, but I am italian... smiley-red
Logged

Johannesburg, South Africa
Offline Offline
Full Member
***
Karma: 0
Posts: 180
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Which Arduino do you have?
Which GSM shield do you have?
Which pins are you using to communicate between the Arduino and shield?
Logged

Pages: [1]   Go Up
Jump to: