Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

problem with SIM 300 gsm modem in sending message

Status
Not open for further replies.

bsaurabh

Newbie level 5
Newbie level 5
Joined
Oct 25, 2012
Messages
8
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,370
hello friends, I am facing problem in sending message from SIM 300 GSM modem. i have connected it to my PC using serial cable. I am sending following commands to modem
1.AT // response of modem was OK

2.AT+CMGF=1 // response of modem was OK

3.AT+CMGS="+919028198563" //response of modem was >

i typed the text in front of > symbol.
now for sending the entered text i need to press cntrl+Z and the the modem response should be as "+CMGS:1 OK". but as we press cntrl+z there is no response from modem infact the data in input window of hyperterminal is erased and there is no effect of the command . I also gave command to modem using the controller still it is not sending the message. the modem does call if we send the command ATD9028198563.
what should i use in place of cntrl+z???
is there any other instruction?????
how should i send message through this modem???????
please help ASAP...:cry::sad::sad:
 

Did you set all matching parameters in both the sender and receiver?

Baud rate?
Half duplex or full duplex?
Parity?
Data 7 bit or 8 bit?
Etc.

I seem to remember that half duplex will echo what you are typing, on both sender and receiver, as you type. I cannot be sure about the units you are using.
 

yes sir i have set all the parameters properly. the only problem is in sending message and that too at cntrl+Z command. I even tried to send commands making the echo off.
but still it doesnot work properly. as i give the cntrl+Z command the data in terminal is erased a bit lyk the UNDO operation in Microsoft Word and then the terminal gets hanged and it stays in same state. the modem does not take any command it seema as if it is hanged.:-(
 

...
i typed the text in front of > symbol.
now for sending the entered text i need to press cntrl+Z
...

I don't believe that you can send custom characters like Ctrl+Z using HyperTerminal.
Try finding some other serial port applications that can send characters in hex or decimal format, beside text format.
Then when you need to send Ctrl+z, you send 0x1A(hex format) or 26(decimal format) this time without CR character
which is btw. usual terminating character after any AT command.
 
i solved the problem of hyperterminal and cntrl+Z. i changed the hyperterminal which i was using. I used puTTY a terminal software and by using it i could send the SMS from modem. actually the previous hyperterminal was not having all the facilities like(cntrl+Z).
but now Iam facing new problem. i have programed 8051 to send the commands to GSM modem to send SMS. I have connected the TX pin of 8051 board to RX pin of modem & the RX pin of 8051 board to TX pin.also i have short the GND pins.But there is no response. the controller is sending the instructions properly if we see it on hyperterminal. but the modem is not giving any response even for simple command like "AT".:-(

How sholud i connect the modem to 8051 board?????
should i keep open the other pins(RTS, CTS,DTR, DCD, DSR) of DB9 connector on modem?????
what should I do of flow control in modem???????????
or should I send some instruction to modem at first?????
 

should i keep open the other pins(RTS, CTS,DTR, DCD, DSR) of DB9 connector on modem?????

When I would make such homebrew communication hookups, I used the null modem kind. I believe you are doing the same.

It's the easiest to make it work.

Three wires:
1 for data one way,
1 for data the other way,
and 1 ground.

Usually only two wires were really needed because one computer was sender and the other was receiver.

Even then it required a lot of typing and testing before I got it to work.

I have no experience with pics or microcontrollers.

Make sure your volt levels are compatible. Does one unit use 5V and the other use 3.3V?

Start at the slowest baud rate.

Can you use an oscilloscope (logic probe, LED) to observe whether a signal is reaching the receiving unit?
 

i solved the problem of hyperterminal and cntrl+Z....
I am glad that you are making some progress.

Your connection between 8051 and SIM300 is fine, bearing in mind that you have appropriate voltage levels of your RX and TX signals (consult the datasheet of SIM300).
It is very important what parameters did you set in your SIM300 while you are experimenting with HyperTerminal and latter with puTTY.
Therefore, connect SIM300 with puTTY again, and check with appropriate AT commands what is your default baud rate, is it fixed or auto.
What is your flow control settings, is it hardware, software or none. Check all of this parameters before interfacing with your 8051 mCU.
I suggest you to set fixed baud rate of 4800bps(for now) with no flow control, connect only RX,TX and GND lines and try again.
Don't forget to program your 8051 to send CR character after every AT command.
 
Thank you sir for the suggetion. i am doing the same connection which you suggested.:):)

i just had few queries. why is flow control to be kept on none??????
is it necessary to give an initial command ATV0 (This parameter setting determines the contents of the header and trailer transmitted with result codes and information responses.)?????

are these things necessary??????
 

Thank you sir for the suggetion. i am doing the same connection which you suggested.:):)
i just had few queries. why is flow control to be kept on none??????
If you use flow control you have to make some additional coding in you mCU firmware.
For example, using hardware flow control you must use RTS and CTS lines; google about "uart hardware flow control"
If you don't use flow control then you need only TX and RX data lines.
In your experimental phase you don't need it, but for some complex communication like GPRS data transfer it is
highly recommended.

is it necessary to give an initial command ATV0 (This parameter setting determines the contents of the header and trailer transmitted with result codes and information responses.)?????
are these things necessary??????
No. I believe that default value is 1.
 

sir i tried sending commands without flow control also still didnt worked.:-:)-(

sir here is my program which i have burned in 8051. please look into it and suggest me if there is any problem in code.
#include <reg51.h>

unsigned char *command_AT = "AT\r\n";
unsigned char *command_CMGF = "AT+CMGF=1\r\n";
unsigned char *command_CMGS = "AT+CMGS=";
unsigned char dublinvrtd=0x22;
unsigned char *number="+919449986547";
unsigned char dublinvrtd=0x22;
unsigned char *nxtline="\r\n";
unsigned char *message = "electronicprojs.blogspot.com";
unsigned char CTRLZ = 0x1A;

void puts(unsigned char* ptr);
void putc(unsigned char chr);
void sendsms(void);
void initialize();

main()
{
initialize();
sendsms();
while(1);
}

void initialize()
{
SCON = 0x50; /*SCON: mode 1, 8-bit UART, enable receive */
TMOD |= 0x20; /*TMOD: timer 1, mode 2, 8-bit */
TH1 = 0xFD; /*TH1: for 9600 baud */
TR1 = 1; /*TR1: timer 1 run */
}

void sendsms()
{
puts(command_AT);
puts(command_CMGF);
puts(command_CMGS);
putc(dublinvrtd);
puts(number);
putc(dublinvrtd);
puts(nxtline);
puts(message);
putc(CTRLZ);
}

void puts(char* p)
{
char *temp = p; /*temp pointer so that the actual pointer is not displaced */
while(*temp != 0x00)
{
putc(*temp);
temp++;
}
}

void putc(unsigned char chr)
{
SBUF = chr;
while(TI==0); /*Wait until the character is completely sent */
TI=0; /*Reset the flag */
}
 

After you send each AT command to SIM300 it is important to wait for SIM300 response.
In your code, you are sending your commands as "stream" of data. Therefore you must implement a delay between sending two successive AT commands,
or process the responses from SIM300. After you receive the response you can send another AT commmand.

First try to establish the basic comunication using only AT command, after you receive OK from SIM300 you can deal with other AT commands.

unsigned char *command_AT = "AT\r\n";

unsigned char *command_AT = "AT\r"; //Send only CR (\r) character :

void initialize_SIM300()
{
puts(command_AT);
Delay_ms(3000); // wait for 3s
}

main() // for now rewrite you code like this
{
initialize();
Delay_ms(100); // wait for 0.1s just in case
// turn on the SIM300
Delay_ms(5000); // wait for 5s to bring up the SIM300 UART port
initialize_SIM300(); // first run
initialize_SIM300(); // second run
initialize_SIM300(); // third run
while(1);
}

How do you plan to monitor SIM300 responses?
 
Last edited:

I will be using the TX pin of GSM modem and giving it to the RX pin of computer and the RX pin of GSM modem will be given to TX pin of controller. And i will short the GND pin(i.e pin 5) of all the three DB9.I think it will be possible to see the response.
will it work?????
 

I will be using the TX pin of GSM modem and giving it to the RX pin of computer and the RX pin of GSM modem will be given to TX pin of controller. And i will short the GND pin(i.e pin 5) of all the three DB9.I think it will be possible to see the response.
will it work?????
Yes.

btw. Don't forget to use voltage transceiver like MAX3232 between PC and GSM module,
and connect the TX pin(mCU) to RX pin (GSM) with appropriate voltage levels.
 

use a 2ampere current source your problem will be solved
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top