I am just testing out a ESP8266 chip using a simple HTTP Request GET
I get a valid response but then I get corruption after about 60 characters.
At this point I am not sure of where the corruption is coming from? I am running from the Arduino Mega 3.3v line which may not be enough to drive the module properly or the corruption is because the serial buffer is full?
GET /HOME/TEST?x=741049 HTTP/1.0
Host: 192.168.2.124
This responds with
HTTP/1.1 200 OK
Cache-Control: private
Content-Type: text/html; charset=uet-e
r0rNr0 t
g
Y
atwnv/ll
0pd>
Notice the response is good http response but failed around the charset=
The device is running firmware: 00160901 using the command AT+GMR
So this is not the latest firmware
I am hesitant to upgrade the firmware as some people seem to have an almost bricked device after upgrading to .992 where the device does not respond and may be a CR/LF issue or something else.
I found that the main serial port I was using was at 9600 and the ESP8266 at 115200
I am using an arduino Mega 2560
So 9600/115200 - this seemed to be an issue.
The 9600 is 12 times slower than 115200, so this seemed to be an issue as I found when increasing the port speed it read more data..
I increased the speed of the 9600 port to 57600 and got more valid text but still some problems. I found that I could not get 115200 - everytime I restarted the script it would fail to connect to the wifi module.
So I changed from using the ESP8266 on Serial1 to Serial2 (Mega has 4 hardware serial)
This seems to fix things a lot.
I have not upgraded the firmware yet on the ESP8266 which allows you to use different serial speeds.
Upgrade the ESP8266 firmware to V0.922
Follow directions from here
With the new firmware the default baud rate is 9600, you can change it with AT+CIOBAUD=57600 or whatever rate you want. I find 57600 to be stable.
Use a 3.3v regulator with a 1000uF or greater cap on the output to power the ESP8266, do not power it from the Mega 3.3V pin
Connect the ESP8266 RST and CH_PD pins to 3.3V
On the ESP8266 module connect a 10uf cap from VCC to GND
You must use a level shifter like the CD4050BE for the RX TX lines, they will not work correctly with 5V.
That will get your ESP8266 module setup correctly.