Skip to content

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

Description

@chuxuanhy

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions