victronenergy / venus

Victron Energy Unix/Linux OS
https://github.com/victronenergy/venus/wiki
574 stars 70 forks source link

dbus-fronius: Further improve scanning to avoid unnecessary disconnections #753

Closed izak closed 3 years ago

izak commented 3 years ago

Lots of work has already gone into making scanning better.

There is still an issue where a "priority scan" checks all inverters it already knows about instead of a full scan. When it does this, it also scans inverters that are already connected, that work just fine. If this scan times out (which can happen on highly loaded data managers), it can end up disconnecting the PV-inverter or changing the protocol from sunspec to solarapi.

It is quite common for the protocol to flop back and forth in such cases. Increasing the timeout only helps so much.

There are also PV inverters that only allow one concurrent connection.

A good improvement would be to not "priority scan" PV-inverters that we are currently connected to. Why do that in the first place?

izak commented 3 years ago

to not "priority scan" PV-inverters that we are currently connected to. Why do that in the first place?

To answer my own question: Because a datamanager on a single IP address may gain/lose PV-inverters connected through Solar.NET. Therefore we need to rescan IP addresses even though we're already connected to (other) inverters on that IP address.

A side effect to this is that we will also scan generic sunspec inverters even though we are already connected to them and nothing new is going to be found on the same IP. But I don't think that's a good enough reason to overcomplicate things, so that will remain as is.

So the only thing I'm fixing is to prevent unnecessary switch back and forth between sunspec and solarapi, done in dbus-fronius 1.4.10. And then this issue can be closed.

izak commented 3 years ago

There's a bit more to this that is still on a branch. Reopening.