Hey! I recently got an ESP8266 module and attempted to set it up using this tutorial. However, I have been unable to get it to work as intended.
The first part of the tutorial works fine, where he hooks up the ESP8266 directly to the RX and TX of the Arduino. I was able to use AT commands to communicate with the module and connect it to my WiFi network. However, when I tried the second part, which involves using SoftwareSerial to talk to the module to automatically initialize it and use it as a server, I get really garbled responses in the serial monitor. I am able to see the IP address of the module however, but every time I try to connect in my browser the connection times out. This is what I see in the serial monitor (obviously network details have been censored):
WIFI C�ʪ�(UTH�WICI GOT IP
A*��U�}1
�bu�^��rrj
OKC�AT+CIFSR
Aj��R�*�Hli%MI�
AIP,"{IP ADDRESS CENSORED}"
+CIFSR=APMAC,"{CENSORED}�C��%A�r�
�U5�����
j�AT+CIPMUX=1
A*�P�H�UՊj
�j�H�AT+CIPSERVER=1,80
AT��
5-IY�R=1�8�C�jդ�
And this is the code I am running. I slightly modified it for easier debugging but other than a couple Serial.print statements its the same as the tutorial:
#include <SoftwareSerial.h>
SoftwareSerial esp8266(10,11);
#define serialCommunicationSpeed 115200
#define DEBUG true
void setup()
{
Serial.begin(serialCommunicationSpeed);
Serial.println("Serial ok");
esp8266.begin(serialCommunicationSpeed);
InitWifiModule();
}
void loop()
{
if(esp8266.available())
{
if(esp8266.find("+IPD,"))
{
Serial.println("Request Recieved");
delay(1000);
int connectionId = esp8266.read()-48;
String webpage = "<h1>Hello World!</h1>";
String cipSend = "AT+CIPSEND=";
cipSend += connectionId;
cipSend += ",";
cipSend +=webpage.length();
cipSend +="\r\n";
sendData(cipSend,1000,DEBUG);
sendData(webpage,1000,DEBUG);
String closeCommand = "AT+CIPCLOSE=";
closeCommand+=connectionId; // append connection id
closeCommand+="\r\n";
sendData(closeCommand,3000,DEBUG);
}
}
}
String sendData(String command, const int timeout, boolean debug)
{
String response = "";
esp8266.print(command);
Serial.println(command);
long int time = millis();
while( (time+timeout) > millis())
{
while(esp8266.available())
{
char c = esp8266.read();
response+=c;
}
}
if(debug)
{
Serial.print(response);
}
return response;
}
void InitWifiModule()
{
sendData("AT+RST\r\n", 2000, DEBUG);
sendData("AT+CWJAP=\"{WIFI NETWORK CENSORED}\",\"{WIFI PASS CENSORED}\"\r\n", 2000, DEBUG);
delay (5000);
sendData("AT+CWMODE=1\r\n", 1500, DEBUG);
delay (5000);
sendData("AT+CIFSR\r\n", 1500, DEBUG);
delay (5000);
sendData("AT+CIPMUX=1\r\n", 1500, DEBUG);
delay (5000);
sendData("AT+CIPSERVER=1,80\r\n", 1500, DEBUG);
}
All wiring is the same as the tutorial. Any help would be much appreciated. Thank you.

