local backlog_con = assert(env:connect(backlogdb))
backlog_con:execute('BEGIN TRANSACTION')
backlog_con:execute(string.format("INSERT INTO queue(time_stamp,sensor_id,sensor,param,value) VALUES (datetime('now','localtime'),'%s','%s','%s',%f)",id,type,param,val))
local backlog_con = assert(env:connect(backlogdb))
backlog_con:execute('BEGIN TRANSACTION')
backlog_con:execute(string.format("INSERT INTO queue(time_stamp,sensor_id,sensor,param,value) VALUES (datetime('now','localtime'),'%s','%s','%s',%f)",id,type,param,val))