Could you explain eibdgm? How to use it?
Based on codes from forum I've prepared such simple script:
So every time when resident script is running clienttep() is executed.
1) But should I set some os.sleep() between next clienttep()?
2) How client works internally? Does it has some table with telegrams which appeared but that aren't handled and when they are handled then they are dropped from that table? 3) Could I declare 1 handler to a few events by typing 'groupwrite groupread' etc.?
4) Could I check telegrams not so often like 1s or less but e.g. 1 minute?
PS. This post is also for creating some documentation for forum users, because unfortunately currently there is no such doc.
When I've logged:
Then the result is:
So e.g. I am not see I don't see method clienttep().
Also I see that when I've set Resident interval to 5s and eibdgm timeout to 5 seconds then telegrams appeared more sooner in Objects than by handler with eibdgm (more sooner than 5 seconds, e.g. 30s).
Is there a possibility that eibdgm could not log all telegrams but only e.g. 1 from 3 which appeared on bus? What is optimum configuration. I know that minimum duration of 1 telegram on TP is 0.05s so how eibdgm works on timeout 0.5s?
Based on codes from forum I've prepared such simple script:
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 writehandler(event)
local dpt, dst = datatypes[ event.dstraw ], event.dst
if dpt then
local value = knxdatatype.decode(event.datahex, dpt)
log(dst, value)
end
end
client = eibdgm:new({ timeout = 0.5 })
client:sethandler('groupwrite', writehandler)
end
-- handle knx
client:step()
So every time when resident script is running clienttep() is executed.
1) But should I set some os.sleep() between next clienttep()?
2) How client works internally? Does it has some table with telegrams which appeared but that aren't handled and when they are handled then they are dropped from that table? 3) Could I declare 1 handler to a few events by typing 'groupwrite groupread' etc.?
4) Could I check telegrams not so often like 1s or less but e.g. 1 minute?
PS. This post is also for creating some documentation for forum users, because unfortunately currently there is no such doc.
When I've logged:
Code:
log(client)
Then the result is:
Code:
* table:
[sendpacket]
* function: 0xb73bd4d8
[sock]
* udp{unconnected}: 0xb73bd4b8
[handlers]
* table:
[1]
* function: 0xb75e3638
So e.g. I am not see I don't see method clienttep().
Also I see that when I've set Resident interval to 5s and eibdgm timeout to 5 seconds then telegrams appeared more sooner in Objects than by handler with eibdgm (more sooner than 5 seconds, e.g. 30s).
Is there a possibility that eibdgm could not log all telegrams but only e.g. 1 from 3 which appeared on bus? What is optimum configuration. I know that minimum duration of 1 telegram on TP is 0.05s so how eibdgm works on timeout 0.5s?
Done is better than perfect