Hi, I have a GM862-GPS Module and I’m trying to do GET Requests. Well, when I run a code from the hyperterminal, my code reachs the GET correctly and gives me the correct feedback (HTTP 200)
In initial setup set flow control to none: MDM.send("AT&K0r").
Please post your communications log, including how and what you read after GET.
The many rn is because the socket actually connects,
"a = SER.send("opening skt") res = MDM.send(‘AT#SKTOPr’,0) res = MDM.receive(200) a = SER.send(res)"
what shows in the hyperterminal…
"opening skt
CONNECT"
but I don’t know why, apparently the GET request is not being sent – because I don’t receive any feedback as an 404 or 200 or anything and then the connection closes after a while -, even with the GET request that you showed.
I’m thinking the problem is in the line feed ( "n").
is there anyway to change the line feed caracter?
If you have an working example code, can you provide me?
Please follow the suggestions I wrote, AT&K0, a more complete HTTP request and only 2 pairs of final rn.
The example is in "Easy GPRS User Guide" document.
You will never believe what was the problem in fact
I forgot the " res = MDM.receive(100)"
in the end of the code, looks like it actually really sends when I call the MDM.receive method
I followed your suggestions too for an optimized code, but both codes worked 😀
Thanks a lot, I was getting worried 😀
This was indeed missed in the code you quoted here, but I thought it was only a copy-paste issue … at least you’ll have a serene weekend and Happy Easter
We use cookies to enhance your browsing experience and help us improve our websites. To improve our website, we carefully select third parties that use cookies to allow us to serve specific content and achieve the purposes set out in our cookie policy. For more information on how to make adjustments through your browser to the cookies being used on your device, please click Find Out More link. By closing this banner or continuing to browse our website, you agree to our use of such cookies. FIND OUT MORE
Hi, I have a GM862-GPS Module and I’m trying to do GET Requests. Well, when I run a code from the hyperterminal, my code reachs the GET correctly and gives me the correct feedback (HTTP 200)
"
AT#SKTSET=0,80,"www.geuniversitario.com"
AT#SKTOP
GET http://www.geuniversitario.com/posicoes.php?posicao=61&batidas=61 HTTP /1.1
"
But When I run the same code from the Python Script, It actually does not work
"
import MDM
import SER
res = MDM.send(‘AT+CGDCONT=1,"IP","tim.br"r’,0)
a = SER.send("register user")
res = MDM.send(‘AT#USERID="tim"r’,0)
res = MDM.receive(200)
a = SER.send(res)
a = SER.send("register passw")
res = MDM.send(‘AT#PASSW="tim"r’,0)
res = MDM.receive(200)
a = SER.send(res)
a = SER.send("register skt")
res = MDM.send(‘AT#SKTSET=0,80,"www.geuniversitario.com"r’,0)
res = MDM.receive(200)
a = SER.send(res)
a = SER.send("opening skt")
res = MDM.send(‘AT#SKTOPr’,0)
res = MDM.receive(100)
while (res.find(‘CONNECT’) == -1):
res = MDM.receive(100)
a = SER.send("finding connect")
a = SER.send("found connect")
res = MDM.send(‘GET http://www.geuniversitario.com/posicoes.php?posicao=61&batidas=61 HTTP /1.1rn’,0)
res = MDM.send(‘rnrnrnrnrnrn’,0)
"
All my feedback works correctly in the python script, but after sending a GET request, I don’t have an answer.
thanks,
Andre Mariano
Why so many rn? Two pairs are enough, and the GET should look like below:
MDM.send(‘GET /posicoes.php?posicao=61&batidas=61 HTTP /1.1rnrn’,0)
In initial setup set flow control to none: MDM.send("AT&K0r").
Please post your communications log, including how and what you read after GET.
The many rn is because the socket actually connects,
"a = SER.send("opening skt")
res = MDM.send(‘AT#SKTOPr’,0)
res = MDM.receive(200)
a = SER.send(res)"
what shows in the hyperterminal…
"opening skt
CONNECT"
but I don’t know why, apparently the GET request is not being sent – because I don’t receive any feedback as an 404 or 200 or anything and then the connection closes after a while -, even with the GET request that you showed.
I’m thinking the problem is in the line feed ( "n").
is there anyway to change the line feed caracter?
If you have an working example code, can you provide me?
Please follow the suggestions I wrote, AT&K0, a more complete HTTP request and only 2 pairs of final rn.
The example is in "Easy GPRS User Guide" document.
You will never believe what was the problem in fact
I forgot the " res = MDM.receive(100)"
in the end of the code, looks like it actually really sends when I call the MDM.receive method
I followed your suggestions too for an optimized code, but both codes worked 😀
Thanks a lot, I was getting worried 😀
This was indeed missed in the code you quoted here, but I thought it was only a copy-paste issue … at least you’ll have a serene weekend and Happy Easter
ahahah for sure, Happy Easter to you to!