The Arduino GSM Shield is not very compatible with the Leonardo, and the library uses interrupts different for the Leonardo.
There is a guide for it: http://arduino.cc/en/Guide/GSMShieldLeonardoMega
But that still uses pin 3 for TX. However, pin 3 is also SCL for the I2C bus.
It would better if the GSM shield could be used and still keep the Serial1 and I2C available.
The solution is simple, use RX to pin 8 (as described in the Guide) and TX to pin 9.
The RXINT should not be used, since pin 8 supports PCINT change interrupt for the normal SoftwareSerial library.
In the library GSM3SoftSerial, the interrupt for the Leonardo is not very well implemented. It seems to be a work in progress. As it is implemented at the moment, I would call it a bug.
I suggest to remove the interrupt number for the Leonardo, and make it possible to use a pin as described for the SoftwareSerial library.
The library and the guide should be changed.
I know this is an old thread but I hope it is the current one.
I am trying to connect the Mega 2560 to the GSM shield and have followed this post and your guide but am now at a loss.
The only 'proof of life' I got from the GSM shield is when I used HW Serial using the AltSoftSerial library. This required connections to pins 0 and 1 on shield to be connected to the mega on 48 and 46 with 44 and 45 to be taken up for interrupts. I followed the instructions in AltSoftSerial Library, for an extra serial port. My shield looks like the image in the link below.
But as I set the jumpers to sw serial mode and used jp 7 and 8, or even using hw serial mode on jp 0,1 on the shield, i could not communicate to 9,8 on the Mega using the GSM3 library. I did set to 9,8,100 the tx,rx,rxint in GSM3IO.h.
Apologies for the delay in replying but I am missing my email alerts on updates - Will try to fix.
The HWserial (i believe) is being set through my jumper settings on the GSM shield and I'm using jumpers 0,1 on the shield. The AltSoftSerial is being used to have 2 serial sessions- one between the modem and the mega and the other replicating comms to the serial between the mega and pc.
...
I thought I had to use 8,9. I also tried 14,15 but am at a loss what going on.
The AltSoftSerial is being used to have 2 serial sessions- one between the modem and the mega and the other replicating comms to the serial between the mega and pc.
You have 4 hardware serial ports. You have not adequately explained why you need a second software serial port (besides the one that the moronic GSM library insists on using).
I learnt I got clones and not the real deal and probably hence the issues (pics included)
For instance as you can see from the pictures, the GSM Shield has the jumpers reversed for D7/D8 (the pic are for setting them in this manner. I tested with a meter). Hence the confusion when I though I was using HWSerial. My SwSerial setting is to set the jumper to be close to the antenna.
I could not make the serial1 connection work to the gsm shield as per dannable's link on pins 18/19 but managed to make it work on pins 50/51 with SoftwareSerial.h and AltSoftSerial.h on pins 46/48
The pictures show he pins connected to 50/51 when it was tested successfully with SoftwareSerial.
The tests were confirmed to be successful as commands were returned by the modem to the serial monitor.
The question now remains as to how to make use of the GSM3 library. I figured that the settings are in GSM3IO.h and changed it as follows (extract). Note that I want to use 50/51 as these are confirmed to work with SoftwareSerial but I could not connect to 14-19.