1. The timer
2. The sensor reader
3. The data uploader
The uploader does an HTTPGet, passing the data as a query string in the URL. So the code does a get on, e.g., http://myserver.org/loggit.php?sensor1= ... nsor2=23.6.
Here is the timer:
tmr.alarm (1, 10 * 1000, 1,
function ()
data = getTemps(OWpin)
loggit(data)
end
)
The getTemps() function works fine in the loop. The debug shows the data string containing the temperatures.
The loggit() function works fine only if I comment out getTemps() and upload a small test string literal ("test") but when I leave the code as shown above the upload of data doesn't happen. Debug inside loggit() shows the routine is being called and it's internals are being executed, but no GET happens - my server page doesn't run, and no page data is returned to LUA.
I can't see why.
Is this a timing issue whereby the timer function takes too long? I've tried sprinkling tmr.wdclr() around the place, but it doesn't fix anything.
Any ideas would be appreciated.
Thanks.