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.

microcontroller and gprs module interface problem

Status
Not open for further replies.

fireball003

Full Member level 3
Joined
Oct 28, 2005
Messages
181
Helped
8
Reputation
16
Reaction score
3
Trophy points
1,298
Activity points
3,157
at#sktd

Hi,
I am interfacing microcontroller with GPRS modem. I have DS89C450 MCU and GM862-GPS module.

I did the following-
1. Program MCU to send AT command using UART (printf) and receive the response using scanf function.
2. Test the code using PC terminal and it was working fine.
3. Connect the serial cable from MCU to gprs modem serial port.
4. reset the MCu to send the AT command to GPRS module.

But I got no response from the GPRS module. Did I miss anything? Do I need extra initialisation? Or anything else? Can't I connect GPRS module and MCU using serial port?

My simple code to send AT command is (Keil c51) -
Code:
#include "DS89C4XX.h"
#include "stdio.h"

void main()
{

	char c;
 	char aa[40];
	int i=0;
/**********Serial port initialization**************************/
    SCON0  = 0x50;		        /* SCON: mode 1, 8-bit UART, enable rcvr      */
    TMOD |= 0x20;               /* TMOD: timer 1, mode 2, 8-bit reload        */
    TH1   = 252;                /* TH1:  reload value for 14400 baud @ 22.1184MHz   */
    TR1   = 1;                  /* TR1:  timer 1 run                          */
    TI_0    = 1;                  /* TI:   set TI to send first char of UART    */

/************End of serial port initialization****************/
			
	P1 = 0x0F;                   //to see if the LEDs blink conencted to P1 port
	msdelay(20000);
	P1 = 0xF0;                  //to see if the LEDs blink conencted to P1 port
	msdelay(20000);
/*Printing string in LCD before sending command to GPRS module*/
                printchar(0,0, "Sending AT command");

/*Sending AT command using serial port*/
	printf("AT\n");

/*Waiting for the response*/
	scanf("%s", &aa);

/*There is a LCD to show the result. I deleted the LCD codes for simplicity
   The LCD was showing outptu when conencted to PC terminal.
But it was not showing the output when conencted to GPRS module.*/
                printchar(0,0, aa);
	while(1);
}

Please suggest me.
Thanks in advance.
 

mdm.send

I hope you aware that RS232 and UART on microcontroller uses different voltage levels?

Also, check RTS/CTS lines and baudrate.
 

gprs microcontroller

Hi,
Thanks a lot for your reply.

1. I have checked baud rate and set it to 9600 in which the gprs module works fine. So, in my code TH1 = 250 (9600 baud) instead of 252 (14400 baud)

2. My MCU is connected to Maxim MAX233ACWP. On the other hand my gprs module has MAX3232 level converter. I am using the cable I was using to connect to the PC + a DB9 Male to Male gender converter.

What is the problem? Is the problem in set up? Should I connect the module directly to the MCU evaluation board RS232 connector?

Please suggest me.
 

gprs internet microcontroller

Why don't you just use python? You can control GPRS and GPS using Python without external devices... Saving you time and money.
 

microcontroller to gprs

Hi,
Thanks for your reply.

In fact I started using python. But I don't have any python debugger. So, when I was writing complex codes then I got into trouble. The modules were not running and I was unable to find out why they are not responding.

IS there any simulator or software debugger for python? How to debug or understand the problem of the code?

For example the following code is to connect in gprs and send gps data to the specific server. But I was unable to run that. And also failed to debug that code manually. Please have a look at that and suggest me what may go wrong-

Code:
import MDM
import MOD

ip='IP'
apn = 'internet'
server = '0.0.0.0'
MDM.send('AT+CGDCONT=1,'+ip+','+apn+','+server+'\r',0)
res = MDM.receive(20)
print res
username = 'whatever'
password = 'whatever'
MDM.send('AT#USERID='+username+'\r',0)
res = MDM.receive(20)
print res
MDM.send('AT#PASSW='+password+'\r',0)
res = MDM.receive(20)
print res


MDM.send("AT#GPRS=1\r",0)
res = MDM.receive(80)
print res

MDM.send('AT$GPSACP\r',0)
gps = 'This is GPS data:'+MDM.receive(30)
gps = gps.replace(' ','')
gps = gps.replace('\r','') # This is to remove unwanted characters
gps = gps.replace('\n','') # from the gps output.
gps = gps.replace('OK','')
print gps

web = 'www.e-secretary.net'
MDM.send('AT#SKTD=0,80,'+web+'\r',0)
res = MDM.receive(50)
print res

req1 = 'GET /gps/dgl.php?name='+gps+' HTTP/1.0'
req2 = 'Host: '+web
req3 = 'Connection: keep-alive'
MDM.send(req1,0)
MDM.sendbyte(0x0d,0)
MDM.sendbyte(0x0a,0)
res = MDM.receive(10)
MDM.send(req2,0)
MDM.sendbyte(0x0d,0)
MDM.sendbyte(0x0a,0)
res = MDM.receive(10)
MDM.send(req3,0)
MDM.sendbyte(0x0d,0)
MDM.sendbyte(0x0a,0)
MDM.sendbyte(0x0d,0)
MDM.sendbyte(0x0a,0)
res = MDM.receive(100)
print res

As you can see there is no action according to response in this code. All the parts (like connecting to internet , sending data tot he server successfully etc) works fine when I send manual AT commands.

Please suggest me easy debugging python scripts in module.

Now on the other hand I can see the input and output of MCU in LCD and debug the program as required. So, I want to use external controller, unless I find out easy way to program in python.
 

python gprs

hi,
Please someone help me to solve this problem.
 

gprs module interface

I used the serial port to send strings. I was able to see on the computer screen where the system got stuck or where wrong results were obtained. You can use HyperTerminal to see the output or use other software for Tellit freely available on the internet.

Good Luck
 

gm862-gps problem gpsacp

Hi fireball003,

I have the same problem with you. I use GM862-GPS. As what you experienced, I can use PC serial port to connect GPRS of the GM862-GPS. However, when I use MCU, I cannot connect the GPRS of GM862-GPS, although the serial communication line is okay.

I use only three wire of PC serial cable: GND, RX and TX. Everything is okay, I still can connect the GPRS. I conclude that hardware flow control (RTS-CTS) is not required. However, it is still not working when I use MCU. I am starting to think that it is a power supply problem.

Did you find the solution, already? If yes, would you kindly share me the solution, please....
 

interface gps module with mcu

eso está muy bien
 

connect gm862 to computer

Hi
I'm a new member. I'm also facing same problem i.e. communication between GPRS modem and microcontroller.
My controller is ATMega8. Please share the solution if anybody has.
Any help wil be appreciated
 

pdf:gprs interface with microcontroller

We solve the connect problem.

To get connected with GPRS easily, use the best GSM operator in your area. The operator price is more expensive, but it is okay with their satisfying service.

Now, we have new problem. The GM862 cannot register to the network. AT+CREG? always result with +CREG: 0,2 which means fail to register. It happened suddently.... Is the module broken?
 

do u solve this problem i need ur code , because i also do a same project like u i also facing problem how to write a assembly or c program into 8051 ic .
 

@Keanhong2: yes, we solve the problem. you need slow operation (good timing/delay) when working with GSM module.
 


yes this project i did sucessful this page very helpful to me.i please to say that my friend won final project with 2nd place,i very happay i found a solution here.
 
  • Like
Reactions: Mr.LAW

    Mr.LAW

    Points: 2
    Helpful Answer Positive Rating
Congratulations keanhong2 :)

For those interrested, here is the schematic that I used to develop a specific device with Telit GM-862GPS module mounted on EasyGSM/GPRS GM862
 

Attachments

  • Telit 862-GPS.pdf
    28.4 KB · Views: 138
  • Like
Reactions: gunta

    gunta

    Points: 2
    Helpful Answer Positive Rating
can u plz tell me how u interface gprs module with microcontroller and is ur module support tcp/ip protocol set...?
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top