Http request with A6 module

Hi, I am using ai thinker A6 module and have to send http GET or POST request with it. I can successfully connect to gprs network but i don't know how to request server with it; when i use commands such as "httpinit" it have "error 58" while there is no souch error in AT commands guide!

Does anyone worked in this subject with A6?

The AT Command Set manual (http://www.electrodragon.com/w/File:A6_AT_commands.zip) doesn't show any "at+httpinit" command.

johnwasser: The AT Command Set manual (http://www.electrodragon.com/w/File:A6_AT_commands.zip) doesn't show any "at+httpinit" command.

This is my problem! :D There isn't any http command in A6 manual...

In this link there is a code that use "httpinit" for A6 module but does not work for me...

Perhaps there is a firmware update for the A6 module that adds HTTp support.

The example sketch uses all of these commands before the HTTPINIT. Have you done that too?

AT+CSQ
AT+CGATT?
AT+SAPBR=3,1,"CONTYPE","GPRS"
AT+SAPBR=3,1,"APN","CMNET"
AT+SAPBR=1,1

johnwasser: Perhaps there is a firmware update for the A6 module that adds HTTp support.

The example sketch uses all of these commands before the HTTPINIT. Have you done that too?

AT+CSQ
AT+CGATT?
AT+SAPBR=3,1,"CONTYPE","GPRS"
AT+SAPBR=3,1,"APN","CMNET"
AT+SAPBR=1,1

There isn't AT+SAPBR support too :|

Is there a way to query the installed firmware version? Does the manufacturer provide a way to update the firmware?

johnwasser: Is there a way to query the installed firmware version? Does the manufacturer provide a way to update the firmware?

ATI

Ai Thinker Co.LTD A6 V03.02.20160605005H03

OK

I searched the manufacturers website for any indication of updated firmware. No luck. They have added an A6C module which supports a camera and A7 which adds GPS. The A6/A6C/A7 product description has no mention of HTTP.

The latest AT Command Set manual, direct from the manufacturer:
http://wiki.ai-thinker.com/lib/exe/fetch.php/modules/datasheet/a6/ai-thinker_a6_a7_a6c_at_v1.02.pdf

Still no mention of http commands.

It may not work in your version, with lot of difficulty i came to know from ai thinker developer that http post support has been added recently, specifically from V3.03.201609105H3 onward.. they have shared the firmware file with me,, I can share the file with you and may be you can try on this version.. I dont know how to flash the A6 with .lod file thought..

please do share your results

I do my HTTP this way :
AT+CSQ
if signal is less than 21 my gprs does not work :frowning:
AT+CGATT=1

OK
AT+CIPSTART=“TCP”,“mujkotel.wz.cz”,80 (my test page)

CONNECT OK (answer from module )

OK (answer from module )
at+cipsend

GET /index.html HTTP/1.1
Host: mujkotel.wz.cz
(two empty)
(lines. New line must be in CR/LF format )
\0x1a (hex number 0x1A)
OK

Then little delay and get result like this :

OK

+CIPRCV:1320,HTTP/1.1 200 OK
Server: nginx
Content-Type: text/html
ETag: “251-53d6fee877c82”
Accept-Ranges: bytes
Vary: Accept-Encoding
Age: 126
Date: Sun, 02 Oct 2016 22:26:41 GMT
Last-Modified: Mon, 26 Sep 2016 21:37:16 GMT
Transfer-Encoding: chunked

440
<!doctype html>

Login

Login …

\0x00+CIPRCV:32,.

It needs little filtering, but it is usable. The HTTP protocol is simple.
This can help:

http://www.the-art-of-web.com/system/telnet-http11/

Hey, if you still need help with the HTTP Post issue:

http://forum.arduino.cc/index.php?topic=428651

I created a library for that.

Good Luck! Tobias

TobiasKoops: Hey, if you still need help with the HTTP Post issue:

http://forum.arduino.cc/index.php?topic=428651

I created a library for that.

Good Luck! Tobias

Dear TobiasKoops

I successfully tested your library. It was a success. Congratulations. I have difficulty reading the return from the myA6.HttpPost (body) command. How would you do that? ** Sorry for my English. I'm using google translator** Jose Roberto

Any luck with flashing new firmware? It can be very helpful

dzień dobry/Hi,

Mam Arduino UNO i moduł A6 GSM/GPRS.
I have a Arduino UNO and module A6 GSM/GPRS.

#include <SoftwareSerial.h>
SoftwareSerial GSM(3,2);

void setup() {
GSM.begin(9600);
Serial.begin(9600);

Serial.println(“Start…”);

GSM.println(“AT+CSQ”);
updateSerial();
GSM.println(“AT+CGATT=1”);
updateSerial();
GSM.println(“AT+CIPSTART=“TCP”,“testgolang.cba.pl”,80”);
updateSerial();
delay(5000);
GSM.println(“at+cipsend”);
updateSerial();
GSM.println(“GET http://www.testgolang.cba.pl/index.php?a=ok HTTP/1.1”);
updateSerial();
delay(5000);
// GSM.println("");
updateSerial();
// GSM.println("");
updateSerial();
// GSM.println("");
// updateSerial();
// GSM.println("");
// updateSerial();
}

void loop() {
updateSerial();

}

void updateSerial(){
delay(2000);
while(Serial.available())
GSM.write(Serial.read());

while(GSM.available())
Serial.write(GSM.read());
}

<?php $timestamp = date("d-m-Y - H:i:s"); $datastring = $_REQUEST["a"]; $myfile = fopen("newfile.txt", "a") or die("Unable to open file!"); $txt = $timestamp . " - ".$datastring."\n"; fwrite($myfile, $txt); fclose($myfile); echo $txt; ?>

Gdy program dochodzi do lini z kodem “GET http://www.testgolang.cba.pl/index.php?a=ok HTTP/1.1”, to czeka i czeka pojawia się odpowiedz w postaci:
I have error with Request GET on my webpage. I don’t know what should I do.

13:41:33.619 → AT+CIPSTART=“TCP”,“testgolang.cba.pl”,80
13:41:33.655 → ⸮
13:41:40.644 → CONNECT OK
13:41:40.644 →
13:41:40.644 → OK
13:41:40.644 → at+cipsend
13:41:40.644 →
13:41:40.644 → > GET http://www.testgolang.cba.pl/index.php?a=ok HTTP/1.1
13:41:55.691 →
13:41:55.691 → +TCPCLOSED:0
13:41:57.710 →
13:41:57.710 → OK
13:41:57.710 → ⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮⸮
13:43:57.101 → OK

Proszę o pomoc.
pls. help me.

I have similar problem with my php server;

After GET request to the server, receiving only a part of response header with 200 code but can not get body of server response.

+CIPRCV:311,HTTP/1.1 200 Server: nginx/1.16.0 Date: Mon, 06 ja

How can I retrieve body response of the server?