|
|
@ -20,13 +20,19 @@ function ManualLink(ssid,passwd) |
|
|
|
wifi.setmode(wifi.STATION) |
|
|
|
wifi.setmode(wifi.STATION) |
|
|
|
StationCfg.ssid=ssid |
|
|
|
StationCfg.ssid=ssid |
|
|
|
StationCfg.pwd=passwd |
|
|
|
StationCfg.pwd=passwd |
|
|
|
StationCfg.save=true |
|
|
|
StationCfg.save=false |
|
|
|
wifi.sta.config(StationCfg) |
|
|
|
wifi.sta.config(StationCfg) |
|
|
|
wifi.sta.connect() |
|
|
|
wifi.sta.connect() |
|
|
|
PageMainScene(ssid,wifi.sta.getip().."","V1.0"); |
|
|
|
if wifi.sta.getip() == nil then |
|
|
|
|
|
|
|
SetIP("192.168.1.115","255.255.255.0","192.168.1.1") |
|
|
|
|
|
|
|
print("No Ip get,default to 192.168.1.115!"); |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
PageMainScene(ssid,wifi.sta.getip(),"V1.0"); |
|
|
|
local lightArr = {[1]=false,[2]=false,[3]=false,[4]=false} |
|
|
|
local lightArr = {[1]=false,[2]=false,[3]=false,[4]=false} |
|
|
|
PageLight(lightArr) |
|
|
|
PageLight(lightArr) |
|
|
|
|
|
|
|
--Service Open |
|
|
|
|
|
|
|
StartUDPService(); |
|
|
|
|
|
|
|
print(wifi.sta.status()); |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
--mobile setting ap and passwd |
|
|
|
--mobile setting ap and passwd |
|
|
@ -37,7 +43,7 @@ function AutoLinkByMobile() |
|
|
|
enduser_setup.start( |
|
|
|
enduser_setup.start( |
|
|
|
"DY-Light-Controller", |
|
|
|
"DY-Light-Controller", |
|
|
|
function() |
|
|
|
function() |
|
|
|
print("Connected to WiFi as:" .. wifi.sta.getip()) |
|
|
|
print("Connected to WiFi!") |
|
|
|
end, |
|
|
|
end, |
|
|
|
function(err, str) |
|
|
|
function(err, str) |
|
|
|
print("enduser_setup: Err #" .. err .. ": " .. str) |
|
|
|
print("enduser_setup: Err #" .. err .. ": " .. str) |
|
|
|