Original Arduino GSM Library - change RX / TX to Hardware Serial

Hej guys,

is anybody of you familiar with the original Arduino library gsm.h and can help me?

I need to change the rx tx pins from software serial to hardware serial (channel 2 on the Arduino Mega).

Is it possible?
I already tried the Rxpin / Txpin from GSM3Softserial.cpp to 16/17 (pins of Serial2 on the Mega) but it did not work.

Regards!

GSM3SoftSerial was designed for emulate a serial port by software, not for hardware native serial port. You have to modify it or create a new code for it.
If you can use a serial port emulate by software, RX pin must be a pin with support for interruptions.

Thanks for your replay. I would have guessed this.

is it possible for me to use Original Arduino GSM Library with other GSM shield (not original GSM shield as well) for example from DFRobot? if it could, in which part i must adjust?

You can modify it. The most important things are software serial communication, commands compatibility, software flow control and responses times.

Could you solve the problem? I have got the same problem. I want to use hardwareserial.

In theory, you can replace all references to SoftwareSerial with Serial class.

the most important is that how to change pin software defined rx and tx (ardunio uno pins 2&3) gsm.h library to hardware 0&1 pins i mean what should we modify in that library to do so?

Dear all,
has anyone solved this issue on how to replace the software serial with the hardware one?

Because I've already designed a board that use the M10 GSM modem in order to communicate data on a IoT platform.

The problem is that the module is connected to the hardware serial pin instead of 2,3 as usual.

That was in order to save program space using HW pins since that I should not keep the hardware serial free.

Hey Peeps.

I'm in the same boat. I need to change the RX / TX to HW. not the usual 2,3. But the 0,1

I been searching the internet and found this issue/discussion:
[ url = Can the official arduino GSM shield library be changed to work with hardware serial on mega - Arduino Stack Exchange ]

I did try it out and find the Pin upsetting for GSM in the header file ( GSM3IO.h ) the place -> ( C:\Program Files (x86)\Arduino\libraries\GSM\src). But when I change the pin ports there nothing really happens.

Are there someone that has a suggestion about this?

Hello,

I was looking at this post and noticed some of you having trouble using hardware serial. I have figured it out with the library I am using. I use it with a Mega and a 3G modem shield. If anyone would like more info on what I did, please reply.

StanleyK:
Hello,

I was looking at this post and noticed some of you having trouble using hardware serial. I have figured it out with the library I am using. I use it with a Mega and a 3G modem shield. If anyone would like more info on what I did, please reply.

Yes please, I am completely new to this and I am struggling with the 3G modem shield. I can get the example test send sms to work on the Uno, but I need to use a mega to enable the keyboard (unless I rig up a voltage divider and use analogue input). I have changed the example code to use pins 18/19 for TX/RX but I think I am struggling to 1. Communicate and 2. Get the shield to begin

Basis of the project I'm working on is

Hardware -

  • Funding Mega 2550
  • DFRobot LCD Keypad Shield
  • TinySine 3G Shield (Sim5320A)

Operation -

At idle, the LCD displays "Enter Ph Number", the user then enters their phone number using the keypad. Once 10 digits have been entered, the LCD writes "Press # to Send", the user then presses hash and I wish for the Arduino to send a SMS to a set number (UTCPhone String). The message will contain the entered user phone number and the asset number of which the sms was sent from (AssetID String)

I have attempted copying from the Adafruit_FONA Library, but I must be interfering with the serial or something, when copy the void(setup) into my sketch it shuts down the LCD screen

Sorry for being new to this and asking such a direct question, but any help would be much appreciated

SMS_Notifier.ino (4.15 KB)

StanleyK:
Hello,

I was looking at this post and noticed some of you having trouble using hardware serial. I have figured it out with the library I am using. I use it with a Mega and a 3G modem shield. If anyone would like more info on what I did, please reply.

Hello, Have you been able to use hardwareSerial with a GSMshield on Mega?