Seeed-Studio / GPRS_SIM900

library for GPRS shield with sim900 module.
MIT License
138 stars 96 forks source link

Native http support #40

Closed chindro closed 5 years ago

chindro commented 5 years ago

these commits add functions that directly use the built-in HTTP functions of the SIM8/900 module, for now only HTTP GET is supported, maybe I will add POST in the future. Some of the commit messages are quite lengthy and provide some additional information.

chindro commented 5 years ago

are you going to merge it?

lanselambor commented 5 years ago

I failed to run the sample, do you know the reason? See below,

Initializing ...
OK
Check if network is registered...
Start HTTP demonstration, yeah!
if something is failing you may want to debug, check sim900.h

Initializing ...
OK
Check if network is registered...
OK
opening bearer ...
failed
lanselambor commented 5 years ago

@chindro I found three reasons caused the failure,

lanselambor commented 5 years ago

@chindro This pull request is nice, I will merge it first, and modified some code.

chindro commented 5 years ago

so, you will fix these issues the next days?

* **httpSendGetRequest**, the url content should not contain header **http://**

this is working for me. What device are you using? I'm using SIM800L.

lanselambor commented 5 years ago

@chindro I'm using SIM900, it's ok for containing header http://. I saw that if this sample were failed and return false, AT+HTTPINIT can only be executed once unless AT+HTTPTERM were executed. The same situation for AT+SAPBR=1,1 and AT+SAPBR=0,1. I suggest before opening bearer we get bearer status then decide whether to open bearer or not. And before initializing http terminating http first.