Pages: [1]   Go Down
Author Topic: sim900 GPRS on Seeeduino causes program to reboot in setup().  (Read 979 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have tested the Seeeduino and the GPRS shield separately and they both work fine, but attached together they only work as expected when the USB cable is disconnected from the computer. If I connect the USB cable and press the power button on the GPRS shield the shield goes mad over the serial link and repeatedly sends status information to the computer. No errors, just the usual startup info. It does not look like it is rebooting because the LEDs are continiously lit and the NetLight LED indicates that it is connected to the network after a little while. The serial spam does not have to be the problem itself, it could be a symptom of something else failing. The real problem is that the setup() function seems to get messed up, which causes the arduino to reboot in an infinite loop. I have measured an average voltage drop on both TX and RX pins with my multimeter which I suppose must mean the GPRS shield is also receiveing data. A mystery, since I am not sending it any..

I have read that similar problems might occur when the GPRS shield is not given enough power, but I have tried feeding both the shield and the Seeeduino power from external sources wihout success (still only works when USB is disconnected). I am really out of ideas now. Do you have any suggestions to what the problem may be or are you as clueless as I am?
« Last Edit: December 19, 2012, 08:52:23 am by proj » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi! I think i had the same problem when i started do use the gsm/gprs shield on my arduino. I attached the arduino leonardo to the gsm/gprs shield but the communication doesn't work. How did i fixed it?
I connected the Rx(Tx)  of the Arduino Leonardo with the Rx(Tx) of the GSM/GPRS shield with a jumper. And that's no mistake Rx with Rx and Tx with Tx.

My settings:

Arduino Leonardo:

  • uses software serial so you have to include SoftwareSerial.h
  • Rx Pin= Digital Pin 7
  • Tx Pin= Digital Pin 8

GSM/GPRS Shield:


I hope the image can help you!
« Last Edit: January 09, 2013, 05:52:13 am by robin_de » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Arduino Leonardo:

    uses software serial so you have to include SoftwareSerial.h
    Rx Pin= Digital Pin 7
    Tx Pin= Digital Pin 8


GSM/GPRS Shield:

    uses hadware serial
    Rx Pin= D0
    Tx Pin= D1
    more informations at: http://www.seeedstudio.com/wiki/GPRS_Shield_V1.0

I have tried switching the cables and moving the jumper but nothing seems to work. Looking at your settings, I am a litte curious to how you communicate between the Leonardo and the GPRS if the Leonardo is connected to the SWserial pins but the GPRS is set in HWserial mode?

Some updates on the issue:
I have switched to an Arduino UNO, but the problem persists.
I have tested the SWserial ports on the GPRS shield with an external rs232->ftdi breakout board and they seem to work fine, both Rx and Tx. But still no luck with SWserial between the shield and the arduino.. As I wrote earlier the setup() function breaks and the arduino reboots, over and over again. I am using the following SoftwareSerial test code, which results in the GPRS shield receiving "Hello, world?" and the cumputer "Goodnight moon!" continously:
Code:
#include <SoftwareSerial.h>

SoftwareSerial mySerial(7, 8); // RX, TX

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


  Serial.println("Goodnight moon!");

  // set the data rate for the SoftwareSerial port
  mySerial.begin(19200);
  mySerial.println("Hello, world?");
}

void loop() // run over and over
{
  delay(1000);
    /*
  if (mySerial.available())
    Serial.write(mySerial.read());
  if (Serial.available())
    mySerial.write(Serial.read());
    */
}

Any ideas?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Sorry i have no idea. Maybe my program code "sending a text message" can help you!

Code:

#include <SoftwareSerial.h>
#define SMSTEXT        "Hello World"      //const. string

SoftwareSerial GPRS(8, 9);                //Define Rx und Tx for GPRS Shield communication

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

void loop() {
     
     if (Serial.available())
        switch(Serial.read())
        {
           case 's':                    //Press 's' to send an text message           
           SendSMS();             
           break;
        }
       
      delay (2000);                    // ... 2 seconds delay
}

//------------------------------------------------------------------------------------------------------------------

void SendSMS()           
{
  Serial.println ("Send SMS started!");
  GPRS.print("AT+CMGF=1\r");            //Because we want to send the SMS in text mode
  delay(100); 
  GPRS.println("AT + CMGS = \"+43xxxxxxxxxxxx\"");  //This number will recieve the text message
  delay(100); 
  GPRS.println(SMSTEXT);        //SMSTEXT = constant
  delay(100);
  GPRS.println((char)26);      //the ASCII code of the ctrl+z is 26
  delay(100);
  GPRS.println();
  Serial.println ("Send SMS finished!");   
}

If it not works, i hope that other forum users help you with your problem!
Logged

Pages: [1]   Go Up
Jump to: