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:
function 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 )