sim900&uno random behaviour

hi there,

I did some simple sketch

#include <SoftwareSerial.h>

SoftwareSerial GPRS(7, 8);

unsigned char buffer[64];  // buffer array for data receive over serial port
int count=0;               // counter for buffer array

void setup()
{
  GPRS.begin(19200);
  Serial.begin(19200);
}

void loop()
{
  if (GPRS.available())
  {
    while(GPRS.available())
    {
      buffer[count++]=GPRS.read();
      if(count == 64)break;
    }
    Serial.write(buffer,count);
    clearBufferArray();
    count = 0;
  }
  if (Serial.available())
    GPRS.write(Serial.read());
}

void clearBufferArray()
{
  for (int i=0; i<count;i++)
  {
    buffer[i]=NULL;
  }
}

and sometimes it works and sometimes not :confused:

when it works, I see sms/call replay and when not, I see some dots (jpeg)

I plug/unplug, curse, wait and sometimes it start working

any idea where this random behaviour come from? (wrong shield??)

I have to add, when it starts working, it works flawlessly until next ON/OFF