SmartArduino / WiFiMCU

WiFiCMU-v0.9.8-pre release
https://github.com/SmartArduino/WiFiMCU
123 stars 65 forks source link

Cannot connect to wifi AP with uid/pass got from file #8

Open chuxuanhy opened 8 years ago

chuxuanhy commented 8 years ago

Hello,

The hard code credential in lua scripts worked successfully. But I have tried, and could not connect to wifi with uid/pass read from file stored in wifimcu. Please check this!

init.lua content : cfg={} if file.open("info.lua","r") then cfg.ssid=file.readline() cfg.pwd=file.readline() file.close() if cfg.ssid ~= nil and cfg.pwd ~= nil then print("Start connect to AP :") print("ssid : " .. cfg.ssid) print("pwd : " .. cfg.pwd) wifi.startsta(cfg); cfg = nil else tmr.stop(1) print("start AP mode to config credential") end end

info.lua content : username password

SmartArduino commented 8 years ago

Please check the exact length reading back.