General

GPS/GPRS/GSM Module V3.0 with SoftwareSerial, Arduino UNO

userHead audebert 2013-11-02 03:47:11 24719 Views13 Replies
i was finally find how to manage the GPS/GPRS/GSM Module V3.0 with one serial on ARDUINO UNO.
BUT, i tried to use SoftwareSerial, to have one serial to speak to gsm/gps module, and other to report to usb, for debug..
but, nothing work..
anyone know wich serial port to use to define SoftwareSerial ?
like
Code: Select all
#include <SoftwareSerial.h>
SoftwareSerial mySerial(4,5);
in this non working example it's 4 and 5, but, i need to have 2 different serial port, one to speak and receive to module, and one to speak to USB.
What is correct pin number to use software serial with the shield.? RX,TX numbers.?
i tried code like this, just to confirm working, but no one work.
Code: Select all
#include <SoftwareSerial.h>
SoftwareSerial mySerial(4,5);

void setup()
 {
   //Init the driver pins for GSM function
    pinMode(3,OUTPUT);
    pinMode(4,OUTPUT);
    pinMode(5,OUTPUT);
   //Output GSM Timing 
    digitalWrite(5,HIGH);
    delay(1500);
    digitalWrite(5,LOW); 
    digitalWrite(3,LOW);//Enable the GSM mode
    digitalWrite(4,HIGH);//Disable the GPS mode
    delay(2000);
    Serial.begin(9600); //set the baud rate
    mySerial.begin(9600); 
    delay(5000);//call ready
 }
 void loop()    
 {    
    // Use these commands instead of the hardware switch 'UART select' in order to enable each mode
    // If you want to use both GMS and GPS. enable the required one in your code and disable the other one for each access.
    digitalWrite(3,LOW);//enable GSM TX?RX
    digitalWrite(4,HIGH);//disable GPS TX?RX
    mySerial.println("AT");
    Serial.print("commande: ");
    
    while(mySerial.available())
      Serial.write(Serial.read());
    Serial.println("");
  
    while(1)
    {
      if (mySerial.available())
         Serial.println(Serial.read()); 
      else
      { 
        mySerial.println("AT");
      }
    } 
 }
anyone have working minimal example.??
like sending AT command to module, get response and write it to usb.??
MANY THANKS..!!
2013-11-06 04:16:57 Hello Grey,
Yes i will send a SMS and I've tried the code from the wiki page: How to drive the GSM Mode via USB port. After the reset the STAT LED is on and the NET LED flashing but only for a short time. And in this time you can communicate over at commands. But after few seconds the LEDs goes off (not the power LED) and nothing is displayed. I also changed the simcard and the arduino uno board, but nothing helps… :-\
Maybe it's the power supply?
userHeadPic ef
2013-11-06 04:16:57 Hello Grey,
Yes i will send a SMS and I've tried the code from the wiki page: How to drive the GSM Mode via USB port. After the reset the STAT LED is on and the NET LED flashing but only for a short time. And in this time you can communicate over at commands. But after few seconds the LEDs goes off (not the power LED) and nothing is displayed. I also changed the simcard and the arduino uno board, but nothing helps… :-\
Maybe it's the power supply?
userHeadPic ef
2013-11-06 01:11:05 Hello ef,
Actually after I have uploaded the code and turned s1 to "comm" I will open serial port first.And then press "RST"  and then wait "STAT" on and "NET" blinking.At most time it will show on serial port.
And why I wrote this code is just because I want to know whether the software serial port on uno works or not.
I haven't tried it before. ;D
What are you going to do? with this module? For sending SMS, the code on wiki have a lot of example. You can debugging it by at command. and no need to curve rx and tx. Would you like to tell me?
userHeadPic Grey.CC
2013-11-06 01:11:05 Hello ef,
Actually after I have uploaded the code and turned s1 to "comm" I will open serial port first.And then press "RST"  and then wait "STAT" on and "NET" blinking.At most time it will show on serial port.
And why I wrote this code is just because I want to know whether the software serial port on uno works or not.
I haven't tried it before. ;D
What are you going to do? with this module? For sending SMS, the code on wiki have a lot of example. You can debugging it by at command. and no need to curve rx and tx. Would you like to tell me?
userHeadPic Grey.CC
2013-11-05 20:09:44 Hello Grey,

I have the same problem like audebert. I curved also the pin 0 and 1 and connect P0 to P10 and P1 to P11 by jumper cables. I also connect the arduino uno with extra power (battery 9v block). I use a SIM-Card, but it dosen’t work.

My Steps:

1. Take off the GSM/GPS jumper caps
2. S1 to Prog, S2 to Arduino
3. Upload your Code from Arduino IDE
4. Reset the GSM Shield
5. S1 to Comm

If I use the AT Command tester or the serial monitor from the arduino ide (Boud Rate: 9600) the STAT LED goes on and the NET LED flashes. And on the monitor extraordinary characters are displayed (ÿÿÿÿÿÿÿÿ). After a short time both go out. GPS and Gall Ready are not displayed.

bye ef
userHeadPic ef
2013-11-05 20:09:44 Hello Grey,

I have the same problem like audebert. I curved also the pin 0 and 1 and connect P0 to P10 and P1 to P11 by jumper cables. I also connect the arduino uno with extra power (battery 9v block). I use a SIM-Card, but it dosen’t work.

My Steps:

1. Take off the GSM/GPS jumper caps
2. S1 to Prog, S2 to Arduino
3. Upload your Code from Arduino IDE
4. Reset the GSM Shield
5. S1 to Comm

If I use the AT Command tester or the serial monitor from the arduino ide (Boud Rate: 9600) the STAT LED goes on and the NET LED flashes. And on the monitor extraordinary characters are displayed (ÿÿÿÿÿÿÿÿ). After a short time both go out. GPS and Gall Ready are not displayed.

bye ef
userHeadPic ef
2013-11-05 04:35:39 i was tested Grey response and i'm very puzzled.
nothing work..

i curved pin 0 and 1, connected P0 to P10, and P1 to P11 by jumper cable,used code from grey,verifyed pwr and stat is on and net blinking, S2 on arduino and S1 on com after uploading and..
  nothing work..
tried other thing, but no one who can get reply..

are your testing code worked like this on your arduino UNO??
Code: Select all
#include <SoftwareSerial.h>
SoftwareSerial mySerial(10, 11); // RX, TX
byte gsmDriverPin[3] = {3,4,5};
void setup()
{  
  Serial.begin(9600);
  mySerial.begin(9600);

  for(int i = 0 ; i < 3; i++){
    pinMode(gsmDriverPin[i],OUTPUT);
  }
  digitalWrite(5,HIGH);//Output GSM Timing 
  delay(1500);
  digitalWrite(5,LOW);  
  digitalWrite(3,LOW);//Enable the GSM mode
  digitalWrite(4,HIGH);//Disable the GPS mode
  delay(2000);
  delay(5000);//call ready
  delay(5000);
  delay(5000);
   
}

void loop()
{  
  if(mySerial.available()>0)
  {
    char inbyte=mySerial.read();
    Serial.print(inbyte);
  }
}
userHeadPic audebert
2013-11-05 04:35:39 i was tested Grey response and i'm very puzzled.
nothing work..

i curved pin 0 and 1, connected P0 to P10, and P1 to P11 by jumper cable,used code from grey,verifyed pwr and stat is on and net blinking, S2 on arduino and S1 on com after uploading and..
  nothing work..
tried other thing, but no one who can get reply..

are your testing code worked like this on your arduino UNO??
Code: Select all
#include <SoftwareSerial.h>
SoftwareSerial mySerial(10, 11); // RX, TX
byte gsmDriverPin[3] = {3,4,5};
void setup()
{  
  Serial.begin(9600);
  mySerial.begin(9600);

  for(int i = 0 ; i < 3; i++){
    pinMode(gsmDriverPin[i],OUTPUT);
  }
  digitalWrite(5,HIGH);//Output GSM Timing 
  delay(1500);
  digitalWrite(5,LOW);  
  digitalWrite(3,LOW);//Enable the GSM mode
  digitalWrite(4,HIGH);//Disable the GPS mode
  delay(2000);
  delay(5000);//call ready
  delay(5000);
  delay(5000);
   
}

void loop()
{  
  if(mySerial.available()>0)
  {
    char inbyte=mySerial.read();
    Serial.print(inbyte);
  }
}
userHeadPic audebert
2013-11-04 22:45:03 Hello, audebert
Have you notice that: Pin 10,11,12 have been occupied by GSM module as driver pins
And UNO has only one Software Serial, so...
Here is my testing code. I curved the pin 0 and 1. Make sure when I plug the module to UNO, these two won't connect to the RX and TX. At the same time , connect P0 to P10, and P1 to P11 by jumper cable.
Then in the serial port we can get info like"call ready"...
PS:this module need a extra power ;when  it run by arduino , don't forget to turn S2 to right side(arduino)
Code: Select all
#include <SoftwareSerial.h>
SoftwareSerial mySerial(10, 11); // RX, TX
byte gsmDriverPin[3] = {3,4,5};
void setup()
{  
  Serial.begin(9600);
  mySerial.begin(9600);

  for(int i = 0 ; i < 3; i++){
    pinMode(gsmDriverPin[i],OUTPUT);
  }
  digitalWrite(5,HIGH);//Output GSM Timing 
  delay(1500);
  digitalWrite(5,LOW);  
  digitalWrite(3,LOW);//Enable the GSM mode
  digitalWrite(4,HIGH);//Disable the GPS mode
  delay(2000);
  delay(5000);//call ready
  delay(5000);
  delay(5000);

}

void loop()
{  
  if(mySerial.available()>0)
  {
    char inbyte=mySerial.read();
    Serial.print(inbyte);
  }
}



userHeadPic Grey.CC
2013-11-04 22:45:03 Hello, audebert
Have you notice that: Pin 10,11,12 have been occupied by GSM module as driver pins
And UNO has only one Software Serial, so...
Here is my testing code. I curved the pin 0 and 1. Make sure when I plug the module to UNO, these two won't connect to the RX and TX. At the same time , connect P0 to P10, and P1 to P11 by jumper cable.
Then in the serial port we can get info like"call ready"...
PS:this module need a extra power ;when  it run by arduino , don't forget to turn S2 to right side(arduino)
Code: Select all
#include <SoftwareSerial.h>
SoftwareSerial mySerial(10, 11); // RX, TX
byte gsmDriverPin[3] = {3,4,5};
void setup()
{  
  Serial.begin(9600);
  mySerial.begin(9600);

  for(int i = 0 ; i < 3; i++){
    pinMode(gsmDriverPin[i],OUTPUT);
  }
  digitalWrite(5,HIGH);//Output GSM Timing 
  delay(1500);
  digitalWrite(5,LOW);  
  digitalWrite(3,LOW);//Enable the GSM mode
  digitalWrite(4,HIGH);//Disable the GPS mode
  delay(2000);
  delay(5000);//call ready
  delay(5000);
  delay(5000);

}

void loop()
{  
  if(mySerial.available()>0)
  {
    char inbyte=mySerial.read();
    Serial.print(inbyte);
  }
}



userHeadPic Grey.CC
2013-11-03 05:14:07 my last sketch dont work, it's just a sample to show what i'm searching to do.

can i really use softwareserial with UNO??

i tried, with jumpers 10,11,12, out , and cant get reply with my sketch, just "end", npothing else..
sketch example NOT WORKING..    do you know how to make it working? to get reply of AT command.?
Code: Select all
#include "SoftwareSerial.h"
SoftwareSerial mySerial(10,11);

void setup()
 {
   //Init the driver pins for GSM function
    pinMode(10,OUTPUT);
    pinMode(11,OUTPUT);
    pinMode(12,OUTPUT);
   //Output GSM Timing 
    digitalWrite(12,HIGH);
    delay(1500);
    digitalWrite(12,LOW); 
    digitalWrite(11,LOW);//Enable the GSM mode
    digitalWrite(10,HIGH);//Disable the GPS mode
    delay(2000);
    Serial.begin(9600); //set the baud rate
    mySerial.begin(9600); 
    delay(5000);//call ready
    delay(5000);
    delay(5000);
    
 }

void loop()    
 {    
    digitalWrite(10,LOW);//enable GSM TX?RX
    digitalWrite(11,HIGH);//disable GPS TX?RX
    mySerial.println("AT");
    while(mySerial.available()>0)
      Serial.write(mySerial.read());
    Serial.println("end");
   
   while(1){
     if (mySerial.available()>0)
      Serial.write(mySerial.read());
   }
}
userHeadPic audebert
2013-11-03 05:14:07 my last sketch dont work, it's just a sample to show what i'm searching to do.

can i really use softwareserial with UNO??

i tried, with jumpers 10,11,12, out , and cant get reply with my sketch, just "end", npothing else..
sketch example NOT WORKING..    do you know how to make it working? to get reply of AT command.?
Code: Select all
#include "SoftwareSerial.h"
SoftwareSerial mySerial(10,11);

void setup()
 {
   //Init the driver pins for GSM function
    pinMode(10,OUTPUT);
    pinMode(11,OUTPUT);
    pinMode(12,OUTPUT);
   //Output GSM Timing 
    digitalWrite(12,HIGH);
    delay(1500);
    digitalWrite(12,LOW); 
    digitalWrite(11,LOW);//Enable the GSM mode
    digitalWrite(10,HIGH);//Disable the GPS mode
    delay(2000);
    Serial.begin(9600); //set the baud rate
    mySerial.begin(9600); 
    delay(5000);//call ready
    delay(5000);
    delay(5000);
    
 }

void loop()    
 {    
    digitalWrite(10,LOW);//enable GSM TX?RX
    digitalWrite(11,HIGH);//disable GPS TX?RX
    mySerial.println("AT");
    while(mySerial.available()>0)
      Serial.write(mySerial.read());
    Serial.println("end");
   
   while(1){
     if (mySerial.available()>0)
      Serial.write(mySerial.read());
   }
}
userHeadPic audebert
2013-11-02 03:47:11 i was finally find how to manage the GPS/GPRS/GSM Module V3.0 with one serial on ARDUINO UNO.
BUT, i tried to use SoftwareSerial, to have one serial to speak to gsm/gps module, and other to report to usb, for debug..
but, nothing work..
anyone know wich serial port to use to define SoftwareSerial ?
like
Code: Select all
#include <SoftwareSerial.h>
SoftwareSerial mySerial(4,5);
in this non working example it's 4 and 5, but, i need to have 2 different serial port, one to speak and receive to module, and one to speak to USB.
What is correct pin number to use software serial with the shield.? RX,TX numbers.?
i tried code like this, just to confirm working, but no one work.
Code: Select all
#include <SoftwareSerial.h>
SoftwareSerial mySerial(4,5);

void setup()
 {
   //Init the driver pins for GSM function
    pinMode(3,OUTPUT);
    pinMode(4,OUTPUT);
    pinMode(5,OUTPUT);
   //Output GSM Timing 
    digitalWrite(5,HIGH);
    delay(1500);
    digitalWrite(5,LOW); 
    digitalWrite(3,LOW);//Enable the GSM mode
    digitalWrite(4,HIGH);//Disable the GPS mode
    delay(2000);
    Serial.begin(9600); //set the baud rate
    mySerial.begin(9600); 
    delay(5000);//call ready
 }
 void loop()    
 {    
    // Use these commands instead of the hardware switch 'UART select' in order to enable each mode
    // If you want to use both GMS and GPS. enable the required one in your code and disable the other one for each access.
    digitalWrite(3,LOW);//enable GSM TX?RX
    digitalWrite(4,HIGH);//disable GPS TX?RX
    mySerial.println("AT");
    Serial.print("commande: ");
    
    while(mySerial.available())
      Serial.write(Serial.read());
    Serial.println("");
  
    while(1)
    {
      if (mySerial.available())
         Serial.println(Serial.read()); 
      else
      { 
        mySerial.println("AT");
      }
    } 
 }
anyone have working minimal example.??
like sending AT command to module, get response and write it to usb.??
MANY THANKS..!!
userHeadPic audebert