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

[Bug] Not sending Keep-alive #1599

Open
arturv2000 opened this issue Mar 4, 2024 · 2 comments
Open

[Bug] Not sending Keep-alive #1599

arturv2000 opened this issue Mar 4, 2024 · 2 comments
Assignees
Labels
bug Something isn't working desktop MQTTX Desktop

Comments

@arturv2000
Copy link

What did I do

MQTTX periodically "forget" to send the keep-alive to the broker. The interval that it happens is not always the same.

I have a connection to a broker, and defined the keep-alive to 60 seconds, no special error appears on the log file except indication that the connection was terminated.

Broker is an NanoMQ instance, Version: v0.21.6-6.

Have other clients connected (using Node-Red, MQTT.JS) and there are no issues with those connections, some running on the same machine as MQTTX.

What happened

Connection is terminated by broker since no Kepp-Alive message is sent to broker.

Expected

MQTTX should always send the keep-alive to broker according to configured interval.

Environment

  • OS: OS version, Windows 11 22631.3235
  • MQTTX version, v1.9.9

More detail

More detail include log information or screenshot

[2024-03-04 11:06:45] [INFO] Message arrived for FDR_Server with topic: "maquina/WHDNGDEV01-VNT/ACM". Message ID: "message_66093020-4147-4592-b374-b3679f3b13ff", payload: "{\"RDY\":0,\"FMW\":\"02.10\",\"RES\":0,\"ATY\":0,\"POS\":0,\"EFF\":4,\"ERR\":0,\"VAL\":0,\"CAB\":-1,\"BAT\":34,\"SRL\":\"00220400064\",\"DEV\":\"ACM\",\"PRT\":\"/dev/ttyUSB0\",\"IFW\":false,\"HTS\":1}". MQTT.js onMessageArrived trigger
[2024-03-04 11:06:45] [INFO] The connection FDR_Server (clientID mqttx_4a65da5f) is offline. MQTT.js onOffline trigger
[2024-03-04 11:06:45] [INFO] Connection for FDR_Server closed, MQTT.js onClose trigger
[2024-03-04 11:06:49] [INFO] Retrying connection for FDR_Server, attempt: 4

Screenshot from Wireshark
image

@arturv2000 arturv2000 added the bug Something isn't working label Mar 4, 2024
@ysfscream ysfscream self-assigned this Mar 5, 2024
@ysfscream ysfscream added the desktop MQTTX Desktop label Mar 5, 2024
@ysfscream ysfscream added this to the v1.9.10 milestone Mar 5, 2024
@ysfscream
Copy link
Member

Thank you for reporting the issue with MQTTX not sending Keep-Alive messages as expected in version v1.9.9. To help troubleshoot, you can enable debug logs to observe the ping requests, giving insights into what happens when the requests stop being sent.

image

The connection dropping after the application has been idle is a known issue related to MQTTX being built on Electron, where MQTT connections are managed at the UI layer rather than through Node.js. This can result in a different experience compared to tools like Node-Red. We're addressing this in the upcoming 2.0 release to prevent tab freezing and disconnection due to inactivity.

In the meantime, for a stable, long-term connection, consider using MQTTX CLI, which doesn't have this issue but lacks a GUI. Alternatively, enabling the desktop version's auto-reconnect feature may help by immediately attempting to reconnect after disconnection.

@arturv2000
Copy link
Author

Thanks for the feedback.

Already have the auto-reconnect enabled, but sometimes it will give-up the reconnections attempt, but need to check if it is any issue with the broker (NanoMQ).

Will wait for release of v2.0 to check if it is OK.

@ysfscream ysfscream modified the milestones: v1.9.10, v2.0.0-alpha.1 Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working desktop MQTTX Desktop
Projects
Status: Backlog
Development

No branches or pull requests

2 participants