Go Down

Topic: gsm modem #~plz help~# (Read 812 times) previous topic - next topic

gshubham96

Hello,
I am trying to connect arduino with GSM modem.
I have connected Rx of arduino w/ Tx of modem and vice versa.
Here is the code
Code: [Select]

#include <NewSoftSerial.h> //Include the NewSoftSerial library to send serial commands to the cellular module.
#include <string.h>         //Used for string manipulations
char incoming_char=0;      //Will hold the incoming character from the Serial Port.
NewSoftSerial cell(2,3);  //Create a 'fake' serial port. Pin 2 is the Rx pin, pin 3 is the Tx pin.
void setup()
{
  //Initialize serial ports for communication.
Serial.begin(9600);
cell.begin(9600);
Serial.println("Starting  Communication...");
}
void loop()
{
//If a character comes in from the cellular module...
if(cell.available() >0)
{
incoming_char=cell.read();    //Get the character from the cellular serial port.
Serial.print(incoming_char);  //Print the incoming character to the terminal.
}
//If a character is coming from the terminal to the Arduino...
if(Serial.available() >0)
{
incoming_char=Serial.read();  //Get the character coming from the terminal
cell.print(incoming_char);    //Send the character to the cellular module.
}
}


There is no response from the modem nor the arduino is sending any command to the mode.
The modem is working fine w/ computer.

Regeards,
Shubham Garg
Regards
Shubham Garg

AWOL

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

gshubham96

check out the modem here http://probots.co.in/index.php?main_page=product_info&cPath=77&products_id=326.
The modem comes with a serial TTL output.

Regards
Shubham Garg
Regards
Shubham Garg

PaulS

Quote
I have connected Rx of arduino w/ Tx of modem and vice versa.

Code: [Select]
NewSoftSerial cell(2,3);  //Create a 'fake' serial port. Pin 2 is the Rx pin, pin 3 is the Tx pin.
If the modem is connected to RX/TX (pins 0 and 1), why are you talking to/listening to pins 2 and 3?

gshubham96

by Rx/Tx I meant the fake Rx/Tx pin created by the Newsoft library.
Regards
Shubham Garg

Dr_Ugi

Are you sure of how the board is marked for Tx & Rx?

Some boards mark their function (i.e. Rx is the pin on which the board receives) and some boards seem to mark the function of the pin that they should be connected to (i.e. Rx on the board should be connected to the pin on which the microcontroller receives).  If it's not entirely clear then it might be worth trying them reversed.

PaulS

Quote
by Rx/Tx I meant the fake Rx/Tx pin created by the Newsoft library.

Maybe you connect the device to a real pin. There is nothing fake about the software serial port.

Go Up