MQTT Connections Keep Alternating? Check for Duplicate Client Identifiers
Two gateways can each connect successfully when tested alone yet repeatedly disconnect each other when both run. In MQTT 3.1.1, a reused client identifier is one cause worth checking before changing network timeouts. Compare the identifiers and connection timeline while preserving the intended session behaviour.

Key takeaways |
The MQTT client identifier names the protocol session. Copying it into a second active client can displace the first connection. It is separate from an asset label and from authentication credentials. |
1. Identify the session name that was copied
OASIS MQTT 3.1.1 section 3.1.3.1 assigns the ClientId to the client/server session. Section 3.1.4 requires a server to disconnect an existing client when a newly accepted connection uses that client identifier. Check the actual MQTT version and deployed broker behaviour when applying this diagnosis.
A ProSight Software platform assessment should include the publishing clients, broker ownership and agreed identity scheme. This article describes a protocol-level investigation; it does not claim that every ProSight Software package exposes broker administration or a particular session-management screen.
Cloning a gateway configuration is a useful commissioning convenience only if per-device identities are handled deliberately. Compare the configured ClientId from both sources using approved tools. A visible equipment name, IP address or username may differ even when the protocol client identifier is identical.
2. Correlate two connection histories
Gather sanitised connection timestamps, endpoint names, software revisions and the relevant broker events available to the authorised administrator. Preserve secrets and credentials. Look for a repeatable pattern: client A connects, client B connects with the same identifier, and A loses its existing connection.
A reconnecting client may then displace the other again. That pattern suggests an identity collision but is not proof by itself. Authentication failures, unstable power, broker policy and network interruptions are separate possibilities. Record the evidence before adjusting several settings together.
Do not diagnose by repeatedly restarting operating gateways. Agree a controlled test boundary with the site team, particularly where a gateway also performs other monitoring or control work. Network tests must not interfere with protective or safety-related functions.
3. Use a hypothetical isolated test
Suppose test publishers A and B both use the identifier pumpgateway07. Each connects on its own. When B starts while A is active, the first session’s network connection closes. In the isolated setup, assign B its approved distinct identifier and repeat the same connection sequence.
The acceptance record should show both intended clients remaining connected under their own identifiers, then verify that each message maps to the correct asset. This invented example is a diagnostic fixture, not evidence of a fault in a specific device or ProSight Software deployment.
Retest a normal restart of each approved client. The required identity should remain stable for that client across restarts when its session design depends on it. Generating a new random identifier for every reconnect may hide the collision while defeating an intended persistent-session arrangement.

Diagnostic checks
Observation | Check |
Each works alone; together they alternate | Compare actual ClientIds |
Different usernames; same symptom | Username and ClientId are separate |
Connections stable; wrong asset receives data | Inspect topic and payload mapping |
4. Keep identity and access control separate
A unique ClientId does not authenticate a device. Credentials, authorisation and encrypted transport require their own verified design. Conversely, giving two gateways different usernames does not automatically make their MQTT ClientIds different.
Before changing a deployed identifier, assess the effect on stored session state and subscriptions with the broker administrator. Do not delete old sessions or change clean-session behaviour merely to clear a symptom. Document an approved migration and recovery approach for the actual version and service.
Also check the data identity inside the topic and payload. Two correctly connected clients can still publish under the wrong asset key. The connection test and the measurement-mapping test are separate checks in the handover.
5. Prevent recurrence at rollout
Keep a controlled inventory mapping physical gateway, environment, ClientId, asset identity and configuration revision. Separate test and production allocation rules. Require the commissioning checklist to replace or allocate identity fields before a cloned configuration joins its intended broker.
For acceptance, record simultaneous operation, restart behaviour and correct downstream asset mapping. Keep the original symptom and the corrected evidence together. A single successful connection screenshot cannot prove that a fleet will coexist.
Where the integration needs tailored session or provisioning work, discuss the ProSight Custom scope with the actual broker and gateway documentation. Confirm ownership and deliverables explicitly; a conceptual workflow is not an advertised automatic collision-prevention feature.
Practical handover checklist
Read both configured ClientIds and confirm the MQTT version.
Correlate the two connection timelines through authorised logs.
Test approved distinct identifiers in an isolated setup.
Verify simultaneous operation, restart behaviour and asset mapping.
Recommended equipment / related solutions
Review the ProSight Software platform overview to align the software scope with your measurement and reporting requirements. Confirm the selected deployment and integration route before implementation.
For an engineered interface or commissioning workflow, discuss ProSight Custom with a sanitised example and explicit acceptance criteria. Agree the deliverables rather than assuming a conceptual test is an available product feature.
Related guide: MQTT Topic and Payload Design for Industrial IoT Dashboards
Frequently asked question
Should every reconnect use a fresh random ClientId?
Only if that matches the documented session design. A stable, unique identifier may be needed for the intended persistent session. Resolve fleet uniqueness without silently changing session semantics.
Technical reference
Need help with your application?
Discuss this application and request a project assessment. Send the exact equipment models, interface documentation and a sanitised example. Confirm compatibility, supported functions and acceptance scope before purchase or deployment.



.png)
Comments