Pages: [1]   Go Down
Author Topic: Configuring GSM Library to use Hardware serial instead of Software Serial  (Read 1215 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 19
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

Arduino 1.0.4 Contains a GSM library which implements AT commands for GSM modems.

http://arduino.cc/en/Reference/GSM

It uses SoftwareSerial Library. But If I want to use it with Hardware Serial is there any easy way to configure the library?

/Chathuranga
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Considering that the library is intended to be used with the GSM shield, and that the shield is hardwired to pins 2 and 3 for the RX and TX pins, SoftwareSerial seems like the only viable option.

Yes, I know, not a smart decision, since pins 2 and 3 are not capable of SoftwareSerial on all boards.

(Actually, the library indicates differently. On a Mega, the RX pin is pin 10, which is software serial compatible.)

How are you proposing to work around the hardware issues?
Logged

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

Considering that the library is intended to be used with the GSM shield, and that the shield is hardwired to pins 2 and 3 for the RX and TX pins, SoftwareSerial seems like the only viable option.

Yes, I know, not a smart decision, since pins 2 and 3 are not capable of SoftwareSerial on all boards.

(Actually, the library indicates differently. On a Mega, the RX pin is pin 10, which is software serial compatible.)

How are you proposing to work around the hardware issues?

Well... Say you have a GSM module which requires only TX, RX and GND. So the easiest way to connect them is to use hardware serial TX-RX with modem TX-RX. But in that case you have to use serial library and implement AT commands by your own. But this GSM library have them implemented so it is more efficient to use the same library instead of going through the AT command manual.
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
But this GSM library have them implemented so it is more efficient to use the same library instead of going through the AT command manual.
Only if you have the exact same GSM chip. Otherwise, the exact AT commands (and responses) may not match.

If you are not using the shield, you could still connect your GSM chip/board to the same pins that the shield uses.
Logged

Offline Offline
Newbie
*
Karma: 1
Posts: 12
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have a similar problem:

I have a GSM shield (from cooking hacks) that uses pins 0 and 1 for RX and TX. I would like to use new GSM library with that shield, but until now, I have not managed it to work.
I have tried to join pins 0-1 of my gsm shield with arduino pins 2-3 using jumper cables but I still haven't succeeded to communicate.

Any tips?
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I would like to use new GSM library with that shield, but until now, I have not managed it to work.
And you never will. The Arduino GSM library is for the Arduino GSM shield. Not any other shield.
Logged

Offline Offline
Newbie
*
Karma: 1
Posts: 12
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Could you explain it with more detail?

Taking a look at Arduino GSM Shield schematic (http://arduino.cc/en/uploads/Main/arduino-gsm-shield-schematic.pdf), you can see that pins used are fairly common:
- VCC
- GND
- D3 and D4 for rx-tx
- D7 for switching shield on / off
- Reset

My cooking hacks shield has similar pinout:
- D0 and D1 for rx-tx
- D2 for switching on/off

So, is it a question of internal behavior? Different AT commands?

Logged

Pages: [1]   Go Up
Jump to: