Arduino's Tx doesn't work as expected but Rx working on GSM module

Hi there!

I have a GSM module which was communicating fine with the Arduino using AT commands .
But on previous day, On the same code and with same connections,It doesn’t reply well for the AT commands.

For eg-

It can transmit data which was correctly read and showed by Arduino mega via software serial Rx pin but When I enter AT on Serial Monitor , then It was showing response - “??”

My code was-

#include<SoftwareSerial.h>
SoftwareSerial SIM800(52,53);


void setup() {
  // put your setup code here, to run once:
Serial.begin(9600);
SIM800.begin(9600);
}

void loop() {
  // put your main code here, to run repeatedly:
if(Serial.available()){
  Serial.write(Serial.read());
  SIM800.write(Serial.read());
}
if(SIM800.available()){
  Serial.write(SIM800.read());
}
}

and it showing following response on arduino serial monitor-

RDY

+CFUN: 1

+CPIN: READY

Call Ready

SMS Ready

+CTZV: +22,0

*PSUTTZ: 2019,2,2,14,29,59,"+22",0

DST: 0
AT
⸮⸮⸮⸮AT
⸮⸮⸮⸮
⸮⸮AT
⸮⸮⸮⸮

In short-
Arduino was recieving the data from GSM module but not able to send data using Tx pins.

I have tried using arduino as a bridge and it was working fine,hence we safely say that the problem was not with SIM800 module,only arduino’s Tx was not working as expected.

I have tried with Hardware serial pins,but same problem persists.
Please someone help…

saif1786:

#include<SoftwareSerial.h>

SoftwareSerial SIM800(52,53);

That suggests you are using a Mega. Why use SoftwareSerial on a Mega when it has 3 spare HardwareSerial ports that work much better?

…R

Thanks for your reply but please kindly read full problem,
In the last line It was stated that I have tried using hardware Serial but same problem persists,
Any hint will be welcomed...

Please post the program that used Hardware Serial and also a simple diagram (a photo of a pencil drawing) showing how everything is connected.

...R

Code for Hardware Serial was-

void setup() {
  // put your setup code here, to run once:
Serial.begin(9600);
Serial1.begin(9600);
}

void loop() {
  // put your main code here, to run repeatedly:
if(Serial.available()){
  Serial.write(Serial.read());
  Serial1.write(Serial.read());
  
}
if(Serial1.available()){
  Serial.write(Serial1.read());
}
}

Pin Diagram was in attached image-
GSM Rx to Arduino Serial1 Tx
GSM Tx to Arduino Serial1 Rx
GSM Gnd to Arduino Gnd

IMG_0108[1].JPG

I have checked same hardware serial code for ESP8266 -01 module and the output was somewhat similar...
that it was showing reversed question marks in serial monitor on response to AT command but shows correct information that was sent from these modules...
Is my arduino mega board every tx pin was destroyed?

Image from Reply #4 so we don't have to download it. See this Simple Image Guide

...R

saif1786:
that it was showing reversed question marks in serial monitor on response to AT command but shows correct information that was sent from these modules...

I don't understand what you mean by

shows correct information that was sent

If you mean that line 10 in the program in Reply #4 echoes what you type in the Serial Monitor then it is not telling you very much. That would work even if the GSM was disconnected.

My wild guess is that for some reason the GSM module is now working on a different baud rate. However I don't have one of them and I can't suggest how you might check that other than by trying a range of different baud rates for Serial1. 38,400 is the one I would try first.

NB. Don't waste your time with SoftwareSerial.

...R

First of all, Thank you Sir for teaching me how to post image to this forum so that everyone can see this without downloading.

And please try to understand my problem , as english was not my first language...

Now coming back to my problem,

Sir it was not the case of Baud mismatch from GSM module, as GSM module when restarted, shows the Ready, and some other information on Arduino Serial Monitor,which it was currently showing...
which signifies that Arduino software serial pins was recieving and then showing the information on serial monitor as coded.

But the problem arises when I enter AT command from Serial monitor,then four reversed question marks was showing in the place of OK response.

This problem persists whether I use hardware or software serial PINS, Also this same problem continues even when I use ESP8266 wifi module for testing the board.

for more information on GSM Module see this -https://www.ayomaonline.com/programming/quickstart-sim800-sim800l-with-arduino/

saif1786:
But the problem arises when I enter AT command from Serial monitor,then four reversed question marks was showing in the place of OK response.

I don't have any experience with a GSM module so I am just suggesting debugging ideas that occur to me. I have a suspicion that some devices use a different baud rate in AT mode.

This problem persists whether I use hardware or software serial PINS,

That is why I said to stick with HardwareSerial.

...R

Sir the same problem continues even when I use Hardware Serial.

Screenshot of Serial Monitor was -

Please Help as I needed it for my project,this code and pin connection was previously working, but after a reboot, this problem occurs...

saif1786:
Sir the same problem continues even when I use Hardware Serial.

I do understand that. But that does not mean that HardwareSerial is the cause of it.

HardwareSerial works very much better than SoftwareSerial so it will be easier to find the solution if you use HardwareSerial.

I'm sorry, but I have no more ideas to offer.

Hopefully someone with experience with GSM modules will come along.

...R

Thank You Robin Sir for your appreciable help...

I will wait for someone more experienced to GSM... :slight_smile:

I will ensure to post the solution if I will get any...