volkszaehler / mbmd

ModBus Measurement Daemon - simple reading of data from ModBus meters and grid inverters

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Latest nightly - Modbus TCP - Gaps in Reading

isarrider opened this issue · comments

commented

Hi,

compared to the build I made on June 11 (with the current master branch then),
the latest nightly has gaps (like every 7s one reading) in reading for me...
See picture attached - revert to the nightly before the commit in the ~last 20%...
Clipboard01

The commit afterwards - thought it is only related to Modbus RTU?

BR,
Alex

commented

Can you bisect to the breaking commit?

commented

basically already did, as only one commit is after
(the other only changes the systemd requirements for startup)

commented

Which commit?

commented

if its no other ting, must be #265

commented

That will add timeout for TCP, too: https://github.com/volkszaehler/mbmd/pull/265/files#diff-30e0f5e75378b29cffb17ecc20d5fe46e5fbf95b4952a60cb55cba0ade588e37R92. Can you try if increasing the timeout fixes your problem?

commented

was afraid of that
(whats the default timeout in contrast to before the commit?)
Ill figure out how to add this in the config file and post the result here...

commented

couldnt figure out until now where the timeout can be specified in the config.yaml
(https://github.com/volkszaehler/mbmd/blob/master/mbmd.dist.yaml)
Ill try to use an edited source file with:

const DefaultTimeout = 900 * time.Millisecond

in commons.go

The default should be unchanged and still be 300ms.

You could use the cmdline parameter --timeout to change the timeout. E,g. '--timeout 600ms' to change the timeout to 600ms.
The format for the duration is documented here: https://pkg.go.dev/time#ParseDuration

I haven't invest any time so far to understand how the config file.

commented

ok, it seems with the 900ms, the timeout doenst occur for me anymore,
I get measurements now every second... (latest nightly b2590ae (compiled with go1.19))
Maybe the timeout should be by default higher than 300ms?

commented

closing it here...