Open cambronf opened 1 month ago
I’ll have a look on it, we can solve it by just consuming queue contents but publishing at user specified interval, or as you suggested rejoin multicast group for each poll to avoid queue build up. Both solutions have some overhead.
@cambronf I had a look on the code, but before doing any changes - can you confirm if changing pollingPeriod
to 1
helps? This setting should trigger multicast receiver every second and reduce delay.
As far I remember energy meter publish packet every 100 ms, so you still going to experience issue, but with smaller delay at the beginning.
Hi I tried with 1 seconds, but the big delay and queue remains.
According to me, every SMA energymeter/homemanager send a multicast dataframe every 1s, as set in the Meter Configuration. As I have 3 meters in the network, all sending packets to the same multicast address/port, there is still a queue with pollingPerod = 1s (overload of factor 3). See also my earlier evaluation in pdf available at https://github.com/cambronf/openhab
@cambronf Please give a shoot to PR linked above - it did change internal polling interval to 1s and deferred the throttling to caller who registers packet handler.
Still, if you have 3 devices, each publishing each second, we should fire receive
three times/sec to avoid issue or join/leave group at each poll.
This issue can be closed - PR with fixes been merged few days ago, it will be included in 4.2.0 release.
Expected Behavior
immediate reading of multicast packets
Current Behavior
Delay of up to 30 minutes between received multicast packet and openhab item update. Big queue at input buffer, introduced by the fix done for broadcast frames #11718 in openhab 4.2.0M3
Possible Solution
As all SMA meters send data to the same multicast group, and the multicast group is open all the time, the input buffer fills up with a lot of data. SMA meters send packets every second. The binding itself only read 1 packet every 30 second (default value). The buffer is FIFO. Delays go up to 20-30 mins. Proposed fix: move socket.JoinGroup(address) and socket.LeaveGroup() to ReceivingTask run.
Your Environment
see [https://community.openhab.org/t/sma-energy-meter-binding-yields-unplausible-values/128180/132]https://community.openhab.org/t/sma-energy-meter-binding-yields-unplausible-values/128180/132 and further for more details