Confirm Messages are Arriving at the MQTT Broker
This check confirms that the MQTT messages being published by the controller are reaching the DCH MQTT broker, after which they will be parsed and uploaded by DCH. It requires MQTT Client software running on a PC or phone/tablet with internet access, and connections on tcp_1883 and tcp_8883 to the internet permitted by the network firewalls.
We will connect to the broker via PC and monitor messages as they arrive at the broker under the specific topic. These messages are “as sent” by the gateway. Connecting to the broker and viewing the messages arriving from the gateway does not prevent DCH from uploading the messages.
There are a number of MQTT clients freely available on the internet for download. There are open-source options available. For this check, only the most basic MQTT functionality is required, and all of the software options should be capable.
1. Open the MQTT Client on your device and add a new connection as follows:
Broker address
broker.dataclearinghouse.org
If an IP address is required, the address is 52.64.251.183
Broker port
8883 for secure connection (strongly recommended) or 1883 for unsecure
Client ID
This must be a unique decimal or hexadecimal string. The software will probably autogenerate this. If not use a 10-16 digit numeric number. It does not need to be re-entered, and can be changed as required.
Username
This is the username provided when registering the data source, and will start with dsapi-
Password
This is the password provided when registering the data source.
SSL/TLS
For secure connections on tcp_8883 enable SSL/TLS and use protocol TLSv1.2 and CA signed server certificate.
If the software requires manual upload of the certificate, this can be done from the senaps.io website via your internet browser. Refer to your browser documentation for instructions on how to perform this manually. Save the certificate to file and upload it to the MQTT Client software. Note that the senaps.io certificate is updated every 3 months so you will need to re-upload after an update.
Connection Timeout
Keep Alive Interval
Mqtt Version
.
.
etc.
Generally the default values will work, otherwise try:
Connection Timeout 30 (seconds)
Keep alive interval 60 (seconds)
MQTT version 3.1.1
2. Connect to the broker. There should be an indication that the connection is active. If the connection is refused or does not occur check the following:
a. Check your device has internet connectivity.
b. Check the data source username and password are correct.
c. Change Client ID and retry.
d. Try an unsecure connection via tcp_1883. If this connects, there may be a certificate issue or TLS version problem with the secure connection.
e. Try another device and another MQTT Client software package.
3. Subscribe to a topic. Make sure you are in the subscribe tab or window (not a publish window). We are attempting to subscribe to a topic to collect messages being published to the topic by the gateway.
4. Enter the topic into the MQTT client topic field. This topic must be the same as the publishing topic in the gateway.
5. Click or initiate the subscription to start collecting the incoming messages.
6. Monitor the subscription window for a number of polling intervals. Some clients will provide a count of incoming messages. Check that the number of messages being received per interval in the MQTT client is the same number as is being published by the gateway.
If you cannot see any messages try the following:
· Check the gateway to see whether the connection is disabled, stale or in fault. Refer to the gateway documentation on how to resolve these issues and also check the following:
o Check the datasource username and password are correct.
o Check that the Client ID field in the gateway is populated, is likely to be unique, and is different to the Client ID of the device MQTT Client. Connection will be refused if the Client ID is not unique. Sometimes adding or changing a few digits will resolve the issue.
o Check with network administrators whether firewalls are blocking the connection between the gateway and the broker (ports tcp_1883 or tcp_8883).
o If using a secure connection on tcp_8883, temporarily switch to unsecure connection on tcp_1883 and see whether the messages arrive. If so, there may be an issue with the SSL certificate.
· Check the MQTT topic is correct in the gateway and the device MQTT client. Check the two topic fields for any spaces hidden at the start or end and remove them to prevent future confusion.
· Try subscribing to all messages under the broker account instead of just the specified topic. In the topic field enter # and wait for messages to arrive. If you see messages arriving, they will show the topic they are being published under. Check that this topic is correct, and if not, correct it in the gateway.
Last updated