I have been having trouble connecting to my ESP-01 Wifi module running NodeMCU. I have set up a simple server, but whenever I try to connect to the IP Address via my browser, my browser times out.
I know I am making connection to the device because I can see the connection data being output from the module. However, the browser never connects to the device. I have been working on this for awhile with several code alterations and have been getting no luck. Here is the code I am running for the server (it comes straight from the NodeMCU documentation):
wifi.setmode(wifi.STATION)
wifi.sta.config("SSID","password")
wifi.sta.connect()
srv=net.createServer(net.TCP)
srv:listen(80,function(conn)
conn:on("receive",function(conn,payload)
print(payload)
conn:send("<h1> Hello, NodeMcu.</h1>")
end)
end)
Any help is greatly appreciated.