Lopuch
Lopuch

Reputation: 784

SIM808: Cancel a HTTP request by AT-command

When I send a HTTP request (AT+HTTPACTION=0) with my SIM808 it sometimes does not response with +HTTPACTION: 0,200,2. My goal is to check whether the SIM808 is still waiting for the response or is ready to send another one. Another solution would be to cancel and forgot the request. I don't care if the data wont reach the server (I'm sending them every 15 seconds).

I don't want to check error code 604 (STACK BUSSY) hence it could bring errors into my code.

Now I wait 200 seconds (long enough to TCP/IP timeout) if the +HTTPACTION: 0,200,2 didn't come and after that I send another one request.

Summary:

How to cancel HTTP request

or How to check wheter the SIM808 is still waiting for the response.

Many thanks :-)

Upvotes: 0

Views: 600

Answers (1)

Masoud
Masoud

Reputation: 21

By default SIM800C waits for 120 seconds of TIMEOUT. Using the following command you can change TIMEOUT to 30 seconds. Note that 30 seconds is the minimum:

AT+HTTPPARA="TIMEOUT","30"

Although it does not solve your problem completely, however reducing TIMEOUT allow your code execution to be faster.

Regards. Masoud.

Upvotes: 1

Related Questions