Simple test of MQTT connectivity

I am trying to send modbus (RTU) data to a AWS MQTT broker using my TRB245. As you can expect, this is not working.
I would like to know if there is a simple way to check the link between my TRB245 and the MQTT broker without asking data from MODBUS… just to be sure, the communication link is operational.
And if not operational, how can I get information about what is blocking
Thanks in advance


You could try using mosquitto from the CLI directly, but this may not be really helpful. If you decide to do so, you can refer to mosquitto documentation here.

What firmware version do you have installed on your TRB245? If it is not the latest, please, make sure you update your device. If the current firmware is older than v7.05, please update with the ‘keep settings’ option disabled.

Then, when you configure Data to Server, try including an additional data input besides Modbus. For example, MNF or Base data.

Also, make sure you following the configuration example here. The data to server functionality was overhauled, but the general principles should still apply. You can find the description of the new data to server functionality here. Basically, create a data collection where you specify your MQTT broker, and add data inputs. One of the data inputs would be with a Modbus source, while the other one - MNF or Base. MNF or Base data will always be included since it is always availabe, while Modbus depends on the data in the Modbus database (Modbus client sends requests and puts data into the database).

In case the issue persists, please share screenshots of your configurations. Before you do, ensure that you hide/blur any sensitive information, such as connection strings, passwords, etc.

Kind Regards,

Hello. Thanks for your prompt reply.
I have the latest rev of the FW : 7.05.4
I tried with these additional data inputs without any results… no chance to have a window where we see what the device is doing ?

Hello. I tested the MQTT principles with HiveMQ and it works (using credentials). So, maybe the issue is related to the certificates from AWS.
Could you confirm how to get them properly and how to name them.


The following configuration example here includes information on how to generate and use certificates when using AWS MQTT. Please, follow the steps outlined in the article.

Kind Regards,


Thanks for your reply.

I am pretty sure to have followed what is described here… Actually, I succeeded with credentials and another MQTT browser.

I will retry anyway… otherwise don’t you see any tricky thing related to this ?
Do you also see a way so see what happens (error messages, …) at the TRB245 side regarding this communication ?



Here is the config of AWS part of TRB245… but still not working…

Hello. I followed the thing carefully but it is still blocked somewhere… Any additional advice like a way to see what happens and where it is stuck ?


You can try to check connectivity via mosquitto directly. For this, you will need to upload certificates to your RUT device first. For example, to /etc or /tmp directory. You can use SCP or SFTP (here).

Access your device via CLI/SSH (username ‘root’):

# install client

opkg update
opkg install mosquitto-client-ssl

# subscribe

mosquitto_sub -h <Endpoint> -p 8883 --cafile <certificate_authority> --cert <client_certificate> --key <private_key> -t <topic>


mosquitto_sub -h -p 8883 --cafile AmazonRootCA1.pem.crt --cert <*>-certificate.pem.crt --key <*>-private.pem.key -t test

# publish
mosquitto_pub -q 0 -h <Endpoint> -p 8883 --cafile <certificate_authority> --cert <client_certificate> --key <private_key> -t <topic> -m ‘<message>’


mosquitto_pub -q 0 -h -p 8883 –cafile AmazonRootCA1.pem.crt --cert <*>-certificate.pem.crt --key <*>-private.pem.key -t test -m ‘Test message’

More information on these commands can be found here.

Kind Regards,

Hello. I followed your instructions but I got an error at the end.
Few questions :

  • Are you sure there is only one ‘-’ before cafile ?
  • I got the following message : “can’t open *: no such file”

The files are present in the /etc folder on TRB245.
I types " ```
mosquitto_pub -q 0 -h -p 8883 –cafile AmazonRootCA1.pem.crt --cert <>-certificate.pem.crt --key <>-private.pem.key -t test -m ‘Test message’
with the appropriate endpoint and certificates names.

Any other suggestion ?

Thanks in advance.


This is likely an issue with formatting. It should be double, i.e. ‘--’.

Also, if you uploaded the files to /etc folder, you need to specify the path to those files. For example:

--cert /etc/certificate.pem.crt

Kind Regards,

1 Like

I got "Error: The connection was lost. " once I did this test…
Any additional advice ?

This topic was automatically closed after 15 days. New replies are no longer allowed.


It seems like an issue can potentially be with internet connectivity or reaching AWS specifically.

Could you try using a different SIM for testing?

Also, could you please try navigating to Network → WAN → edit mob1s1a1 interface → Advanced settings and add custom DNS? Try adding both, and

Kind Regards,

Regarding the SIM, I suceeded to send MQTT messages to another MQTT broker using credentials (login password) but not with AWS. But I succeeded to send MQTT message using Python and the AWS certificates… So, as far as I see, both the wireless connection and certificates look correct.
I will try about DNS on Monday.
I keep you informed.

This topic was automatically closed after 5 days. New replies are no longer allowed.