Can't connect softap from android device
Posted: Tue May 26, 2015 5:45 am
I'm testing a simple webserver, and the esp is an open wifi spot.
The problem is, on my macbook and Samsung S5 it works fine most of the times.
But on a Motorola G and Samsung S3, a lot of it can't reach 192.168.4.1. Or it takes a long time to connect to wifi. I have to forget the network and reconnect.
I don't know if it is a LUA thing, but it's not working out of the box.
Note: I also tried with pwd. And remove the line:
And only run the line once.
Code: Select all
print("start my esp")
wifi.ap.config({ssid="hello esp"})
gps = ""
co = 0
-- http server
srv = nil
srv=net.createServer(net.TCP)
srv:listen(80,function(conn)
conn:on("receive",function(conn, payload)
print(payload)
conn:send("HTTP/1.1 200 OK\r\n")
conn:send("Connection:keep-alive\r\n")
conn:send("Cache-Control: private, no-store\r\n\r\n")
conn:send("<h1> Hello, I'm here</h1>")
end)
conn:on("sent", function(conn) conn:close() end)
end)
The problem is, on my macbook and Samsung S5 it works fine most of the times.
But on a Motorola G and Samsung S3, a lot of it can't reach 192.168.4.1. Or it takes a long time to connect to wifi. I have to forget the network and reconnect.
I don't know if it is a LUA thing, but it's not working out of the box.
Note: I also tried with pwd. And remove the line:
Code: Select all
wifi.ap.config({ssid="jaja"})
And only run the line once.