Skip to end of metadata
Go to start of metadata
The 'Connected' status shown on the Server tab under MQTT Transmission Settings shows the connected status of each MQTT Client created in the format quantity MQTT Clients connected of quantity MQTT Clients created

In the example below, the Connected value 3 of 3 indicates 3 MQTT Clients are connected to the MQTT Server and 3 MQTT Clients are created.

Let's look at the scenarios when not all your MQTT Clients show as being connected.


MQTT Clients are created but none are connecting to the specified MQTT Server

Remember that remote MQTT Clients will need to be able to establish a TCP/IP socket connection to TCP/IP ports #1883 and port #8883. On the machine hosting your MQTT Server, you must either turn off firewalls or at a minimum allow inbound connections to these ports.

Review the Microsoft Create an Inbound Rule doc for assistance on a Windows platform

Single MQTT Server configured

If you have a single MQTT Server configured, the clients are not able to connect because either the Server is unavailable, the network connection to the Server is unavailable or the connection to the Server is being refused.

You can confirm this from the Ignition UI connected to your instance of MQTT Transmission by navigating to Status > Diagnostic > Logs.

Read the user manual Diagnostic - Logs explaining how to use the Logs console in Ignition

If the Server or connection to the Server is unavailable, you will see errors logged from the TransmissionClient logger indicating that the clients continually attempting to connect and failing.

If your MQTT Server is available but requires an authenticated connection to be made and the Username/Password configured in your MQTT Transmission server is incorrect, you will also see the error Bad username or password errors logged.



Multiple MQTT Servers in server set

If you have multiple MQTT Servers configured within the same Server Set, the MQTT Clients will only connect to one server in the set. You would expect that only one server would show MQTT Clients connected as in the example below:

If the MQTT Clients lose connection to the connected server, they will attempt to connect to the next server in the set until a connection is established.


If none of the servers defined in the server set are available, you will see errors logged from the TransmissionClient logger indicating that the clients continually attempting to connect and failing.

You can confirm this from the Ignition UI connected to your instance of MQTT Transmission and navigating to Status > Diagnostic > Logs.

Read the user manual Diagnostic - Logs explaining how to use the Logs console in Ignition

If your MQTT Server is available but requires an authenticated connection to be made and the Username/Password configured in your MQTT Transmission server is incorrect, you will also see the error Bad username or password errors logged.



Multiple MQTT Servers not in a server set

If you have multiple MQTT Servers configured in different Server Sets and Transmitters configured to use those different sets, the MQTT Client connections are independent for each Server Set.

Follow the trouble shooting steps for a Single MQTT Server configured for a each server showing MQTT Clients that are not connected.

MQTT Clients are created but show as connecting/disconnecting from the specified MQTT Server

In this instance, you most likely have a ClientID collision at the MQTT Server. Colliding MQTT Client IDs occur when there are two or more MQTT clients connecting to an MQTT broker using the same Client ID. The broker uses the Client ID to identify the client and the current state of the client and therefore this ID must be unique per client and broker.

Let's confirm by checking the connection status of the Edge Nodes with your Chariot or MQTT Distributor server instance.

Chariot 

From the Chariot UI navigate to Alerts in the left menu bar. Select Types and enable the alerts for MQTT_DISCONNECT

Under Live Alerts, if we can see in the logs that Chariot is logging the DUPLICATE_CLIENT_ID description, as shown below, you have Colliding Client IDs.

MQTT Distributor

From the Ignition UI connected to your instance of MQTT Distributor, navigate to Status > Diagnostic > Logs.

Read the user manual Diagnostic - Logs explaining how to use the Logs console in Ignition 

Set the debug level for the io.moquette.spi.impl.ProtocolProcessor logger to TRACE and set the filter of the Logs view to ProtocolProcessor.

If we can see in the logs that the MQTT broker is continually forcefully disconnecting an existing connection to allow another client with the same Client ID to connect, as shown below, you have Colliding Client IDs.


Resolving Colliding Client IDs

To resolve the colliding Client IDs you will need to review your system configurations on the physical Edge Nodes identified and remove the conflicts.

In the logs if you see different IP addresses for the Edge Nodes attempting to connect with the same Client ID, then the same MQTT Client ID has been set on different physical Edge Nodes. Review the configuration for physical Edge Nodes with these IP addresses. 

If in the logs you see the same IP address for the Edge Nodes attempting to connect with the same Client ID then either:

  1. The MQTT Client ID is set on a single physical Edge Node device where a single Transmitter is dynamically picking up multiple virtual Edge Nodes.
  2. The MQTT Client ID is set on a single physical Edge Node where multiple transmitters are configured for one or more virtual Edge Nodes.

In either of these two setups, the MQTT connection for each virtual Edge Node requires a unique Client ID. The Client ID in the the MQTT Transmission Configuration should be left blank allowing MQTT Transmission to auto-generate unique Client IDs for each Edge Node connection.

Refer to the MQTT Transmission Transmitters and Tag Trees Tutorial/HowTo for detail on how a virtual Edge Node is dynamically created.

No MQTT Clients are created 

A unique MQTT Client is created for each valid EdgeNodeID identified by the MQTT Transmission module. 

If no MQTT Clients have been created, the MQTT Transmission module was not able to identify any configured EdgeNode. There is no requirement for the Edge Node to contain any any tag data. 

If allowing MQTT Transmission to dynamically pickup the GroupID and EdgeNodeID directly from tag folder hierarchy or you are explicitly setting the GroupID through the Sparkplug Settings configuration for your Transmitter, you need to ensure that each branch of the tag tree has at least two folder levels below the folder referenced by the Tag Path in the Transmitter settings.

As an example, in the tag tree below we have created a two level folder structure. Using the default Transmitter configuration, the MQTT Transmission module will dynamically create three Edge Nodes named Line1, PLC1 and PLC2 each with GroupID = Facility 1. 



There will be an MQTT Client for each Edge Node and you will see on the Servers tab the count of the MQTT Clients and their connected status.

 If we change the Transmitter configuration to add a Tag Path, say Facility1, the MQTT Transmission module will not identify any Edge Nodes. This is because the first level under Facility1 will be determined as the GoupID and there are no folders below to be used as the EdgeNodeID.


As a result the Servers tab will show 0 MQTT Clients created and connected.


Resolving lack of identified Edge Node IDs

To resolve the lack of identified Edge Node IDs, you will need to review your Transmitter and Ignition tag tree configurations.

Review the MQTT Transmission Transmitters and Tag Trees tutorial for detail on how these required elements are dynamically created

Unable to Resolve?

If the troubleshooting tips did not help you resolve your issues, please open a ticket with Support making sure to include the MQTT Transmission or MQTT Distributor logs as appropriate.  

From the Ignition Logs view, select the Download icon to download a copy of the system-name.idb file to your local file system. You will need to compress (zip, 7z or rar) this file before sending to Support.



Additional Resources

  • No labels