Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All ModbusTCP plugins don't update to a changed IP on the fly #82

Open
mzanetti opened this issue Sep 21, 2022 · 6 comments
Open

All ModbusTCP plugins don't update to a changed IP on the fly #82

mzanetti opened this issue Sep 21, 2022 · 6 comments

Comments

@mzanetti
Copy link
Member

None of the ModbusTCP generator based plugins handle the case that a device changes IP address on the fly. They will stay disconnected until nymea is restarted.

@t-mon
Copy link
Member

t-mon commented Sep 30, 2022

Also where the monitor has been introduced already?

@mzanetti
Copy link
Member Author

Yes. Phoneixconnect seems to be the only one that is fixed already.

@mzanetti
Copy link
Member Author

The reason is that the generated ModbusTcpConnection classes take the IP in the ctor, so it's only set at startup. Anyhow, luckily the base class has a setAddress() method. It seems to be enough to connect the monitors networkInfoChanged signal to that one (and the already existing reconnect timer will then take care about calling connectToHost() again).

@t-mon
Copy link
Member

t-mon commented Sep 30, 2022

https://github.com/nymea/nymea-plugins-modbus/blob/master/libnymea-modbus/modbustcpmaster.cpp#L119

If reachable changes in the monitor, i perform a reconnect after setting the IP in the base class, which triggers the connectDevice() method where all properties get updated before actually performing the connection.

For example: https://github.com/nymea/nymea-plugins-modbus/blob/master/kostal/integrationpluginkostal.cpp#L322

Not getting what the phoenix connect is doing different?

@mzanetti
Copy link
Member Author

ok. right. fine for Kostal. Seems to be missing in alphainnotec and stiebeleltron now only....

@t-mon
Copy link
Member

t-mon commented Sep 30, 2022

yeah, we cannot test those currently...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants