Problem with Arduino and GPRS shield v2

Can't find a proper forum to drop the topic, drop here.

Moderators: lily.li, salmanfarisvp, violet

Post Reply
gauche.c
Pre-kindergarten
Pre-kindergarten
Posts: 1
Joined: Thu Apr 04, 2013 12:28 am

Problem with Arduino and GPRS shield v2

Post by gauche.c » Thu Apr 04, 2013 1:16 am

I have tried a lot to connect Arduino UNO and GPRS shield v2 but it does not work. AT Command Tester & Sscom is not responding (no feedback from gprs for all commands, but I can see my Serial.print()). I have followed each and every instruction from the wiki. but nothing.
Despite this, the green LED works properly when I Power up the SIM900 and I can send my command to arduino.

flybirdx
Pre-kindergarten
Pre-kindergarten
Posts: 1
Joined: Thu Apr 04, 2013 2:17 pm

Re: Problem with Arduino and GPRS shield v2

Post by flybirdx » Thu Apr 04, 2013 3:25 pm

Using GPRS Shield With Mega

1) Connect pin-7 to pin-10 (pin-8 to pin-11) by jumper wire
2) Use this code:

Code: Select all

#include <SoftwareSerial.h>
 
SoftwareSerial GPRS(10, 11);
unsigned char buffer[64]; // buffer array for data recieve over serial port
int count = 0;     // counter for buffer array 

void setup()
{
    GPRS.begin(19200);               // the GPRS baud rate   
    Serial.begin(19200);             // the Serial port of Arduino baud rate.
}
 
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
}

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
}
3. Go AT command tester describe in product wiki, Connect with 19200 bps
Note:Don't forget to plug the jumpers to SWserial mode.
Good luck!

wahyu.reza
Pre-kindergarten
Pre-kindergarten
Posts: 1
Joined: Sun Apr 14, 2013 8:41 pm

Re: Problem with Arduino and GPRS shield v2

Post by wahyu.reza » Sun Apr 14, 2013 8:45 pm

i'm also encountered the same problem as above. instead using uno, i'm using arduino leonardo. does your code above apply as well to arduino leonardo?

User avatar
Jacket Chen
Staff
Staff
Posts: 659
Joined: Thu Jun 21, 2012 4:25 pm
Are you a staff member of seeedstudio?: yes
Which products/projects are your favorite?: Seeeduino Shields
Location: China

Re: Problem with Arduino and GPRS shield v2

Post by Jacket Chen » Wed Apr 17, 2013 2:39 pm

Code for leonardo

Serial 1 hardware~

Code: Select all

#include <SoftwareSerial.h>

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

void setup()
{
    Serial1.begin(19200);               // the GPRS baud rate   
    Serial.begin(19200);             // the Serial port of Arduino baud rate.
}

void loop()
{
    if (Serial1.available())              // if date is comming from softwareserial port ==> data is comming from gprs shield
    {
        while (Serial1.available())          // reading data into char array
        {
            buffer[count++] = Serial1.read();     // writing data into array
            if (count == 64)
                break;
        }
    
        for ( int j=0;j<count;j++)
        {
          Serial.write(buffer[j]);
        }
        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
        Serial1.write(Serial.read());       // write it to the GPRS shield
}

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
}
Love little, love long.

Post Reply