GPRS shield

I have the following GPRS shield.

I am trying to use it on an arduino mega with the GPRS Tx and Rx pins connected to Serial1.

But it appears that the only way I can do this is to go into the library source and change these defines:

#define _GSM_TXPIN_ 2
#define _GSM_RXPIN_ 3

It is a bit of a nuisance!

It would be nicer if there was a similar library with the same functionality and nice collection of example sketches which you could just pass in the Tx and Rx pins you want to use through a constructor or the begin(...) function.

Does such a library exist for these GPRS shields?

Does such a library exist for these GPRS shields?

This would be a good opportunity for you to create and contribute one.

PaulS:
This would be a good opportunity for you to create and contribute one.

The damn GMSHIELD library won't even compile!

I don't get it - why is class HWSerial even needed?

Why can't HWSerial GSM::_cell; just be Stream *GSM::_cell;

And simply pass in a HardwareSerial or a SoftwareSerial object into the class constructor or the begin(...) function?

Oh, it looks like it has some additional functions:

int getString( char *pre_string, char *post_string, char *buffer, int length);
 boolean find(char *target);
 boolean  findUntil(char *target, char *terminate);

Still it seems to me it would be a lot more user friendly to just pass in a Stream object to the GSM class constructor and create a HWSerial objects around it internally.

Thus making this library work like most other libraries for serial devices seem to all work.

Why can't HWSerial GSM::_cell; just be Stream *GSM::_cell;

Because someone hacked together something that worked, and then said "F**k it. Good enough". When clearly it isn't. Try using that shield on a Mega, if you want to experience real frustration.

PaulS:
Try using that shield on a Mega, if you want to experience real frustration.

Which is was he does :wink:

Danois90:
Which is was he does :wink:

Where did I miss that? The Leonardo and Due and Micro and several other Arduinos have a Serial1.

PaulS:
Where did I miss that? The Leonardo and Due and Micro and several other Arduinos have a Serial1.

Second line in first post says: "I am trying to use it on an arduino mega" :slight_smile:

Danois90:
Second line in first post says: "I am trying to use it on an arduino mega" :slight_smile:

OK. I've got reading comprehension issues today. Missed that, despite looking after your last reply.