Hi all,
I have been trying the whole day to connect my Arduino Mega2560 to the GPRS shield. Partly it works since I was able to make calls with the code provided in the wiki (seeedstudio.com/wiki/index.p … d_PWM_pins - by replacing NewSoftSerial with SoftwareSerial).
The problem is i am not able to communicate with the shield at all! I’ve read all the related posts in this forum but none of the solutions proposed worked (the only point I didn’t try is upgrading the firmware of the SIM900).
Any suggestions on how to proceed?
Thanks in advance!
I’ve been able to achieve some progress on this problem…
I’ve used wire jumbers to connect the D7 and D8 pins on the GPRS shield to the pins 52 and 53 on the Arduino board (I’ve tried also the other pins on the Arduino but strangely it was not working). Finally I am able to get some response from the shield but only garbage values, despite the suggested change of the baud rate it is still not working.
My code is as follows:
[code]#include <SoftwareSerial.h>
SoftwareSerial mySerial(52, 53);
void setup()
{
mySerial.begin(19200); // the GPRS baud rate
Serial.begin(19200); // the GPRS baud rate
Serial.print(“AT+IPR=19200\r”);
}
void loop()
{
if (mySerial.available())
Serial.write(mySerial.read());
if (Serial.available())
mySerial.write(Serial.read());
}[/code]
Any suggestions what could be wrong?
Please show the raw output (HEX). Nobody can check your problem if you show a few symbols.
Jumper wires for connection between arduino and shield is not a good idea! Why dont you put it on your mega?!
Thanks for your feedback! Actually I have the shiled already plugged in the arduino but by using the pins 7 and 8 as default I do not get any communication so I’ve wired the pins 7 and 8 to the 52 and 53…the only way I am able so get something out from the terminal…
Attached a screenshot with hex values (same code as posted above).
There are many invalid bytes… 00, FE, FF and 86.
First you should use hardware serial (mega offer 4 serial interfaces) for a stable connection.
Check power supply. GPRS Shield must be powered from external supply.
Try lower baudrate (9600).
Hi schmron,
Sorry for my limited knowledge but what do you mean by using the hardware serial…is it enough that I just connect the pins 7 and 8 on the shield to the TX and RX pins on the board - having the shiled inserted and changing the code to SoftwareSerial mySerial(0, 1);? I’ve tried this way also with other pins on the mega (14-19) but without success…no any communication!
Re external supply I doubt it could be a problem since the shield is able to make phone calls with USB power from the arduino.
Not all pins on the Mega and Mega 2560 support change interrupts, so only the following can be used for RX: 10, 11, 12, 13, 50, 51, 52, 53, 62, 63, 64, 65, 66, 67, 68, 69
Source: arduino.cc/hu/Reference/SoftwareSerial
The shield doesn’t work with Megas unless you modify them or use jumpers like you’ve done.