Left for archival purposes.

User avatar
By Fr4gg0r
#6736 Hi,

it would be very nice, if there was a callback for when the device connected to a wifi ap.
Currently I am using something like this in my init.lua:
Code: Select allfunction waitForWifiAndGo()
  print("check")
  ipAddr = wifi.sta.getip()
  if (ipAddr ~= nil) then
    tmr.stop(0)
    tmr.alarm( 1 , 1 , 0 , function() dofile("upload.lua") end )
  end
end

tmr.alarm(0, 100, 1, waitForWifiAndGo )