prodx
prodx

Reputation: 109

How to use SIM800's AT+HTTPHEAD

I want to set the Real Time Clock on my STM32F4 board that I use with a SIM800 modem. I try to send HTTP GET or HEAD request (for example to "google.com") and use the timestamp in the response header to set my RTC.

I can send the request and get the response but I can't read the response's header.

The code is use and the response:

AT+HTTPINIT
OK

AT+HTTPPARA="CID",1
OK

AT+HTTPPARA="URL","www.google.com"
OK

AT+HTTPACTION=0
OK
+HTTPACTION: 0,302,256

AT+HTTPHEAD
ERROR

Why I got the ERROR at the end? I tried to send request to another URL, in this case I get HTTP OK(200) and can read data but still can't the header.

Upvotes: 2

Views: 1821

Answers (2)

Obad
Obad

Reputation: 41

+HTTPACTION: 0,302,256, 302 error is Found. Check Mobile Balance or Internet Package in your sim. It happens when you are out of Balance.

Upvotes: 0

Alex
Alex

Reputation: 26

AT+HTTPHEAD doesn't work in sim800C. It works in: SIM800H,SIM800L,SIM800,SIM800G. Read "AT Command Manual" -

Only Part of Projects Support Following AT Commands.

Upvotes: 1

Related Questions