29.11.2022, 10:35
Add logging to the query function like this and post what you get in Logs tab:
Code:
function query(req, out)
if not sock then
return
end
sock:send(req .. '\r\n')
local res, err = sock:receive()
if not res then
return close(err)
end
if res:sub(1, 1) ~= '~' then
return close('invalid reply ' .. res)
end
if res:sub(2, #req) ~= req:sub(2) then
return close('invalid reply ' .. res)
end
local val = res:sub(#req + 2)
log('response', req, out, val)
val = tonumber(val)
if val then
grp.checkupdate(out, val)
end
end