openwrt: disable debugging and enable the json/rest pwr api by default

This commit is contained in:
Bart Van Der Meerssche 2010-05-22 11:24:24 +02:00
parent af4edb53e6
commit 1c72a072ff
1 changed files with 7 additions and 6 deletions

View File

@ -32,11 +32,12 @@ dbg = require 'flukso.dbg'
local param = {xmlrpcaddress = 'http://logger.flukso.net/xmlrpc', local param = {xmlrpcaddress = 'http://logger.flukso.net/xmlrpc',
xmlrpcversion = '1', xmlrpcversion = '1',
xmlrpcmethod = 'logger.measurementAdd', xmlrpcmethod = 'logger.measurementAdd',
pwrenable = false, pwrenable = true,
pwrinterval = 0, pwrinterval = 0,
pwrdir = '/tmp/sensor', pwrdir = '/tmp/sensor',
device = '/dev/ttyS0', device = '/dev/ttyS0',
interval = 300} interval = 300,
dbgenable = false}
function dispatch(e_child, p_child, device, pwrenable) function dispatch(e_child, p_child, device, pwrenable)
return coroutine.create(function() return coroutine.create(function()
@ -170,10 +171,10 @@ function publish(child, dir)
end) end)
end end
function debug(child) function debug(child, dbgenable)
return coroutine.create(function(measurements) return coroutine.create(function(measurements)
while true do while true do
dbg.vardump(measurements) if dbgenable then dbg.vardump(measurements) end
if child then coroutine.resume(child, measurements) end if child then coroutine.resume(child, measurements) end
measurements = coroutine.yield() measurements = coroutine.yield()
end end
@ -193,7 +194,7 @@ local e_chain = buffer(
filter( filter(
send( send(
gc( gc(
debug() debug(nil, param.dbgenable)
) )
, param.xmlrpcaddress, param.xmlrpcversion, param.xmlrpcmethod) , param.xmlrpcaddress, param.xmlrpcversion, param.xmlrpcmethod)
, 86400, 172800) , 86400, 172800)
@ -204,7 +205,7 @@ local e_chain = buffer(
local p_chain = buffer( local p_chain = buffer(
polish( polish(
publish( publish(
debug() debug(nil, param.dbgenable)
, param.pwrdir) , param.pwrdir)
, 60) , 60)
, param.pwrinterval) , param.pwrinterval)