I have used the following code :-
print("Ready to start soft ap");
cfg={};
cfg.ssid="ESP8266";
cfg.pwd="myesp123";
wifi.ap.config(cfg);
cfg={}
cfg.ip="192.168.11.1";
cfg.netmask="255.255.255.0";
cfg.gateway="192.168.11.1";
wifi.ap.setip(cfg);
wifi.setmode(wifi.SOFTAP);
collectgarbage();
print("Soft AP started");
print("Heep:(bytes)"..node.heap());
print("MAC:"..wifi.ap.getmac());
print("IP:"..wifi.ap.getip());
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)
Kindly guide what is wrong I am doing?