This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Log all packets from 15.15.*
#2
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
Reply


Messages In This Thread
Log all packets from 15.15.* - by kgroenhoej - 10.11.2021, 17:40
RE: Log all packets from 15.15.* - by buuuudzik - 10.11.2021, 19:17

Forum Jump: