GM862 GPS Subsequent HTTP request returns 'No Carrier'

Hi, I am going to report the GPS location received by GM862 back to main server through GPRS connection.

  for:
        str_to_send = 'GET /log.php?' + data + ' HTTP/1.1'
        MDM.send( str_to_send + '\r\n', 10)    
            
        str_to_send = 'Host: ' + self.REMOTE_SERVER
         MDM.send( str_to_send + '\r\n', 10)  

         MDM.send( '\r\n', 10)  
         res = MDM.receive(200)

in the first loop the about code works perfectly and it has response from the server, but in the second time, it failed with “No Carrier”. It seems to me that the socket connection I established could only allow me to send ONE request.

I tried to do MDM.getDCD() , I found the getDCD() turns to 0 soon after the first response from server.

Many thanks.

By the way fsplash,

You are doing it wrong. The least thing that I can tell you, is when sending data using the GET method, you need to put a variable name after the question mark ‘?’. But here you are not putting anything.

I will soon post an article on my blog to show how to connect the module to an internet page, and send/receiving data to/from any type of database

link: http://www.embed21.com

I am sorry that I forgot to post it here

data= 'lat=' + str(info[1]) + '&long=' + str(info[2])

Thank you very much

In the first loop

there is response from the server,

HTTP/1.1 200 OK
Date: Fri, 15 Jan 2010 16:50:26 GMT
Server: Apache/2.2.14 (Win32) ...
K-Powered-By: PHP/5.3.1
Content-Length: 0
Content-Type: text/html

Basically the connection was established using

 MDM.send( 'AT+CGDCONT=1,"IP",' + self.MOBILE_NETWORK + '\r',  2)  

 MDM.send('AT#GPRS=0\r', 2)


 MDM.send('AT#GPRS=1\r', 2)

 MDM.send('AT#SKTD=0,80'  + ',' + self.REMOTE_SERVER+ '\r', TIMEOUT_MDM_WAIT)

fsplash:
It seems to me that the socket connection I established could only allow me to send ONE request.

That is not true, sockets can handle more than one request. But here is what I call tell you. Are you putting any kind of delays in the code or not? Try to put a delay after each response from the server. So start the delay with 5 seconds. If you get the right response then decrease the delay. It basically depend on the network provider. For me, I added a 300mSec and it works fine

res = MDM.receive(200)
//ADD A DELAY Start with 5 Sec and decrease it.

if you need help email me at: khaled.raed@embed21.com

Best of luck!

It may be that the server is closing the connection after it sends the response. Try adding the the line “Connection: Keep-Alive”.

Thank you everyone. It turns out to be the problem of the portable apache server.

When I try using Java EE Web server, it has no problem at all.