function processLine(str)
msg=splitStr(line,':')
- msg_type=msg[1] or nil
- msg_body=msg[2] or nil
+ msg_type=msg[1] or ''
+ msg_body=msg[2] or ''
if msg_type=="STATUS" then
printLog("Status: "..msg_body)
elseif msg_type=="ERROR" then
sensor_id = web_devid
for i,rec in ipairs(sens) do
recrd=splitStr(rec,'=')
- key=recrd[1] or nil
- value=recrd[2] or nil
+ key=recrd[1] or ''
+ value=recrd[2] or ''
if value then
if key=="TYPE" then
sensor_type=value
mqtt_param = {}
for i,rec in ipairs(sens) do
recrd=splitStr(rec,'=')
- key=recrd[1] or nil
- value=recrd[2] or nil
+ key=recrd[1] or ''
+ value=recrd[2] or ''
if value then
if key=="TYPE" then
alarm_type=value