Posts: 7
Threads: 1
Joined: Feb 2021
Reputation:
0
Hi
Is there any easy way to log all packets coming from source 15.15.* ? (without making a tag on all objects)
I have some units that use 15.15.* when they are starting up and after a while change the address to the right configured address. And I want to log if these units have any other strange behavior.
Thanks
Regards
Klaus
Posts: 940
Threads: 161
Joined: Jul 2015
Reputation:
33
Hi Klaus,
you could use such script and customize handleLog function according to your needs.
Code:
if not client then
require('genohm-scada.eibdgm')
objects = grp.all()
datatypes = {}
for _, object in ipairs(objects) do
datatypes[ object.id ] = object.datatype
end
function handleLog(src, eventType, ga, value, rawEvent)
local isLoggedAddress = src:find("15.15.%d+") ~= nil
if isLoggedAddress then
log(src, eventType, ga, value, os.time())
end
end
function writehandler(event)
local dpt, dst = datatypes[ event.dstraw ], event.dst
local value = nil
if dpt then
value = knxdatatype.decode(event.datahex, dpt)
end
handleLog(event.src, event.type, dst, value, event)
end
client = eibdgm:new({ timeout = 0.5 })
client:sethandler('groupwrite', writehandler)
end
-- handle knx
client:step()
You could look also into these posts:
https://forum.logicmachine.net/showthrea...ght=eibdgm
https://forum.logicmachine.net/showthrea...ght=eibdgm
Done is better than perfect
Posts: 940
Threads: 161
Joined: Jul 2015
Reputation:
33
Awesome!
Done is better than perfect