Bug: ModbusTcpMaster: device ':502' ConnectionError when adding a trydan
by manual IP (createMethod "user") or after nymead restart before the
NetworkDeviceMonitor completes its ARP scan.
Root cause: TrydanModbusTcpMaster was constructed with
monitor->networkDeviceInfo().address(), which is null at first
registerMonitor() — the monitor only populates its cache after an
asynchronous ARP/mDNS resolution. connectDevice() then ran against
QHostAddress() → ":502".
Fix:
- Read the initial IP from the stored address param (always set at
discovery or user-entry) and use it as the fallback when the monitor
has not yet resolved the address.
- Guard the networkDeviceInfoChanged callback: only call setHostAddress()
when the new address is non-null (the monitor emits transient null info
during its internal refresh cycles).
Order is now: create master with valid address → wire callbacks →
connectDevice(). The monitor update path remains for DHCP renewals.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>