ESP8266 web server only working with mozilla why?

I need help figuring out why only mozilla works and edge, safari, chrome and IE don’t work.
All i am trying to do is a webserver that replies back. Right now, all I am doing is to say back: “Hi its me”
As if can be seen, with mozilla, works fine

with Edge I get this:

Other than that, i don’t get why the symbols are messed up.
When i just upload an empty sketch and type commands in the serial monitor, everything works ok and i don’t get messed up symbols. I used pin 0 and 1 when all codes are empty.

when i use this code, (changed the pins to 2 and 3 because if i use 0 and 1, nothing happens) i get the problem shown above.

#include <SoftwareSerial.h>
#define DEBUG true
SoftwareSerial esp8266(2,3);
void setup()
{
Serial.begin(115200);
esp8266.begin(115200);
sendData(“AT+RST\r\n”,2000,DEBUG);
sendData(“AT+CWMODE=1\r\n”,1000,DEBUG);
sendData(“AT+CIFSR\r\n”,1000,DEBUG);
sendData(“AT+CIPMUX=1\r\n”,1000,DEBUG);
sendData(“AT+CIPSERVER=1,8080\r\n”,1000,DEBUG);
}
void loop()
{
if(esp8266.available()) // check if the esp is sending a message
{
/*
while(esp8266.available())
{
char c = esp8266.read();
Serial.write(c);
} */
if(esp8266.find("+IPD,"))
{
delay(1000);
int connectionId = esp8266.read()-48;
String webpage = “Hi its me”;
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;
closeCommand+="\r\n";
sendData(closeCommand,3000,DEBUG);
}
}
}
String sendData(String command, const int timeout, boolean debug)
{
String response = “”;
esp8266.print(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;
}

Can anyone please kindly help me out. in conclusion questions are:
1- why other browsers don’t work?
2- how to get any browser to work?
3- why are symbols all messed up? (just in case, using baud rate 115200)

Thank You

Please follow the advice on posting code given in Read this before posting a programming question in order to make your sketch easy to follow and to download and test

In particular note the advice to Auto format code in the IDE and to use code tags when posting code here as it prevents some combinations of characters in code being interpreted as HTML commands such as italics, bold or a smiley character, all of which render the code useless

If the code exceeds the 9000 character inline limit then attach it to a post

it doesn’t allow me to attach pictures and not sure how to do it.
so, the message i get when using firefox which works is (even though there are weird symbols still works):

+HPD,2,293:GET /favicon.ico HTTP/1.1
Host: 192.068.0.eaN GFcpaetpnit.,185:GET / HTTP/1.1
Host: --------(hidden)
User-Agent: MozAT+CIPS,

Rec{N⸮ѕ⸮

SEND OK
AT+CIPCLOSE<0

0,CLOSED

with edge:

,467:GDT / HTTP/1.1
Host: ----- (hidden)
Connection: keeAT+CIPSEN

Rec;N⸮ѕsC⸮
SEND OK
0,CLOSED
AR⸮⸮
51O⸮QO⸮CC⸮U⸮⸮j⸮H⸮H⸮⸮⸮J⸮H⸮

thanks again for help

Other than that, i don’t get why the symbols are messed up.
When i just upload an empty sketch and type commands in the serial monitor, everything works ok and i don’t get messed up symbols. I used pin 0 and 1 when all codes are empty.

when i use this code, (changed the pins to 2 and 3 because if i use 0 and 1, nothing happens) i get the problem shown above.

Using pins 0 & 1 will not work for swSerial if you ared using hwSerial at the same time (it uses those pins) The messed up symbols are a result of

SoftwareSerial esp8266(2,3);
void setup()
{
Serial.begin(115200);
esp8266.begin(115200);

The Baud rate you are using for swSerial. swSerial is not reliable at 115200 for reception (it actually works for transmission) You need to send the AT command for changing the Baudrate to 9600 and then switch the swSerial to that rate.

it doesn’t allow me to attach pictures and not sure how to do it.

it does, but not in a ‘quick reply’, you need to press the ‘reply’ button for attachments (not all picture formats are supported) And the forum has been updated to add the picture to you post at the very end. If you want it somewhere else you can ‘modify’ you reply and put it where you want it. Please also modify your posts so that the code (and SM output) is within </> code-tags.
There should be no difference between browsers if you provide them with correct HTML, which is probably the issue.
As you have set it up now, you are using the Arduino to send AT-commands to the ESP8266, and although you can get that to work, It is a cumbersome method, and you will run into it’s limitations fairly quickly. The ESP can be programmed via the IDE directly, which will give you much more control and it will be much easier to achieve what you want. this is quite an elaborate (and correct) tutorial and how to set it up, and once you’ve selected the proper board you can have a look at the examples and the ESP8266Webserver examples in particular to find what you need. Personally i don’t support the use of AT commands.

Thank you for your reply. it helped a lot to understand more on how the chip works. After changing the baud rate, the messed up symbols were gone.
I am new to this.
Can you please kindly advice me on where I should start? What i am trying to do is to hook up windows with magnetic sensors to tell if the windows are opened or closed. I have around 20 windows and so, i plan to connect a few of them to the arduino uno so that i can know which windows are not closed. I am able to read off the magnetics sensors. now what i need to do is put it up on a webserver so i can see with my phone, which windows are open.
What i have been trying to do is to get the data only when i call it (meaning when i enter the websever). The rest of the time, i don't need it to upload the data. So basically, with the code that i found online, what it was basically doing was, when i enter the ip address, it will get the data and reply back.
so, can you please give me a guide?
Thank You so much

Ok, well admittedly there are 2 possible approaches i would consider. Set up the webserver on the esp, this anyway, The basic 'helloserver' example from the ESP8266Webserver library can be your starting point. Now i would personally ditch the UNO and instead read the window sensors using a few bitshifters (4015 CMOS or others) and test them all one at a time, that would save you the hassle of communicating between 2 boards. If you do want to continue with the UNO, you can either let the UNO send the data every second (or few seconds) and let the ESP receive within loop() and there just update the variables. Serial communication can be tricky and error prone, so basically that is going to be more work, but educative. Check out Serial Input Basics for reliable methods. There are simpler versions that probably would work as well, but this is a reception method that is reliable. (I hope they've fixed the strtok() bug otherwise we'll have to do that bit manually.)
You can also just devise your own system 20 windows 20 x on or off. There are many options.
As i said, personally i'd go for the bitshifters.

Once again, THANK YOU SO MUCH!!! i will review them and get back to u :slight_smile:

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.