Microcontroller › 8051 › Check the GSM(SIM 900) Response using AT Command
- This topic has 2 replies, 3 voices, and was last updated 10 years, 2 months ago by Jaymin D.
-
AuthorPosts
-
April 26, 2014 at 5:14 am #3059kamal parmarParticipant
Hello to all,
Can any one help me out in my problem?
Problem:
i wan to check the response of AT Command which we get on hyperterminal.
i want to develop my code like this way when i transmit AT Command from Controller to GSM modem then GSM is reply or give reponse some thing so i want to check this response with out hyper terminal.
Example:
i transmit one command: like AT then response possibility is two.
1) OK
2) ERROR
if i get the first response the my code will excute further otherwise it will again excute same command(AT).
so we always get the true condition no chance to fail our system.
so please help me to solve this problem.
i dont get the idea where this respose will store or how i compare??
Thank in Advance
April 27, 2014 at 3:42 pm #11638praveenkumar.vParticipantHi
if you send AT to the gsm modem.The modem will acknowledge the controller as anyone like AT OK or AT ERROR.you can use string compare function to check the acknowledgement or u can makes use of lcd display to display the acknowledgement send by the modem to thecontroller
July 15, 2014 at 3:47 am #11903Jaymin DParticipantHello Kamal,
Its very easy to get response and comapre form GSM,
Here are some steps, hope it may helpful to you
1. connect GSM 300 modem with PC/LAPTOP via USB to RS 232 converter or direct DB-9 whatever u may comfortable but you must have valid COM port after that
2. Go to Hyper Terminal and create profile
3. baud rate – 9600 , flow control – none , bits – 8 and rather as it is.
4. Now in Hyper terminal go to setting -> preferance / advance seting -> in that field tick the ” Echo on ” tab. (This is very imp for displaying the response form GSM)
5. after that wait fro network in GSM and type AT in terminal and Enter
6. You will see ‘OK’ in next line.
for your 2nd Q about storing the response
1. In your C code just create one array of 60-70 character
i.e. unsigned char a[60];
2. create one other array
i.e. unsigned char test[2]=”OK”;
3. now just add SBUF to a[60];
for(i=0;i<=1;i++)
{
a=SBUF;
}
4. and compare with test and send the o/p to any pin
for(i=0;i<=1;i++)
{
if(a=test);
{
P2=0xFF;
}
}
Hope you get some idea from it and also if any doubt then you can contact me also you can buy any electronics components and GSM module form me (GSM 300 is only 1150 Rs.)
project [dot] student123 [at] gmail [dot] com
Best luck
Regards
Jaymin D
-
AuthorPosts
- You must be logged in to reply to this topic.