loboris / MICO

17 stars 12 forks source link

Socket creation error in AP mode - WiFiMCU #12

Open AugustoMo opened 7 years ago

AugustoMo commented 7 years ago

Hi Loboris, I'm having trouble creating a socket in AP mode. Follow my code

cfg={ssid = 'WiFiMCU_Wireless',pwd = ''}
wifi.startap(cfg)
cfg=nil
print(wifi.startap())
net.debug(1)
skt = net.new(net.TCP,net.SERVER) 
print(skt)
net.on(skt,"accept",function(clt,ip,port) 
print("accept ip:"..ip.." port:"..port.." clt:"..clt) 
net.send(clt,"HTTP/1.1 200 OK\r\nServer: WiFiMCU\r\nContent-Type:text/html\r\nContent-Length: 28\r\nConnection: close\r\n\r\n<h1>Welcome to WiFiMCU!</h1>")
end)
net.start(skt,80) 

And this is what I got in the serial

/> dofile('new2.lua')
true
WiFi not active
-9
Socket is not valid
Socket is not valid

I tried the same code with Firmware v0.9.8.1. and It works, I think is a bug in the firmware Ver. 1.00.04 LoBo

Thanks in advance

AugustoMo commented 7 years ago

Hi Loboris,

I tried the same code with WiFiMCU.LUA_0.9.15_LoBo and it works. Could you help me. I'll use this board for term paper. thanks