How to connect with mosquitto?

I'm using the system generated example from an Uno with WiFi 101. In serial monitor it is showing "publishing on" and "publishing off".

I'm trying to subscribe to the topic with mosquitto. I have created two Things: a publishing_device and a listening_device.

I can't figure out all of the pieces. Write now my command looks like:

mosquitto_sub -h mqtt.arduino.cc -p 8883 -u <cloud_username> -P <listening_device_password> -i <listening_device_id> -v -t <cloud_username>/<publishing_devicename>/blink

Nor getting any errors nor is my client receiving any of the messages.

Okay, I missed the SSL part. You need to get mosquitto a certificate authority so it can communicate with Arduino IoT over SSL.

I downloaded the "GoDaddy Class 2 Certification Authority Root Certificate - G2" cert from https://certs.godaddy.com/repository.

Then added --cafile gdroot-g2.crt to my mosquitto file path.

So my new mosquitto command line is:

mosquitto_sub -h mqtt.arduino.cc -p 8883 -u <listening_deviceId> -P <listening_devicePassword> -i <listening_deviceName> -v -d -t /<mqtt username>/<publishing_deviceName>/<publishing_topic> --cafile gdroot-g2.crt

The mosquitto command is correct, but mqtt doesn't allow to an user to establish multiple connection with the same client id.

If you want to use mosquitto you have to create an object for the pub and one for the sub client, or you can simply write a script to do that with a single connection.

gilbibius:
If you want to use mosquitto you have to create an object for the pub and one for the sub client, or you can simply write a script to do that with a single connection.

As I said in the first post, I did that.

So that was NOT the problem. The problem is that I did not provide a CA for mosquitto to establish an SSL connection, which is what I said in the 2nd post.

Just checked with your mosquitto command and works, have you checked the sha256 of the gdroot-g2.crt?

Can you share the output of mosquitto pub and sub?