NodeMCU, Problem with creating server
Posted: Sat May 27, 2017 11:05 am
Hello,
since I have updated firmware (using https://nodemcu-build.com/ ) from: 0.9.6-dev_20150704 release to newer, the following code (from nodemcu.com) stopped working:
To be clear, it seems that connection work (beacuse I see MCU on the list on my router), but when I type the corresponding address of MCU in the browser, it could not connect to server. Do you have any ideas, how to fix it?
Kind regards
Czarek
since I have updated firmware (using https://nodemcu-build.com/ ) from: 0.9.6-dev_20150704 release to newer, the following code (from nodemcu.com) stopped working:
Code: Select all
print(wifi.sta.getip())
--nil
wifi.setmode(wifi.STATION)
wifi.sta.config("SSID","password")
print(wifi.sta.getip())
--192.168.18.110
-- a simple http server
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)
To be clear, it seems that connection work (beacuse I see MCU on the list on my router), but when I type the corresponding address of MCU in the browser, it could not connect to server. Do you have any ideas, how to fix it?
Kind regards
Czarek