I'm using the Arduino Uno board with Quectel M10 GPRS shield. I want to send AT commands through the serial monitor. I load the following code and send AT commands through the serial monitor. I dont see the AT command sent or response received on the serial monitor output window. Any help is appreciated..
/Serial Relay - Arduino will patch a
//serial link between the computer and the GPRS Shield
//at 19200 bps 8-N-1
//Computer is connected to Hardware UART
//GPRS Shield is connected to the Software UART
#include <SoftwareSerial.h>
SoftwareSerial mySerial(2,3);
void setup()
{
mySerial.begin(19200); // the GPRS baud rate
Serial.begin(19200); // the GPRS baud rate
}
void loop()
{
if (mySerial.available())
Serial.write(mySerial.read());
if (Serial.available())
mySerial.write(Serial.read());
I suggest you add a Serial.println() call in setup() so you can confirm that the USB serial connection is working correctly. I don't see anything wrong with the code, so I suggest you double check the connections to the modem and the serial settings. Have you check that the pins used for mySerial are the correct way round wrt the wiring connections? How do you know that the modem is using 19200 bps? If there's any possibility that it's starting off at another speed, or with different serial settings, try changing the mySerial setup to see if you can get a response from it.
Also, please correct the bogus comment in setup().
PeterH,
You were correct. The modem was set at 9600 baud, that's why I wasn't getting any response. Once I fixed that as shown below, AT communication is working fine now.. Thanks for your help..
/Serial Relay - Arduino will patch a
//serial link between the computer and the GPRS Shield
//at 19200 bps 8-N-1
//Computer is connected to Hardware UART
//GPRS Shield is connected to the Software UART
Hi, I have a problem with gprs modem.
I'm using gprs Maestro 100 evo. I have set this modem(AT command) using hyperterminal then the connection established (between modem and virtual serial port in PC) but when I am going to send data, PC can't read it.
these my program
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.
I think I think I would try getting the GPS info returned to main program loop from GPS object.
THEN println it out to monitor.
This SKETCH is useful, identifying to the terminal with keypress.
The GPS object likely needs to inherit the print object.
/*
SerialEcho
Echos a char value sent via USB input back to the terminal application.
Initializes returning first keypress as identifier string.
*/
int charVal;
void setup() {
Serial.begin(9600);
splash();
}
void splash(){
while (!Serial.available()){
}
Serial.println("ARDUINO XMEGA_2560");
}
void loop() {
if (Serial.available()){
charVal = Serial.read();
}
if (charVal){
digitalWrite(13, HIGH); // set LED on
delay(5); // wait
Serial.write(charVal);
Serial.write(32); // Added a space here to make echo obvious
charVal = 0;
digitalWrite(13, LOW); // set LED off
delay(5); // wait
}
}
Can anyone tell me how can I send sms to many numbers at once? im sending through java.. Can send to one number at once.. when I try to send many numbers. sms is going for just 2 or 3 numbers... how can I send many sms at once?
sham999:
Can anyone tell me how can I send sms to many numbers at once? im sending through java.. Can send to one number at once.. when I try to send many numbers. sms is going for just 2 or 3 numbers... how can I send many sms at once?
This doesn't seem related to the original question and I think you're hijacking the thread. If you have a new question, start your own thread. If you want help with a problem in your code, you will need to post the code which demonstrates the problem.
Connections that i did..
-> i've connected the Arduino Tx(pin 1) to Rx pin of the modem and Arduino Rx(pin 0) to Tx pin of the modem.
-> and i am using the USB cable to power up and i think i can use the same cable to watch the serial communication also..
this the setup..
this setup is ok or do i need to connect more????
is there any mistake that i did in the setup???
please help me out...
-> i've connected the Arduino Tx(pin 1) to Rx pin of the modem and Arduino Rx(pin 0) to Tx pin of the modem.
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.
this setup is ok or do i need to connect more????
No, and yes.
The yes part is that you need to connect power and ground, too.
The no part is that you need to connect the Rx and Tx pins to other pins on the Arduino, and use SoftwareSerial to talk to the modem.
the theory you said i understood, but the setup is bit confusing..
-> i will use the Software serial to communicate with the Modem it is ok..
-> you are saying that use Arduino Tx and Rx pins to communicate with the pc it is confusing do i need to connect to these pins
or through USB interface can i use these with out connecting ????
you are saying that use Arduino Tx and Rx pins to communicate with the pc it is confusing do i need to connect to these pins
or through USB interface can i use these with out connecting ????
-> Tx pin of modem to Rx(pin-2 ) of softwareserial.
-> Rx pin of modem to Tx(pin-3) of softwareSerial.
-> power supply to the modem from arduino.
problem
this time i not getting anything in the serial monitor..
i tried to replace the "println" with "write" also but still nothing in serial monitor..
the connections and programs are ok?? (or) still am i doing any mistakes?? suggest me any changes???
Hi, i have problem with AT command, it do not have any reply after i follow the instruction above.... May i know what is the problem? After key in the command and click send, it do not have any response. Anyone can help? ><