Hi everyone,
I am running a fresh openHAB 5.2.3 installation using the official Docker image with host networking and a BTicino F459 as gateway. Things are configured through files; no previous binding runtime state was imported.
Commands initially work, but occasionally opening a replacement CMD connection fails. Subsequent commands then fail with “CMD is not connected” until the bridge is disabled and re-enabled.
There seem to be two separate questions: why opening a replacement command connection sometimes fails, and why subsequent commands do not recover afterwards.
Environment:
- Current host: Intel Jasper Lake, Debian 13, kernel 6.12.113+deb13-amd64; official openHAB 5.2.3 Debian Docker image, host networking.
- Things are file-configured, with JavaScript automation rules.
- 37 OpenWebNet entries including the gateway: lighting, dimmers, shutters, heating, energy meter and CEN+.
For context, I previously used the same gateway with openHAB 4.3.1 on a Raspberry Pi 3 without noticing this behaviour. This is background information, not evidence of a version regression. That one is currently stopped and disabled; it is not intentionally running alongside the new one.
Observed behaviour:
- The gateway connects and commands initially work.
- A later command fails when the library tries to open a NEW CMD connection.
- Subsequent commands immediately fail with “CMD is not connected”.
- In earlier checks, the bridge could remain ONLINE with the monitor TCP socket still established despite command failures. I have not verified continuous event delivery during every incident.
- Disabling and re-enabling the bridge has restored the connection in observed incidents.
Example from 27 October 2026, local server time (Europe/Rome):
00:17:15.395 BUSConnector: openCommandConnection() returned exception
(Could not open BUS-CMD connection to 192.168.1.45:20000
(IOException: Connect timed out)) while opening NEW CMD connection
00:17:15.397 OpenWebNetLightingHandler: Exception while processing command ON:
IOException while sending frame *1*1*24## or reading response:
Cannot create NEW CMD connection to send message *1*1*24##
00:17:15.403 OpenWebNetLightingHandler: Exception while processing command OFF:
CMD is not connected
00:17:18.418 OpenWebNetLightingHandler: Exception while processing command ON:
CMD is not connected
00:17:20.504 OpenWebNetLightingHandler: Exception while processing command OFF:
CMD is not connected
00:17:23.099 Custom recovery script disables the bridge
00:17:28.478 OpenWebNetBridgeHandler: CONNECTED to BUS gateway bridge
The excerpt above is shortened for readability; the recovery script is mine, not built-in binding behaviour. It checks for new CMD errors every 10 seconds, disables the bridge for 5 seconds and enables it again, with a 120-second cooldown. It sends no actuator commands. This work
around changes how long the failure remains observable.
Across the retained logs I found six failed CMD reconnects: 26 October at 22:18, 22:47, 23:01 and 23:03, and 27 October at 00:17 and 00:25. Five reported a connection timeout and one a refused connection. These are six failed reconnect attempts, not necessarily six independent ro
ot-cause incidents. The two incidents on 27 October were followed by successful bridge reconnection approximately 13 seconds after the first logged error.
There were also MON reconnect failures during setup, so I would not assume every incident affects only the CMD connection. Errors from the earlier intentionally isolated staging configuration have been excluded from the CMD count above.
Possible recovery issue, based on reading openwebnet4j 0.14.0:
- BUSConnector.sendCommandSynchInternal() closes the old CMD socket, clears isCmdConnected and attempts openCmdConn(). If that fails, it throws an IOException.
- OpenConnector.sendCommandSynch() rejects later commands when isCmdConnected() is false, before calling the internal send method.
Could this explain the persistent “CMD is not connected” state after one failed reconnect, or is another recovery mechanism expected to handle it?
Source references:
- openwebnet4j/src/main/java/org/openwebnet4j/communication/BUSConnector.java at 0.14.0 · mvalla/openwebnet4j · GitHub
- openwebnet4j/src/main/java/org/openwebnet4j/communication/OpenConnector.java at 0.14.0 · mvalla/openwebnet4j · GitHub
I have seen suggestions that a faster host might overwhelm older gateways. I am open to testing command pacing, but currently have no command-rate measurements or packet capture proving overload. A TCP connect timeout alone does not seem sufficient to establish that explanation.
Questions for the maintainers:
- Are there known session limits, idle-session behaviour or issues that could cause this pattern?
- Is the CMD recovery path above expected, and would reconnect-with-backoff or a more accurate Thing status be appropriate?
- Which logger categories and capture details would be most useful to distinguish TCP/session exhaustion from authentication or BUS timing problems?
- Would an isolated comparison with a single manually commanded light and automation rules disabled be the best next test?
I can collect a targeted trace and packet capture during a reproduction, with credentials/authentication exchanges removed before sharing. Thanks for any guidance.