Sending AT commands through serial monitor

Anyone can help?

Please post your program.

Hi, this is my program, i use arduino mega and sim900

#include <SoftwareSerial.h>
SoftwareSerial GPRS(7, 8);
void setup()
{
GPRS.begin(115200); // the GPRS baud rate
Serial.begin(115200); // the GPRS baud rate
}
void loop()
{
if (GPRS.available())
Serial.write(GPRS.read());
if (Serial.available())
GPRS.write(Serial.read());
}

UKHeliBob:
Please post your program.

From the reference for SoftwareSerial:

Not all pins on the Mega and Mega 2560 support change interrupts, so only the following can be used for RX: 10, 11, 12, 13, 14, 15, 50, 51, 52, 53, A8 (62), A9 (63), A10 (64), A11 (65), A12 (66), A13 (67), A14 (68), A15 (69).

dannable: From the reference for SoftwareSerial:

HI dannable, do u mean i need to change the SoftwareSerial GPRS(7, 8) to SoftwareSerial GPRS(10,11)?

Depends on which pins the modem is listening. Which one are you using?

dannable: Depends on which pins the modem is listening. Which one are you using?

May i know how to check it? check for the tx1 and rx1?

Lord_Santa: I'm using a Sierra Wireless FXT009 to send AT Commands to the Arduino. I used m2msupport's code so that I can monitor whether the the arduino is receiving successfully. I have it connected using a Max232 to pins 2 and 3 (Software Serial Pins).

When I open the serial monitor all I see is garbage, unreadable symbols, but I can tell it's receiving the data because there is a 20 second gap between automatic acknowledgements from the modem. It's just that this data arrives unreadable. There's no problem when you connect the modem directly to the PC. I checked the baud rate and even changed the modem's baud rate to 9600, still didn't help.

Any ideas on what the problem could be?

Sounds like you didn't set Serial Monitor to the same speed as you set Serial on the Arduino.

dannable: Could you tell us what the problem was for future reference?

just one error

void loop()
{
  mySerial.println("AT"); // sending "AT" command

  while(!(mySerial.available() > 0));
    Serial.println(mySerial.read()); //expected reply "OK"  
}

print "AT" to mySerial

while not mySerial.available just loop around

print the next mySerial char read

loop back to... print "AT" to serial

what's that going to do?

pyhee: May i know how to check it? check for the tx1 and rx1?

Using RX1 and TX1 for software serial is like pushing a car to give someone a ride.

RX1 and TX1 are RX and TX for Serial1. As in

void setup() { Serial.begin( 115200 ); // USB to the PC, why go slower? Serial1.begin( 19200 ); // possibly the baud rate that GPRS expects }

MEGA2560 also has Serial2 and Serial3. Like Serial and Serial1 they are hardware serial ports aka USARTs. You do not need to run software serial on those pins. That's entirely a waste!

GoForSmoke: Using RX1 and TX1 for software serial is like pushing a car to give someone a ride.

RX1 and TX1 are RX and TX for Serial1. As in

void setup() { Serial.begin( 115200 ); // USB to the PC, why go slower? Serial1.begin( 19200 ); // possibly the baud rate that GPRS expects }

MEGA2560 also has Serial2 and Serial3. Like Serial and Serial1 they are hardware serial ports aka USARTs. You do not need to run software serial on those pins. That's entirely a waste!

Hi, if i didnt put a wire(tx1-rx, rx1-tx) to connect between Arduino Mega and sim900, it doesnot work.

Hi, if i didnt put a wire(tx1-rx, rx1-tx) to connect between Arduino Mega and sim900, it doesnot work.

If you did NOT put the wires in then how would it work? Radio?

If you DO put the wires in then you must also put a wire from one board ground to the other ground.

If you DO all three wires then make sure that Serial1 and the SIM900 are the same baud rate and the other serial settings (no parity, 8 data bits, 1 start bit, 1 stop bit) are the same.

Did you run Serial1.begin() and NOT have software serial assigned to those pins?

Hi

I have a problem similar to ysrinivas, but in my case i do see the response of at commands in my serial monitor. But when i send a command for read message serial monitor does not show the message.Below is the code.

#include <SoftwareSerial.h>
SoftwareSerial cell(2,3);
char incoming_char = 0;
String content = “”;

void setup()
{
//Initialize serial ports for communication.
Serial.begin(9600);
cell.begin(9600);
Serial.println(“Starting GSM Communication…”);
cell.println(“AT”);
delay(2000);
show();
delay (2000);
cell.println(“AT+CMGF?”);
delay(2000);
show();
delay(2000);
cell.println(“AT+CMGR=1”);
delay(2000);
show();

}
void loop()
{;
}

void show()
{
content = “”;
while(cell.available()!=0)
{
if( cell.available() > 0 )
{
//Get the character from the cellular serial port.
incoming_char = cell.read();
content = content + String(incoming_char);
}
}
Serial.print(content);
}

please help

You can use those pins to talk to the modem. But you can't then use them to talk to the USB-to-serial chip that communicates with the PC via the USB cable.

Just to clean up some of the discussion, the above statement is incorrect.

halo , first i m sorry for my bad English its not my first language and i don’t use it most of the time
i m new here , i m working on a project using the atwin quad-band gprs/gsm shield for arduino and i have a problem connecting the board to the AT command tester no matter how i tried i always get this message from the AT command tester "Sending AT query…

Invalid or no response from the device. Please check the modem port and the baud rate.Disconnecting port COM16."

i m using an arduino UNO R3 connected to the com 16 port , i tried to changed the jumper setting but no change , same message every time , i followed the steps in this link http://linksprite.com/wiki/index.php5?title=ATWIN_Quad-band_GPRS/GSM_Shield_for_Arduino also same message ,

for serial connection i m using this code

#include <SoftwareSerial.h>
char incoming_char=0;
SoftwareSerial cell(2,3);

void setup()
{
  cell.begin(9600);                 
  Serial.begin(9600); 
  Serial.println("Starting ATWIN Communication...");
  
}

void loop()
{
  if (cell.available() >0)
  {
    incoming_char=cell.read();
    Serial.write(incoming_char);
    }
  if (Serial.available() > 0)
  {
    incoming_char=Serial.read();
    cell.write(incoming_char);
  }  

}

as you see its a modified version of the one founded in the link , if i m doing something wrong con someone give me simplified steps to get it to work , as for the reason why i chose the ATWIN quad band , it was the cheapest shield i could find , is there a difference between it and other GSM shields , thanks in advance

i m new here , i m working on a project using the atwin quad-band gprs/gsm shield for arduino and i have a problem

Probably best you start your own new discussion about your project. Be sure to read the below.

http://forum.arduino.cc/index.php/topic,148850.0.html

Hi everyone, I’m encountering issues communicating with a modem through the serial monitor that comes with Arduino. I am attempting to communicate with an Iridium 9602 modem using the Software Serial function and send AT commands through the interface. I am however, having issues seeing the responses from the modem. To confirm that the modem is operational, I employed a FT232R breakout board. I can successfully communicate with the modem through this breakout board, but I can’t do the same with an Arduino Mega 2560. Could it be a hardware issue or is it the code that is incorrect? Any help would be appreciated, thanks!
If need be, I can include images of the hardware connection or wire diagrams as well.

The code I’m using is listed below:

#include <SoftwareSerial.h>

SoftwareSerial mySerial(12,13);

void setup()
{
  mySerial.begin(19200);                
  Serial.begin(19200);                    
}

void loop()
{
  if (mySerial.available())
    Serial.write(mySerial.read());
  if (Serial.available())
    mySerial.write(Serial.read());  

}

hi, I want to program the GSM modem (Sierra Wireless Fastrack FXT009) with the arduino to send a MSG. Thank you for helping me

Probably best you start your own new discussion about your project. Be sure to read the below.

http://forum.arduino.cc/index.php/topic,148850.0.html

Hi,I am having problems on a similar subject please can you pop over to my thread to help https://forum.arduino.cc/index.php?topic=473113.0

Hi, I am using Lora Reyax RYLR406 with arduino Uno Board, but I can't send AT comand . How I can solve this?