[NodeMcu] Bugs and Issues area
Posted: Sat Nov 22, 2014 12:31 pm
Bugs&issues reported here.
-->
Open Community Forum for ESP8266, Come share Arduino and IoT (Internet of Things)
https://www.esp8266.com/
wifi.startsmart(6, callback)
function callback()
print("I think I got the wifi credentials!")
wifi.stopsmart()
wifi.sta.connect()
print(wifi.sta.getip())
end
wifi.sta.disconnect()
print(wifi.sta.getip())
wifi.startsmart(6, callback)
> dofile("smartWifiConfig.lua")
192.168.1.161
set channel to 6
> switch to channel 1
switch to channel 14
switch to channel 2
switch to channel 3
switch to channel 4
switch to channel 5
switch to channel 7
switch to channel 8
switch to channel 9
switch to channel 10
switch to channel 11
switch to channel 12
switch to channel 13
rrezaii wrote:I'm trying to configure esp8266 with wifi credentials using theCode: Select allfunction. I have written the following script to do this and I use the TI's iOS app (https://itunes.apple.com/us/app/ti-wifi ... 69322?mt=8) to broadcast the SSID and Key for the wifi that I'd like ESP to be configured with.wifi.startsmart(6, callback)
Code: Select allfunction callback()
print("I think I got the wifi credentials!")
wifi.stopsmart()
wifi.sta.connect()
print(wifi.sta.getip())
end
wifi.sta.disconnect()
print(wifi.sta.getip())
wifi.startsmart(6, callback)
Problem: The ESP starts scanning channels but it never gets configured with the credentials.Code: Select all> dofile("smartWifiConfig.lua")
192.168.1.161
set channel to 6
> switch to channel 1
switch to channel 14
switch to channel 2
switch to channel 3
switch to channel 4
switch to channel 5
switch to channel 7
switch to channel 8
switch to channel 9
switch to channel 10
switch to channel 11
switch to channel 12
switch to channel 13
srv=net.createServer(net.TCP)
srv:listen(80,function(conn)
conn:on("connection",function(conn)
print("Connected")
end)
conn:on("receive",function(conn,payload)
print("Received:" .. payload)
end)
conn:on("disconnection",function(conn)
print("Disconnected")
end)
end)