Advertisement
Guest User

Untitled

a guest
Apr 19th, 2015
353
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. print(wifi.sta.getip())
  2. wifi.setmode(wifi.STATION)
  3. wifi.sta.config("Loppen Public","")
  4. print(wifi.sta.getip())
  5.  
  6. s=net.createServer(net.TCP,180)
  7. s:listen(2323,function(c)
  8. function s_output(str)
  9. if(c~=nil)
  10. then c:send(str)
  11. end
  12. end
  13. node.output(s_output, 0)
  14.  
  15. c:on("receive",function(c,l)
  16. node.input(l)
  17. end)
  18. c:on("disconnection",function(c)
  19. node.output(nil)
  20. end)
  21. print("Welcome to NodeMcu world.")
  22. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement