Re: Browser or server problem ?
Posted: Wed Mar 04, 2015 11:11 am
It's safari. It waits for something it never gets. What I have no idea.
I have to use Chrome.
I have to use Chrome.
-->
Open Community Forum for ESP8266, Come share Arduino and IoT (Internet of Things)
https://www.esp8266.com/
MK1888 wrote:Lesson #1 in troubleshooting: Start with the simplest configuration that works and then move up in complexity.
You have a bunch of things going on. Get a very simple webserver working first. Can you serve HTML to your Safari browser? Like this: <html><body><h1>blah</h1></body></html>
Then add things one at a time until it breaks.
EDIT: By the way...the HTML that you are producing in your last post is not valid. You can't start an HTML page with <font>.
wifi.ap.config({ssid="NODEDUINO",pwd=""})
wifi.setmode(wifi.SOFTAP)
if srv then
srv:close()
end
srv=net.createServer(net.TCP,30)
srv:listen(80,function(conn)
conn:on("receive",function(conn, payload)
print(payload)
if string.sub(payload, 1, 6) == 'GET / ' then
conn:send("HTTP/1.1 200 OK\r\n")
conn:send("<html><body><h1>ESP8266 Web Server</h1></body></html>")
end
end)
conn:on("sent",function(conn)
conn:close()
end)
end)