Page 1 of 2
New to ESP and HTML and something has gone terribly wrong
Posted:
Tue Feb 13, 2018 6:59 pm
by Bob_S
Using AT+ Commands and messages to control the ESP8266, I have been able to setup a simple test server. My Ethernet PC and wifi Notebook can both connect to the ESP and the ESP can send to the browsers (both Chrome and Edge).
My cell phone however (via my local Network) can send the ESP the GET message just fine but when the ESP sends the response to the cell phone, nothing happens on the phones browser. Can anyone tell me what I need to do differently to get the cell phone work . Thanks
Re: New to ESP and HTML and something has gone terribly wron
Posted:
Tue Feb 13, 2018 11:14 pm
by aledrus
Please include the html code and/or your ESP program code. The reason may be that Chrome and Edge are modern browsers and make certain assumptions like missing or incomplete tags are automatically filled in.
How do you know the cell phone can send the GET message fine? I assume you are monitoring it by the Serial Monitor?
Re: New to ESP and HTML and something has gone terribly wron
Posted:
Wed Feb 14, 2018 10:02 am
by Bob_S
Hi Aledrus,
I am using a serial port monitor (ESPs USART) for sending and receiving all ESP communications.
I can see the phones Get message on the monitor.
I also suspect I am not using the proper format/tags etc. as you mentioned.
What I am not sure about is 1) what is the minimum status response(s) needed and 2) how I format that response to the ESP using only the serial port.
I first setup the ESP as a server:
AT+RST
AT+CWMODE=1
AT+CIPMUX=1
AT+CIPSERVER=1,80
At this point I go to my browser and input the IP address of the ESP server.
The ESP receaves the Get request from both PC and Cell phone browsers. (good so far)
The following two text groups is then sent via the serial port formatted as shown:
AT+CIPSEND=0,194
<!DOCTYPE HTML><html><body><form action="EPI_code_1" method="post">Name: <input type="text" name="name"><br>E-mail: <input type="text" name="email"><br><input type="submit"></form></body></html>
At this point the PC will respond to the message but not the cell phone.
I have attempted many combinations and formats before sending the message including:
HTTP/1.1 200 OK
Content-Type: text/html
Content-length: 72
What I could use is a simple example message that is formatted for the serial port (using only AT+ Commands and text).
Thanks very much for your help.
Bob
Re: New to ESP and HTML and something has gone terribly wron
Posted:
Wed Feb 14, 2018 11:15 pm
by aledrus
I can't see anything wrong with your code that won't let it display on your mobile.
Can you try replacing this line:
<!DOCTYPE HTML><html><body><form action="EPI_code_1" method="post">Name: <input type="text" name="name"><br>E-mail: <input type="text" name="email"><br><input type="submit"></form></body></html>
with this temporarily just to test the mobile browser:
<html><b>Hello</b> World<html>
This is to isolate whether it is an html format problem, because if the ESP works from a desktop browser then the ESP works.