Skip to content

Instantly share code, notes, and snippets.

@sloev
Last active August 29, 2015 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sloev/9b472b81fac002327527 to your computer and use it in GitHub Desktop.
Save sloev/9b472b81fac002327527 to your computer and use it in GitHub Desktop.
print(wifi.sta.getip())
wifi.setmode(wifi.STATION)
wifi.sta.config("Loppen Public","")
print(wifi.sta.getip())
s=net.createServer(net.TCP,180)
s:listen(2323,function(c)
function s_output(str)
if(c~=nil)
then c:send(str)
end
end
node.output(s_output, 0)
c:on("receive",function(c,l)
node.input(l)
end)
c:on("disconnection",function(c)
node.output(nil)
end)
print("Welcome to NodeMcu world.")
end)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment