I am using GPRS GSM A6 with arduino uno to post data to web server. After sending AT commands to module I get OK response after every command,
AT+CIPMUX=0
OK
AT+CGATT=1
OK
AT+CSTT="internet","",""
OK
AT+CIICR
OK
AT+CIFSR
10.65.87.210
OK
AT+CIPSTART="TCP","xxx.xxx.xxx.xxx", 80
CONNECT OK
OK
AT+CIPSEND
> POST http://xxx.xxx.xxx.xxx/Code/ HTTP/1.1
Host: xxx.xxx.xxx.xxx
Content-Type: application/x-www-form-urlencoded
Content-Length: 18
Data=GPS Data Sent
AT+CIPCLOSE
>
To terminate AT+CIPSEND you have to send CTRL-Z. I am sending CTRL-Z using this statement in code,
Serial.write(0x1A)
But the module doesnot respond to this, and treats the next command (AT+CIPCLOSE) as data.
Please Help... Thanks in Advance!!!
-
Also just so you know x-www-form-urlencoded requires + instead of spaces and any non-alphanumeric characters must be percent encoded en.wikipedia.org/wiki/Percent-encodingjdwolf– jdwolf2018年01月10日 02:44:53 +00:00Commented Jan 10, 2018 at 2:44
3 Answers 3
RTFM: https://github.com/espressif/esp8266_at/wiki/CIPSEND
You need to close the input steam with "+++" to return to command mode.
To terminate AT + CIPSEND just apply the next command:
Serial.write(26);
or
gsm.write(26);
where gsm is the UART channel of gsm module.
You can use AT+CIPSEND= instead of AT+CIPSEND